Encryption: Add support for data keys re-encryption (#43548)
* Encryption: Add support for data keys re-encryption * Add tests for data keys re-encryption * Update code after refactorings Co-authored-by: Leonard Gram <leo@xlson.com>
This commit is contained in:
co-authored by
Leonard Gram
parent
16f0c6617a
commit
b2655750e8
@@ -353,6 +353,17 @@ func (s *SecretsService) GetProviders() map[secrets.ProviderID]secrets.Provider
|
||||
return s.providers
|
||||
}
|
||||
|
||||
func (s *SecretsService) ReEncryptDataKeys(ctx context.Context) error {
|
||||
err := s.store.ReEncryptDataKeys(ctx, s.providers, s.currentProviderID)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Invalidate cache
|
||||
s.dataKeyCache = make(map[string]dataKeyCacheItem)
|
||||
return err
|
||||
}
|
||||
|
||||
// These variables are used to test the code
|
||||
// responsible for periodically cleaning up
|
||||
// data encryption keys cache.
|
||||
|
||||
Reference in New Issue
Block a user