use noop cache
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package manager
|
||||
|
||||
import "github.com/grafana/grafana/pkg/registry/apis/secret/encryption"
|
||||
|
||||
// This is being used as the data key cache in both OSS and Enterprise while we discuss security requirements for DEK caching
|
||||
type noopDataKeyCache struct {
|
||||
}
|
||||
|
||||
func ProvideNoopDataKeyCache() encryption.DataKeyCache {
|
||||
return &noopDataKeyCache{}
|
||||
}
|
||||
|
||||
func (c *noopDataKeyCache) GetById(_ string, _ string) (*encryption.DataKeyCacheEntry, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (c *noopDataKeyCache) GetByLabel(_ string, _ string) (*encryption.DataKeyCacheEntry, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (c *noopDataKeyCache) AddById(_ string, _ *encryption.DataKeyCacheEntry) {}
|
||||
|
||||
func (c *noopDataKeyCache) AddByLabel(_ string, _ *encryption.DataKeyCacheEntry) {}
|
||||
|
||||
func (c *noopDataKeyCache) RemoveExpired() {}
|
||||
|
||||
func (c *noopDataKeyCache) Flush(_ string) {}
|
||||
Generated
+3
-3
@@ -482,7 +482,7 @@ func Initialize(ctx context.Context, cfg *setting.Cfg, opts Options, apiOpts api
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dataKeyCache := manager2.ProvideOSSDataKeyCache(cfg)
|
||||
dataKeyCache := manager2.ProvideNoopDataKeyCache()
|
||||
encryptionManager, err := manager2.ProvideEncryptionManager(tracer, dataKeyStorage, usageStats, cipher, providerConfig, dataKeyCache, cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1122,7 +1122,7 @@ func InitializeForTest(ctx context.Context, t sqlutil.ITestDB, testingT interfac
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dataKeyCache := manager2.ProvideOSSDataKeyCache(cfg)
|
||||
dataKeyCache := manager2.ProvideNoopDataKeyCache()
|
||||
encryptionManager, err := manager2.ProvideEncryptionManager(tracer, dataKeyStorage, usageStats, cipher, providerConfig, dataKeyCache, cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1658,7 +1658,7 @@ func InitializeForCLI(ctx context.Context, cfg *setting.Cfg) (Runner, error) {
|
||||
if err != nil {
|
||||
return Runner{}, err
|
||||
}
|
||||
dataKeyCache := manager2.ProvideOSSDataKeyCache(cfg)
|
||||
dataKeyCache := manager2.ProvideNoopDataKeyCache()
|
||||
encryptionManager, err := manager2.ProvideEncryptionManager(tracer, dataKeyStorage, usageStats, cipher, providerConfig, dataKeyCache, cfg)
|
||||
if err != nil {
|
||||
return Runner{}, err
|
||||
|
||||
@@ -149,7 +149,8 @@ var wireExtsBasicSet = wire.NewSet(
|
||||
aggregatorrunner.ProvideNoopAggregatorConfigurator,
|
||||
apisregistry.WireSetExts,
|
||||
gsmKMSProviders.ProvideOSSKMSProviders,
|
||||
gsmEncryptionManager.ProvideOSSDataKeyCache,
|
||||
//gsmEncryptionManager.ProvideOSSDataKeyCache, // Temporarily use noop cache
|
||||
gsmEncryptionManager.ProvideNoopDataKeyCache,
|
||||
secret.ProvideSecureValueClient,
|
||||
provisioningExtras,
|
||||
configProviderExtras,
|
||||
|
||||
Reference in New Issue
Block a user