-
Notifications
You must be signed in to change notification settings - Fork 673
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
PresignPostObject requires a PutObjectInput with a non-nil Key #3011
Comments
My situation is similar - and I have also noted the variance with It may be required for you to use a variable in the key. See: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html#sigv4-PolicyConditions My issue is with the generated policy from this function call. I'm getting a Invalid JSON error (note the variable that may help in your case):
Going to try and roll my own policy. |
This code works for me. Your
and the generated policy:
Best of luck! |
This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
The following code should in my understanding work to upload files with the presigned url with a file name that starts with
key
:This results in the following error:
However if I were to add the
PutObjectInput
The key would have priority over starts-with resulting in a response on upload using the presigned URL with the following message:
Access Denied. (Invalid according to Policy: Policy Condition failed)
The decoded base64-encoded JSON policy would look like this:
Regression Issue
Expected Behavior
If you check, it looks like the
PresignPostObject
expectsPutObjectInput
instead of aPostObjectInput
.The
PostObjectInput
's Key member is commented as follows:But maybe I'm missing something?
Current Behavior
Not allowed/able to a omit the key
Reproduction Steps
See above.
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
v1.32.7
Compiler and Version used
1.23.4
Operating System and version
macOs sequoia 15.1.1 (24B91)
The text was updated successfully, but these errors were encountered: