mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 23:41:52 +08:00
fix(region): redis create account add name validate
公有云redis不允许创建名为root的账号 #6398
This commit is contained in:
@@ -1370,7 +1370,7 @@ func (self *SAliyunRegionDriver) ValidateCreateElasticcacheAccountData(ctx conte
|
||||
accountPrivilegeV.Value)
|
||||
}
|
||||
|
||||
return data, nil
|
||||
return self.SManagedVirtualizationRegionDriver.ValidateCreateElasticcacheAccountData(ctx, userCred, ownerId, data)
|
||||
}
|
||||
|
||||
func (self *SAliyunRegionDriver) RequestCreateElasticcacheAccount(ctx context.Context, userCred mcclient.TokenCredential, ea *models.SElasticcacheAccount, task taskman.ITask) error {
|
||||
|
||||
@@ -2289,7 +2289,11 @@ func (self *SManagedVirtualizationRegionDriver) RequestElasticcacheUpdateBackupP
|
||||
}
|
||||
|
||||
func (self *SManagedVirtualizationRegionDriver) ValidateCreateElasticcacheAccountData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
return nil, nil
|
||||
if name, _ := data.GetString("name");name == "root" {
|
||||
return nil, httperrors.NewConflictError("account name 'root' is not allowed")
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (self *SManagedVirtualizationRegionDriver) ValidateCreateElasticcacheAclData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
|
||||
@@ -1701,7 +1701,7 @@ func (self *SQcloudRegionDriver) ValidateCreateElasticcacheAccountData(ctx conte
|
||||
return nil, httperrors.NewWeakPasswordError()
|
||||
}
|
||||
|
||||
return data, nil
|
||||
return self.SManagedVirtualizationRegionDriver.ValidateCreateElasticcacheAccountData(ctx, userCred, ownerId, data)
|
||||
}
|
||||
|
||||
func (self *SQcloudRegionDriver) RequestCreateElasticcacheAccount(ctx context.Context, userCred mcclient.TokenCredential, ea *models.SElasticcacheAccount, task taskman.ITask) error {
|
||||
|
||||
Reference in New Issue
Block a user