Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: grant v2 collection name and privilege error typo #38195

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/proxy/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -5365,7 +5365,7 @@ func (node *Proxy) validateOperatePrivilegeV2Params(req *milvuspb.OperatePrivile
return err
}
}
if err := ValidateObjectName(req.CollectionName); err != nil {
if err := ValidateCollectionName(req.CollectionName); err != nil {
return err
}
return nil
Expand Down
7 changes: 7 additions & 0 deletions internal/proxy/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,13 @@ func ValidateObjectName(entity string) error {
return validateName(entity, "object name")
}

func ValidateCollectionName(entity string) error {
if util.IsAnyWord(entity) {
return nil
}
return validateName(entity, "collection name")
}

func ValidateObjectType(entity string) error {
return validateName(entity, "ObjectType")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/merr/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func WrapErrDatabaseNameInvalid(database any, msg ...string) error {
}

func WrapErrPrivilegeGroupNameInvalid(privilegeGroup any, msg ...string) error {
err := wrapFields(ErrPrivilegeGroupInvalidName, value("privielgeGroup", privilegeGroup))
err := wrapFields(ErrPrivilegeGroupInvalidName, value("privilegeGroup", privilegeGroup))
if len(msg) > 0 {
err = errors.Wrap(err, strings.Join(msg, "->"))
}
Expand Down
Loading