fix: mysql 绑定用户增加输入校验 (#6149)

This commit is contained in:
ssongliu 2024-08-16 14:00:31 +08:00 committed by GitHub
parent 779addfcb4
commit 1b92b6cbfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,6 +141,10 @@ func (u *MysqlService) Create(ctx context.Context, req dto.MysqlDBCreate) (*mode
}
func (u *MysqlService) BindUser(req dto.BindUser) error {
if cmd.CheckIllegal(req.Username, req.Password, req.Permission) {
return buserr.New(constant.ErrCmdIllegal)
}
dbItem, err := mysqlRepo.Get(mysqlRepo.WithByMysqlName(req.Database), commonRepo.WithByName(req.DB))
if err != nil {
return err