forked from TrueCloudLab/frostfs-s3-gw
[#522] Suppress CodeQL error
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
9f740b9683
commit
6e1a1f3839
1 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
|
stderrors "errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -467,7 +468,7 @@ func addGrantees(list []*Grant, headers http.Header, hdr string) ([]*Grant, erro
|
||||||
|
|
||||||
for _, grantee := range grantees {
|
for _, grantee := range grantees {
|
||||||
if grantee.Type == acpAmazonCustomerByEmail || (grantee.Type == acpGroup && grantee.URI != allUsersGroup) {
|
if grantee.Type == acpAmazonCustomerByEmail || (grantee.Type == acpGroup && grantee.URI != allUsersGroup) {
|
||||||
return nil, fmt.Errorf("unsupported grantee: %v", grantee)
|
return nil, stderrors.New("unsupported grantee type")
|
||||||
}
|
}
|
||||||
|
|
||||||
list = append(list, &Grant{
|
list = append(list, &Grant{
|
||||||
|
@ -1017,7 +1018,7 @@ func aclToAst(acl *AccessControlPolicy, resInfo *resourceInfo) (*ast, error) {
|
||||||
|
|
||||||
for _, grant := range acl.AccessControlList {
|
for _, grant := range acl.AccessControlList {
|
||||||
if grant.Grantee.Type == acpAmazonCustomerByEmail || (grant.Grantee.Type == acpGroup && grant.Grantee.URI != allUsersGroup) {
|
if grant.Grantee.Type == acpAmazonCustomerByEmail || (grant.Grantee.Type == acpGroup && grant.Grantee.URI != allUsersGroup) {
|
||||||
return nil, fmt.Errorf("unsupported grantee: %v", grant.Grantee)
|
return nil, stderrors.New("unsupported grantee type")
|
||||||
}
|
}
|
||||||
|
|
||||||
role := eacl.RoleUser
|
role := eacl.RoleUser
|
||||||
|
@ -1049,7 +1050,7 @@ func aclToPolicy(acl *AccessControlPolicy, resInfo *resourceInfo) (*bucketPolicy
|
||||||
|
|
||||||
for _, grant := range acl.AccessControlList {
|
for _, grant := range acl.AccessControlList {
|
||||||
if grant.Grantee.Type == acpAmazonCustomerByEmail || (grant.Grantee.Type == acpGroup && grant.Grantee.URI != allUsersGroup) {
|
if grant.Grantee.Type == acpAmazonCustomerByEmail || (grant.Grantee.Type == acpGroup && grant.Grantee.URI != allUsersGroup) {
|
||||||
return nil, fmt.Errorf("unsupported grantee: %v", grant.Grantee)
|
return nil, stderrors.New("unsupported grantee type")
|
||||||
}
|
}
|
||||||
|
|
||||||
user := grant.Grantee.ID
|
user := grant.Grantee.ID
|
||||||
|
@ -1261,7 +1262,7 @@ func bucketACLToTable(acp *AccessControlPolicy, resInfo *resourceInfo) (*eacl.Ta
|
||||||
|
|
||||||
for _, grant := range acp.AccessControlList {
|
for _, grant := range acp.AccessControlList {
|
||||||
if !isValidGrant(grant) {
|
if !isValidGrant(grant) {
|
||||||
return nil, fmt.Errorf("unsupported grantee: %v", grant.Grantee)
|
return nil, stderrors.New("unsupported grantee")
|
||||||
}
|
}
|
||||||
if grant.Grantee.ID == acp.Owner.ID {
|
if grant.Grantee.ID == acp.Owner.ID {
|
||||||
found = true
|
found = true
|
||||||
|
|
Loading…
Reference in a new issue