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

Return correct error on invalid grantee type #926

Merged
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
6 changes: 3 additions & 3 deletions api/handler/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@

for _, grantee := range grantees {
if grantee.Type == granteeAmazonCustomerByEmail || (grantee.Type == granteeGroup && grantee.URI != allUsersGroup) {
return nil, stderrors.New("unsupported grantee type")
return nil, s3errors.GetAPIError(s3errors.ErrNotSupported)
}

list = append(list, &Grant{
Expand Down Expand Up @@ -1186,7 +1186,7 @@

for _, grant := range acl.AccessControlList {
if grant.Grantee.Type == granteeAmazonCustomerByEmail || (grant.Grantee.Type == granteeGroup && grant.Grantee.URI != allUsersGroup) {
return nil, stderrors.New("unsupported grantee type")
return nil, s3errors.GetAPIError(s3errors.ErrNotSupported)

Check warning on line 1189 in api/handler/acl.go

View check run for this annotation

Codecov / codecov/patch

api/handler/acl.go#L1189

Added line #L1189 was not covered by tests
}

var groupGrantee bool
Expand Down Expand Up @@ -1225,7 +1225,7 @@

for _, grant := range acl.AccessControlList {
if grant.Grantee.Type == granteeAmazonCustomerByEmail || (grant.Grantee.Type == granteeGroup && grant.Grantee.URI != allUsersGroup) {
return nil, stderrors.New("unsupported grantee type")
return nil, s3errors.GetAPIError(s3errors.ErrNotSupported)

Check warning on line 1228 in api/handler/acl.go

View check run for this annotation

Codecov / codecov/patch

api/handler/acl.go#L1228

Added line #L1228 was not covered by tests
}

user := grant.Grantee.ID
Expand Down
Loading