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

Support Presigned POST URL Generator with policy document #1493

Open
kimxogus opened this issue Oct 31, 2019 · 21 comments
Open

Support Presigned POST URL Generator with policy document #1493

kimxogus opened this issue Oct 31, 2019 · 21 comments
Labels
feature-request A feature should be added or improved. p1 This is a high priority issue

Comments

@kimxogus
Copy link

kimxogus commented Oct 31, 2019

Supporting Presigned POST URL generators with policy documents

Expected Behavior

sdk is able to generate presigned post url with conditions.

Current Behavior

It's not supported yet.
V1 sdk also doesn't have this feature. aws/aws-sdk-java#834
It's not even in current plan as #203 (comment)

Context

To utilize presigned url's policy document.
In my case, our logic is

1. Client request to upload a file
2. Backend process pre condition checks like user authentications
3. Backend returns presigned post url and form fields for upload
	- Conditions are needed to limit bucket, object key, content type and content length range
	- As both V1 and V2 sdk doesn't support this feature, we call lambda function which written in js to generate presigned post url and use that.
4. Client uploads a file using the presigned post url and form fields

#203 (comment)

@millems millems added the feature-request A feature should be added or improved. label Oct 31, 2019
@trinopoty
Copy link

I've also recently faced this issue.
I would be willing to open a PR if someone were to point me in the right direction.

@bernardobelchior
Copy link

I have a use case where this feature would very useful. Is there any in progress on this issue?

@rusu-robert
Copy link

I also need this feature and I would appreciate very much if someone allocated their time to implement this. Thank you!

@Milunas
Copy link

Milunas commented Dec 16, 2021

Hi! Do you know anything new about this feature? :)

@mahadi-hossain
Copy link

mahadi-hossain commented Dec 16, 2021 via email

@Dzhuliyan-Ovcharov
Copy link

Hi you can follow this https://www.linkedin.com/pulse/s3-browser-based-uploads-using-http-post-md-mahadi-hossain/

On Thu, Dec 16, 2021 at 1:08 PM Łukasz Milunas @.***> wrote: Hi! Do you know anything new about this feature? :) — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1493 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKSAVJM6UFMVJIMHE3HQXTURGGAHANCNFSM4JHCYBUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Hello, do we have something similiar implemented on java or kotlin?
Also example said:

  • The ACL must be set to public-read. What if we want to set it private?
  • The object must be an image file. Why? If I want to upload different content types?
    or rather here we mean that what we have defined in the policy the same must be applied in request which is logical..

@trinopoty
Copy link

trinopoty commented Dec 16, 2021

I use a bit of hacky code in Java.
You can find the gist here: https://gist.github.com/trinopoty/d617bbec19f249c723897ddf1cc1357d

Consider the snippet to be MIT licensed and modify it to suit your needs.

@trinopoty
Copy link

Also a gist to generate signed html form post requests in Java:
https://gist.github.com/trinopoty/f0272a4a33dcf455b3a7d4a70ed6b715

@mahadi-hossain
Copy link

mahadi-hossain commented Dec 18, 2021

Hi you can follow this https://www.linkedin.com/pulse/s3-browser-based-uploads-using-http-post-md-mahadi-hossain/

On Thu, Dec 16, 2021 at 1:08 PM Łukasz Milunas @.***> wrote: Hi! Do you know anything new about this feature? :) — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1493 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKSAVJM6UFMVJIMHE3HQXTURGGAHANCNFSM4JHCYBUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Hello, do we have something similiar implemented on java or kotlin? Also example said:

  • The ACL must be set to public-read. What if we want to set it private?
  • The object must be an image file. Why? If I want to upload different content types?
    or rather here we mean that what we have defined in the policy the same must be applied in request which is logical..

That is- you are ordering to follow the instruction by that configuration. You can set {"acl": "public-read"}, ["starts-with", "$Content-Type", "image/"], according to your demand.

Follow this :

https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html

@debora-ito
Copy link
Member

Quick update: this feature is in our backlog, but we don't have a timeline for it yet.

Add a 👍 to the original description if you want to show your support, it helps us with prioritization.

@ghost
Copy link

ghost commented Oct 4, 2022

+1

1 similar comment
@hojin-choi
Copy link

+1

@Frozenlock
Copy link

+1

5 similar comments
@fhaase2
Copy link

fhaase2 commented Sep 19, 2023

+1

@KamaniAman
Copy link

+1

@HLA-242
Copy link

HLA-242 commented Jan 17, 2024

+1

@sgasior
Copy link

sgasior commented Feb 2, 2024

+1

@LeonidIvanov123
Copy link

+1

@Gwonwoo-Nam
Copy link

+++1

@almightychang
Copy link

++++1

@k163377
Copy link

k163377 commented Sep 28, 2024

I am surprised that the uploadable file size cannot be easily limited.
I think this is one of the most requested features by many developers.
I strongly hope it will be given a higher priority.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p1 This is a high priority issue
Projects
None yet
Development

No branches or pull requests