Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions service/kas/kas.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ func NewRegistration() *serviceregistry.Service[kasconnect.AccessServiceHandler]

// Configure new delegation service
p.KeyDelegator = trust.NewDelegatingKeyService(NewPlatformKeyIndexer(srp.SDK, kasURL.String(), srp.Logger), srp.Logger, cacheClient)
if len(srp.KeyManagerFactories) > 0 {
srp.Logger.Error("kas service ignores legacy KeyManagerFactories; using KeyManagerCtxFactories instead")
}
for _, manager := range srp.KeyManagerCtxFactories {
p.KeyDelegator.RegisterKeyManagerCtx(manager.Name, manager.Factory)
kmgrs = append(kmgrs, manager.Name)
Expand Down
13 changes: 0 additions & 13 deletions service/pkg/server/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,6 @@ func startServices(ctx context.Context, params startServicesParams) (func(), err
cacheManager := params.cacheManager
keyManagerCtxFactories := params.keyManagerCtxFactories

// Create a copy of the key manager factories as the context version for legacy services that don't load the new version with context
var keyManagerFactories []trust.NamedKeyManagerFactory
for _, factory := range keyManagerCtxFactories {
keyManagerFactories = append(keyManagerFactories, trust.NamedKeyManagerFactory{
Name: factory.Name,
//nolint:contextcheck // This is called later, so will be in a new context
Factory: func(opts *trust.KeyManagerFactoryOptions) (trust.KeyManager, error) {
return factory.Factory(context.Background(), opts)
},
})
}

// Iterate through the registered namespaces
for _, nsInfo := range reg.GetNamespaces() {
ns := nsInfo.Name
Expand Down Expand Up @@ -229,7 +217,6 @@ func startServices(ctx context.Context, params startServicesParams) (func(), err
OTDF: otdf, // TODO: REMOVE THIS
Tracer: tracer,
NewCacheClient: createCacheClient,
KeyManagerFactories: keyManagerFactories,
KeyManagerCtxFactories: keyManagerCtxFactories,
})
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions service/pkg/serviceregistry/serviceregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ type RegistrationParams struct {
// NewCacheClient is a function that can be used to create a new cache instance for the service
NewCacheClient func(cache.Options) (*cache.Cache, error)

// KeyManagerFactories are the registered key manager factories that can be used to create
// key managers for the service to use.
// Prefer KeyManagerCtxFactories
// EXPERIMENTAL
KeyManagerFactories []trust.NamedKeyManagerFactory

// KeyManagerCtxFactories are the registered key manager context factories that can be used to create
// key managers for the service to use.
// EXPERIMENTAL
Expand Down
6 changes: 1 addition & 5 deletions service/policy/keymanagement/key_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ func NewRegistration(ns string, dbRegister serviceregistry.DBRegister) *servicer
ksvc.config = cfg
ksvc.dbClient = policydb.NewClient(srp.DBClient, srp.Logger, int32(cfg.ListRequestLimitMax), int32(cfg.ListRequestLimitDefault))

// Register key managers in well-known configuration
ksvc.keyManagerFactories = make([]registeredManagers, 0, len(srp.KeyManagerFactories))
if len(srp.KeyManagerFactories) > 0 {
srp.Logger.Error("keymanagement: ignoring legacy KeyManagerFactories; using KeyManagerCtxFactories instead")
}
managersMap := make(map[string]any)
ksvc.keyManagerFactories = make([]registeredManagers, 0, len(srp.KeyManagerCtxFactories))
for i, factory := range srp.KeyManagerCtxFactories {
rm := registeredManagers{
Name: factory.Name,
Expand Down
Loading