cloudydeno / deno-aws_api

From-scratch Typescript client for accessing AWS APIs
https://deno.land/x/aws_api
59 stars 3 forks source link

s3: getSignedUrl is missing #29

Closed TillaTheHun0 closed 1 year ago

TillaTheHun0 commented 2 years ago

I was looking to use getSignedUrl for uploading directly to s3, but didn't see the method in the generated s3 service. I do see it on the s3 service on the aws sdk referenced on main

Am I looking in the wrong place? Thanks for your help!

danopia commented 2 years ago

Hey, thanks for writing!

High level, you're not missing anything here. The focus of this library is to provide clients to the AWS APIs, and pre-signing isn't actually an API call so it wasn't really in scope. This was previously brought up in #5. Please note that /x/aws_api isn't the actual AWS SDK.

In that linked discussion, there is a link to an /x/ module just for pre-signing, check out the message here: https://github.com/cloudydeno/deno-aws_api/issues/5#issuecomment-927862540 and I also have an example of using it with the /x/aws_api credential loader. I used that pre-signing module in another project and it does the trick, albeit with a somewhat narrow API.

In summary, it would be interesting to work pre-signing methods into this module but there's nothing committed or in progress towards this feature at the exact moment. Definitely let me know if the other options work for your needs!

TillaTheHun0 commented 2 years ago

Agh, I missed that issue. Apologies for the dupe. I'll try out the solutions proposed there. Feel free to close this.

danopia commented 2 years ago

All good! I'd still like to track common requests like these so that I can discover what additional features to work on. In this case, the big dependency for pre-signing is defining an internal API to build signed URLs. It would be worth doing if the other options are lacking for some reason or another, which is the kind of thing you can provide a voice on as a user :)

Regardless, I haven't documented this sort of limitation properly, so either way I have something to do before closing this issue

danopia commented 1 year ago

:rocket: This is added in v0.8.0. There is a low-level presigning API and a high-level "extras" module for S3 presigning.

Example usages of both APIs are in this comment: