-
Notifications
You must be signed in to change notification settings - Fork 15
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
PutBucketACL: unable to remove current grants #861
Comments
The main problem here is the gate ACL response $ aws --no-paginate s3api get-bucket-acl --bucket $BUCKET --endpoint http://localhost:19080
{
"Owner": {
"DisplayName": "Nj9FF9jYTsyX2XniTw5Kqy3Zf91nbhdYiM",
"ID": "Nj9FF9jYTsyX2XniTw5Kqy3Zf91nbhdYiM"
},
"Grants": [
{
"Grantee": {
"DisplayName": "Nj9FF9jYTsyX2XniTw5Kqy3Zf91nbhdYiM",
"ID": "033845e8ebc78251029261cbc0e9bae104d2b7cc9fee5c79720a30332d5b3d1aa0",
"Type": "CanonicalUser"
},
"Permission": "FULL_CONTROL"
}
]
} Here in Owner.ID and Owner.DisplayName we put the wallet address. This is the only available information from the bucket about the owner. Owner.ID should have the owner's public key, like in the Grantee section, to execute such set-acl requests without canned rules. The first thought that came to my mind is putting the owner public key to container attributes. But what if a container was created without s3 gate? It means the side system will not add the required information to the attributes. About the issue in general, does it make sense to restrict yourself to the bucket? |
Let's try container attributes (forget about non-S3 containers) until we have nspcc-dev/neofs-api#278. |
Needs to be checked against the AWS, any behavior can be justified. |
We've got new tokens with addresses, maybe something can be improved here. |
Closes #861. Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
After the latest changes, the GRANTS look different and consistent: {
"Owner": {
"DisplayName": "NiskPF9pfRMzg7V7PeB4d6ogLzu74a1L2Q",
"ID": "NiskPF9pfRMzg7V7PeB4d6ogLzu74a1L2Q"
},
"Grants": [
{
"Grantee": {
"DisplayName": "NiskPF9pfRMzg7V7PeB4d6ogLzu74a1L2Q",
"ID": "NiskPF9pfRMzg7V7PeB4d6ogLzu74a1L2Q",
"Type": "CanonicalUser"
},
"Permission": "FULL_CONTROL"
}
]
} Now it is possible to upload downloaded ACL grants to the bucket without error. For test I used the next script: export BUCKET=heh$(date +%s); echo $BUCKET; aws s3api create-bucket --bucket $BUCKET --endpoint http://localhost:19080
aws s3api get-bucket-acl --bucket $BUCKET --endpoint-url http://localhost:19080 > ACL.json
aws s3api put-bucket-acl --bucket $BUCKET --endpoint-url http://localhost:19080 --access-control-policy file://ACL.json Despite this, it has no effect on the bucket owner grants. There is impossible to remove GRANTS from container owner |
Current grants:
We want to remove Grants and trying to PUT following json:
But get 500:
The text was updated successfully, but these errors were encountered: