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

tests: add positive tests for s3 presigned urls #896

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

evgeniiz321
Copy link
Contributor

closes #241

@evgeniiz321
Copy link
Contributor Author

evgeniiz321 commented Nov 25, 2024

@smallhive i have a problem with presigned url returned by boto3. To get the url I use (here is an example from docs - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html#presigned-urls):

self.s3_client.generate_presigned_url(
                    ClientMethod="get_object",
                    Params={"Bucket": bucket, "Key": file_name},
                    ExpiresIn=30,
                    HttpMethod="GET",
                )

This is the url that is returned:

https://localhost:55858/3e26a4ca-595d-4b4d-b592-424d9d739ccd/temp_file_3f2a06c4-77dd-4008-8968-8a384c6f19f0?AWSAccessKeyId=Ci5Z5p4Q56fzfgsmtUsXkMhys4FxM7izUQBmkWx7jUJx0DMygH7VmUxBVVCsAmAmfascvg4sG5kavjTaXG8qa2pok&Signature=l%2B1CRy9QiY%2Bl%2F2iQAQ70UxcLerU%3D&Expires=1732573443

But during GET I receive:

error	handler/util.go:34	call method	{"status": 403, "request_id": "766cd4cd-11c6-4535-ba97-78762d239613", "method": "GetObject", "bucket": "3e26a4ca-595d-4b4d-b592-424d9d739ccd", "object": "temp_file_3f2a06c4-77dd-4008-8968-8a384c6f19f0", "description": "could not find object", "error": "access denied: rpc error: code = Unknown desc = access to operation GET is denied by extended ACL check: DENY eACL rule"}

With the URL returned by authmate and aws s3 cli everything works as expected.

@evgeniiz321 evgeniiz321 marked this pull request as ready for review December 5, 2024 01:08
@roman-khimov roman-khimov merged commit 76a5ce0 into master Dec 5, 2024
5 of 7 checks passed
@roman-khimov roman-khimov deleted the ezayats/presigned branch December 5, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test presigned URLs in S3 Gateway
2 participants