Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Add more testing for presigned URLs - #544

Merged
cbodley merged 1 commit into
ceph:masterfrom
tobias-urdin:improve-presigned
Feb 12, 2024
Merged

cbodley merged 1 commit into
ceph:masterfrom
tobias-urdin:improve-presigned

Conversation

@tobias-urdin

@tobias-urdin tobias-urdin commented Feb 5, 2024 •

Copy link
Copy Markdown
Contributor

This improves the testing for presigned URLs for
both get_object and put_object when using
generate_presigned_url().

It covers the case where you pass for example
a x-amz-acl (ACL in params for generated_presigned_url) header that should be signed.

Tests the regression in [1].

[1] https://tracker.ceph.com/issues/64308

This was referenced Feb 5, 2024
@tobias-urdin

tobias-urdin commented Feb 5, 2024 •

Copy link
Copy Markdown
Contributor Author
tox -- s3tests_boto3/functional/test_s3.py -k 'test_object_presigned_put_object_with_acl or test_cors_presigned or test_object_raw_get_x_amz_expires_not_expired' -v

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tox -- s3tests_boto3/functional/test_s3.py -k 'test_object_presigned_put_object_with_acl or test_cors_presigned or test_object_raw_get_x_amz_expires_not_expired' -v

i managed to run these against aws and saw them pass against both us-east-1 and -2 👍

that took a few minor changes to work around errors like AclWithBlockPublicAccessError and IllegalLocationConstraintException, and it didn't exercise tenants. i used the same iam user credentials for [s3 main] [s3 alt] and [s3 tenant]

Comment thread s3tests_boto3/functional/test_s3.py Outdated
Comment on lines +3529 to +3530
bucket_name = get_new_bucket()
client.create_bucket(Bucket=bucket_name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_new_bucket() actually creates the bucket using the default get_client(), so client.create_bucket() always recreates it. in the tenant test, this recreation is expected to fail:

An error occurred (BucketAlreadyExists) when calling the CreateBucket operation: Cannot modify existing access control policy

strangely, i'm only seeing it fail that way in the rgw/dbstore suite

you can either call get_new_bucket(client) with the correct client, or call get_new_bucket_name() just to generate the name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, the tenanted user would create a different bucket with the same name. i guess dbstore just doesn't handle the tenants correctly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice catch, I've changed to your suggestion get_new_bucket(client)

This improves the testing for presigned URLs for
both get_object and put_object when using
generate_presigned_url().

It covers the case where you pass for example
a x-amz-acl (ACL in params for generated_presigned_url)
header that should be signed.

Tests the regression in [1].

[1] https://tracker.ceph.com/issues/64308

Signed-off-by: Tobias Urdin <[email protected]>
@cbodley
cbodley merged commit 1d5764d into ceph:master Feb 12, 2024
@cbodley

cbodley commented Feb 13, 2024

Copy link
Copy Markdown
Contributor

cc @alimaredia i cherry-picked this to ceph-pacific after merging ceph/ceph#55550

it's still needed on ceph-master, but i'll wait until after the squid freeze in case there are pending jobs without the fix from ceph/ceph#55458

@cbodley

cbodley commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

cherry-picked to ceph-master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants