Encryption: Add support for multiple data keys per day (#47765)
* Add database migrations * Use short uids as data key ids * Add support for manual data key rotation * Fix duplicated mutex unlocks * Fix migration * Manage current data keys per name * Adjust key re-encryption and test * Modify rename column migration for MySQL compatibility * Refactor secrets manager and data keys cache * Multiple o11y adjustments * Fix stats query * Apply suggestions from code review Co-authored-by: Tania <yalyna.ts@gmail.com> * Fix linter * Docs: Rotate data encryption keys API endpoint Co-authored-by: Tania <yalyna.ts@gmail.com>
This commit is contained in:
co-authored by
Tania
parent
ae8c11bfa4
commit
e43879e55d
@@ -108,6 +108,32 @@ func (m *AddColumnMigration) SQL(dialect Dialect) string {
|
||||
return dialect.AddColumnSQL(m.tableName, m.column)
|
||||
}
|
||||
|
||||
type RenameColumnMigration struct {
|
||||
MigrationBase
|
||||
table Table
|
||||
oldName string
|
||||
newName string
|
||||
}
|
||||
|
||||
func NewRenameColumnMigration(table Table, oldName, newName string) *RenameColumnMigration {
|
||||
return &RenameColumnMigration{table: table, oldName: oldName, newName: newName}
|
||||
}
|
||||
|
||||
func (m *RenameColumnMigration) Table(table Table) *RenameColumnMigration {
|
||||
m.table = table
|
||||
return m
|
||||
}
|
||||
|
||||
func (m *RenameColumnMigration) Rename(oldName string, newName string) *RenameColumnMigration {
|
||||
m.oldName = oldName
|
||||
m.newName = newName
|
||||
return m
|
||||
}
|
||||
|
||||
func (m *RenameColumnMigration) SQL(d Dialect) string {
|
||||
return d.RenameColumn(m.table, m.oldName, m.newName)
|
||||
}
|
||||
|
||||
type AddIndexMigration struct {
|
||||
MigrationBase
|
||||
tableName string
|
||||
|
||||
Reference in New Issue
Block a user