mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-18 18:38:08 -05:00
Backport IBM License key integration: config file changes into ce/main (#11665)
* IBM License key integration: config file changes (#11509) * adding config changes for ibm license entitlement * added ibm licensing_ent_test * adding newlicensing test * fix TestLicenseEntitlementConfig test * Update vault/core_util_ent.go Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com> * Update vault/licensing_ent.go Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com> * fixing name GenerateHashicorpTestLicenseConfig * remove local vscode settings * add a func to create entitlements and a sample ibm license --------- Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com> * go mod tidy * adding issueroptions to ce --------- Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com> Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com> Co-authored-by: akshya96 <araghavan@hashicorp.com>
This commit is contained in:
parent
1484f71665
commit
ffee73240b
5 changed files with 18 additions and 1 deletions
1
go.mod
1
go.mod
|
|
@ -102,6 +102,7 @@ require (
|
|||
github.com/hashicorp/go-kms-wrapping/wrappers/gcpckms/v2 v2.0.13
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.9
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.13
|
||||
github.com/hashicorp/go-licensing/v4 v4.0.0
|
||||
github.com/hashicorp/go-memdb v1.3.5
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/go-pgmultiauth v1.0.0
|
||||
|
|
|
|||
2
go.sum
2
go.sum
|
|
@ -1425,6 +1425,8 @@ github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.9 h1:rlKOPHzZ41QeV/
|
|||
github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.9/go.mod h1:pHJfTvq97FAKCWxIJOHZWQmVfRXmUN6tmgEcgj3nC+M=
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.13 h1:UuDeq3nr0e+H9CrZM3dvpDGkWFSJYTtuTqVekn2za2k=
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.13/go.mod h1:E2dYgXYNkvKe84PIxD9eJqqhFRA4guCTDweJR4i0gds=
|
||||
github.com/hashicorp/go-licensing/v4 v4.0.0 h1:IOtq8ezthoi4hz4QydrI6SPh+4sO0SIH3EpQamr+X/0=
|
||||
github.com/hashicorp/go-licensing/v4 v4.0.0/go.mod h1:7ka+DZIQedW+TJGW0bH+FNLftDXKV4Br1+9S4PiPyps=
|
||||
github.com/hashicorp/go-memdb v1.3.5 h1:b3taDMxCBCBVgyRrS1AZVHO14ubMYZB++QpNhBg+Nyo=
|
||||
github.com/hashicorp/go-memdb v1.3.5/go.mod h1:8IVKKBkVe+fxFgdFOYxzQQNjz+sWCyHCdIC/+5+Vy1Y=
|
||||
github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY=
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import (
|
|||
"io"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-licensing/v4"
|
||||
"github.com/hashicorp/vault/helper/activationflags"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/limits"
|
||||
|
|
@ -38,6 +39,7 @@ func (e entCoreConfig) Clone() entCoreConfig {
|
|||
|
||||
type LicensingConfig struct {
|
||||
AdditionalPublicKeys []interface{}
|
||||
IssuerOptions licensing.IssuerOptions
|
||||
}
|
||||
|
||||
func coreInit(c *Core, conf *CoreConfig) error {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import (
|
|||
"github.com/armon/go-metrics"
|
||||
"github.com/hashicorp/go-cleanhttp"
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-licensing/v4"
|
||||
"github.com/hashicorp/go-secure-stdlib/reloadutil"
|
||||
kv "github.com/hashicorp/vault-plugin-secrets-kv"
|
||||
"github.com/hashicorp/vault/api"
|
||||
|
|
@ -1834,6 +1835,11 @@ func (cluster *TestCluster) StartCore(t testing.TB, idx int, opts *TestClusterOp
|
|||
tcc.Logger().Info("restarted test core", "core", idx)
|
||||
}
|
||||
|
||||
type TestLicenseOptions struct {
|
||||
PubKey ed25519.PublicKey
|
||||
IssuerOptions licensing.IssuerOptions
|
||||
}
|
||||
|
||||
func (testCluster *TestCluster) newCore(t testing.TB, idx int, coreConfig *CoreConfig, opts *TestClusterOptions, listeners []*TestListener, pubKey ed25519.PublicKey) (func(), *Core, CoreConfig, http.Handler) {
|
||||
localConfig := *coreConfig
|
||||
cleanupFunc := func() {}
|
||||
|
|
@ -1971,6 +1977,9 @@ func (testCluster *TestCluster) newCore(t testing.TB, idx int, coreConfig *CoreC
|
|||
// Set test public keys in the core for tests that call license reloads
|
||||
c.testSetTestPubKeys(localConfig.LicensingConfig.AdditionalPublicKeys)
|
||||
|
||||
// Set test license issuer options in the core for tests that call license reloads
|
||||
c.testSetTestIssuerOptions(localConfig.LicensingConfig.IssuerOptions)
|
||||
|
||||
return cleanupFunc, c, localConfig, handler
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ package vault
|
|||
import (
|
||||
"crypto/ed25519"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/go-licensing/v4"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/hashicorp/vault/tools/stubmaker
|
||||
|
|
@ -26,4 +28,5 @@ func (c *TestClusterCore) StopPkiCertificateCountConsumerJob() {}
|
|||
func (c *TestClusterCore) ResetPkiCertificateCounts() {}
|
||||
func (c *TestClusterCore) RequirePkiCertificateCounts(t testing.TB, expectedIssuedCount, expectedStoredCount int) {
|
||||
}
|
||||
func (c *Core) testSetTestPubKeys(additionalKeys []interface{}) {}
|
||||
func (c *Core) testSetTestPubKeys(additionalKeys []interface{}) {}
|
||||
func (c *Core) testSetTestIssuerOptions(testIssuerOpts licensing.IssuerOptions) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue