Encryption: Fix multiple data keys migration (#49848)
* Add migration * Migrator: Extend support to rename columns * Fix getting current key * Fix column name in migration * Fix deks reencryption * Fix caching * Add back separate caches for byName and byPrefix * Do not concatenate prefix with uid * Rename DataKey struc fields * SQLStore: Add deprecation comments for breaking migrations * Add comment * Minor corrections Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
This commit is contained in:
co-authored by
Joan López de la Franca Beltran
parent
8de4ffe61f
commit
4f8111e24e
@@ -33,7 +33,7 @@ type Service interface {
|
||||
// Store defines methods to interact with secrets storage
|
||||
type Store interface {
|
||||
GetDataKey(ctx context.Context, id string) (*DataKey, error)
|
||||
GetCurrentDataKey(ctx context.Context, name string) (*DataKey, error)
|
||||
GetCurrentDataKey(ctx context.Context, label string) (*DataKey, error)
|
||||
GetAllDataKeys(ctx context.Context) ([]*DataKey, error)
|
||||
CreateDataKey(ctx context.Context, dataKey *DataKey) error
|
||||
CreateDataKeyWithDBSession(ctx context.Context, dataKey *DataKey, sess *xorm.Session) error
|
||||
@@ -61,7 +61,7 @@ func (id ProviderID) Kind() (string, error) {
|
||||
return parts[0], nil
|
||||
}
|
||||
|
||||
func KeyName(scope string, providerID ProviderID) string {
|
||||
func KeyLabel(scope string, providerID ProviderID) string {
|
||||
return fmt.Sprintf("%s/%s@%s", time.Now().Format("2006-01-02"), scope, providerID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user