Skip to content

Commit

Permalink
Add the ability for enterprise to override PKI backend attributes dur…
Browse files Browse the repository at this point in the history
…ing setup (#21618)
  • Loading branch information
stevendpclark authored Jul 6, 2023
1 parent 304ecfc commit 9b9017a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
15 changes: 2 additions & 13 deletions builtin/logical/pki/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

"github.com/armon/go-metrics"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/vault/helper/constants"
"github.com/hashicorp/vault/helper/metricsutil"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/sdk/framework"
Expand Down Expand Up @@ -271,18 +270,8 @@ func Backend(conf *logical.BackendConfig) *backend {
// We specifically do NOT add acme/new-eab to this as it should be auth'd
}

if constants.IsEnterprise {
// Unified CRL/OCSP paths are ENT only
entOnly := []*framework.Path{
pathGetIssuerUnifiedCRL(&b),
pathListCertsRevocationQueue(&b),
pathListUnifiedRevoked(&b),
pathFetchUnifiedCRL(&b),
buildPathUnifiedOcspGet(&b),
buildPathUnifiedOcspPost(&b),
}
b.Backend.Paths = append(b.Backend.Paths, entOnly...)
}
// modify the backend with ENT specific attributes, I.E. paths..
setupEntSpecificBackend(&b)

b.tidyCASGuard = new(uint32)
b.tidyCancelCAS = new(uint32)
Expand Down
10 changes: 10 additions & 0 deletions builtin/logical/pki/backend_oss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build !enterprise

package pki

func setupEntSpecificBackend(_ *backend) {
// ENT hook is not used by OSS.
}

0 comments on commit 9b9017a

Please sign in to comment.