Closed hobaen closed 5 months ago
Hello and thanks for reporting!
Your example is fairly complex and I am struggling to reproduce the issue on my end. In general, resigned URLs are supported by aiobotocore
and I just confirmed this locally for the S3 service.
I noticed two deviations in your example that could be to blame:
await signer.generate_presigned_url()
expires_in
to signer.generate_presigned_url()
Could you please try to align those and try again?
Aligned the values, turned out the issue was with the expires_in
value. Any value greater than 900
causes both methods to fail, and value 900
or less and they both succeed.
A presigned URL remains valid for the period of time specified when the URL is generated. If you create a presigned URL with the Amazon S3 console, the expiration time can be set between 1 minute and 12 hours. If you use the AWS CLI or AWS SDKs, the expiration time can be set as high as 7 days.
If you created a presigned URL by using a temporary token, then the URL expires when the token expires, even if you created the URL with a later expiration time. For more information about how the credentials you use affect the expiration time, see [Who can create a presigned URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html#who-presigned-url).
yet it is looking like the observed behavior is that the presigned URL is being rejected if its expiry is longer than the temporary token used to generate it... literally not what the docs say.
But thats an AWS issue not a aiobotocore one. Thanks @jakob-keller for the help!
Describe the bug Expected: Signed URL used as a password for AWS elasticache, in the same manner as botocore's request signer, with aiobotocore successfully authenticates.
Observed: Using aiobotocore's signer returns
AuthenticationError: invalid username-password pair or user is disabled.
The following code using a botocore signer authenticates and runs successfully:
On the same host using the same IAM role, the following code fails to authenticate:
Checklist
pip check
passes without errorspip freeze
resultspip freeze results
Environment:
Additional context Add any other context about the problem here.