Merge branch 'main' into llb-byow
This commit is contained in:
commit
2f06513a3a
105 files changed
+2716
-14710
No files matched your search
@@ -396,7 +396,7 @@ func (v *verifier) decryptToken(ctx context.Context) {
|
||||
v.requestInfo.TokenFormat = uint32(AuthTokenTypeUnknown)
|
||||
return
|
||||
}
|
||||
wrapper := v.kms.GetExternalWrappers().Recovery()
|
||||
wrapper := v.kms.GetExternalWrappers(ctx).Recovery()
|
||||
if wrapper == nil {
|
||||
event.WriteError(ctx, op, stderrors.New("no recovery KMS is available"))
|
||||
v.requestInfo.TokenFormat = uint32(AuthTokenTypeUnknown)
|
||||
|
||||
@@ -210,11 +210,7 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
|
||||
|
||||
// Set up repo stuff
|
||||
dbase := db.New(c.conf.Database)
|
||||
kmsRepo, err := kms.NewRepository(dbase, dbase)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating kms repository: %w", err)
|
||||
}
|
||||
c.kms, err = kms.NewKms(kmsRepo)
|
||||
c.kms, err = kms.New(ctx, dbase, dbase)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating kms cache: %w", err)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/hashicorp/boundary/internal/iam"
|
||||
"github.com/hashicorp/boundary/internal/kms"
|
||||
"github.com/hashicorp/boundary/internal/types/scope"
|
||||
@@ -51,8 +50,8 @@ func TestController_New(t *testing.T) {
|
||||
verifyFn()
|
||||
|
||||
// this tests a scenario where there is NOT an audit DEK
|
||||
db.TestDeleteWhere(t, conf.Server.Database, func() interface{} { i := kms.AllocAuditKey(); return &i }(), "1=1")
|
||||
db.TestDeleteWhere(t, conf.Server.Database, func() interface{} { i := kms.AllocOidcKey(); return &i }(), "1=1")
|
||||
kms.TestKmsDeleteKeyPurpose(t, conf.Database, kms.KeyPurposeAudit)
|
||||
kms.TestKmsDeleteKeyPurpose(t, conf.Database, kms.KeyPurposeOidc)
|
||||
|
||||
// re-init an empty cache and assert that the DEKs are not there.
|
||||
kmsCache := kms.TestKms(t, conf.Server.Database, conf.RootKms)
|
||||
|
||||
@@ -74,9 +74,7 @@ func BenchmarkSessionList(b *testing.B) {
|
||||
ctx := context.Background()
|
||||
conn, _ := db.TestSetup(b, "postgres", db.WithTemplate(template.name))
|
||||
rw := db.New(conn)
|
||||
kmsRepo, err := kms.NewRepository(rw, rw)
|
||||
require.NoError(b, err)
|
||||
kmsThing, err := kms.NewKms(kmsRepo)
|
||||
kmsThing, err := kms.New(ctx, rw, rw)
|
||||
require.NoError(b, err)
|
||||
wrap, err := dbtest.GetBoundaryBenchmarksRootKeyWrapper(ctx)
|
||||
require.NoError(b, err)
|
||||
|
||||
Reference in new issue
Block a user