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 test_object_copy_canned_acl #459

Closed
alexvanin opened this issue May 26, 2022 · 3 comments · Fixed by #487
Closed

Fix test_object_copy_canned_acl #459

alexvanin opened this issue May 26, 2022 · 3 comments · Fixed by #487
Assignees
Milestone

Comments

@alexvanin
Copy link
Contributor

This test sets canned ACL to the object.

def test_object_copy_canned_acl():
    bucket_name = get_new_bucket()
    client = get_client()
    alt_client = get_alt_client()
    client.put_object(Bucket=bucket_name, Key='foo123bar', Body='foo')

    copy_source = {'Bucket': bucket_name, 'Key': 'foo123bar'}
    client.copy_object(Bucket=bucket_name, CopySource=copy_source, Key='bar321foo', ACL='public-read')
    ## check ACL is applied by doing GET from another user
    alt_client.get_object(Bucket=bucket_name, Key='bar321foo')  # <- FAILED HERE

    metadata={'abc': 'def'}
    copy_source = {'Bucket': bucket_name, 'Key': 'bar321foo'}
    client.copy_object(ACL='public-read', Bucket=bucket_name, CopySource=copy_source, Key='foo123bar', Metadata=metadata, MetadataDirective='REPLACE')

    # check ACL is applied by doing GET from another user
    alt_client.get_object(Bucket=bucket_name, Key='foo123bar')

ACL is not processed during object copying, therefore alt client fails with

layer/object.go:710     error was transformed   {"request_id": "46f7588e-02a7-47ff-94ff-6d26354983bd", "error": "access denied: access to operation SEARCH is denied by extended ACL check: bearer token is not signed by the container owner"}
handler/util.go:25      could not find object   {"request_id": "46f7588e-02a7-47ff-94ff-6d26354983bd", "method": "GetObject", "bucket_name": "yournamehere-sdcore7ma75qo04d-1", "object_name": "bar321foo", "error": "AccessDenied: 403 => Access Denied."}
@alexvanin
Copy link
Contributor Author

Let's see if we can access other containers without bearer token and access our containers with bearer token.

@alexvanin
Copy link
Contributor Author

Probably we need to wait for SDK update, because it will have a token method to check if container ID is related to the token. Based on this method, we can decide whether we attach bearer token or not.

@alexvanin
Copy link
Contributor Author

Reopen to do this after tree-service branch rebase: #487 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants