fix: use user owner key to create user (#14015)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2022-04-13 23:15:45 +08:00
committed by GitHub
co-authored by Qiu Jian
parent e898322b07
commit 536407bcdd
3 changed files with 47 additions and 4 deletions
+5 -1
View File
@@ -114,7 +114,7 @@ func (manager *SEncryptedResourceManager) FetchCustomizeColumns(
) []apis.EncryptedResourceDetails {
rets := make([]apis.EncryptedResourceDetails, len(objs))
session := auth.GetSession(ctx, userCred, consts.GetRegion(), "")
session := auth.GetAdminSession(ctx, consts.GetRegion(), "")
encKeys, err := identity_modules.Credentials.GetEncryptKeys(session, userCred.GetUserId())
if err != nil {
return rets
@@ -130,6 +130,10 @@ func (manager *SEncryptedResourceManager) FetchCustomizeColumns(
if encKey, ok := encKeyMap[base.EncryptKeyId]; ok {
rets[i].EncryptKey = encKey.KeyName
rets[i].EncryptAlg = string(encKey.Alg)
rets[i].EncryptKeyUser = string(encKey.User)
rets[i].EncryptKeyUserId = string(encKey.UserId)
rets[i].EncryptKeyUserDomain = string(encKey.Domain)
rets[i].EncryptKeyUserDomainId = string(encKey.DomainId)
}
}
}