Service accounts: Migrate expired API keys (#50883)

This commit is contained in:
Alexander Zobnin
2022-06-16 16:01:50 +02:00
committed by GitHub
parent b09df60464
commit c4f0be7c8d
3 changed files with 29 additions and 6 deletions
@@ -185,6 +185,16 @@ func TestStore_MigrateAllApiKeys(t *testing.T) {
expectedServiceAccouts: 0,
expectedErr: nil,
},
{
desc: "expired api keys should be migrated",
keys: []tests.TestApiKey{
{Name: "test1", Role: models.ROLE_EDITOR, Key: "secret1", OrgId: 1},
{Name: "test2", Role: models.ROLE_EDITOR, Key: "secret2", OrgId: 1, IsExpired: true},
},
orgId: 1,
expectedServiceAccouts: 2,
expectedErr: nil,
},
}
for _, c := range cases {