powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

Feature request: module to Sign Requests

Open cino opened this issue 1 year ago • 5 comments

Use case

It would be nice to have a module in the AWS Powertools that would sign requests made to AWS Resources via the SigV4 method. Currently doing it yourself is a tedious process and needing to understand the underlying mechanism.

This is also discussed in the Powertools for Python repositor

  • https://github.com/aws-powertools/powertools-lambda-python/issues/2713
  • https://github.com/aws-powertools/powertools-lambda-python/issues/2493
  • https://github.com/aws-powertools/powertools-lambda-python/pull/2435

Solution/User Experience

Same as for the python version, I am proposing adding a new class that will take in the parameters to create this signed request for the end user to simplify it since it is not a very straightforward method and should be made easier.

Currently it differs based on which request library you are using, for example with Axios there is an intercepter, for got there is a got4aws you could use or in cases where I'm at currently I've implemented our own hook in a request library.

Having an supported module by powertools that does this would be preferred.

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

cino avatar Feb 28 '24 19:02 cino

Thanks for opening your first issue here! We'll come back to you as soon as we can. In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

boring-cyborg[bot] avatar Feb 28 '24 19:02 boring-cyborg[bot]

Hi @cino, thank you for taking the time to open the issue.

As discussed earlier today I think this is a valuable utility, so I would definitely want to look more into it and see if we can add it to the roadmap.

I'm gonna take some time and go though the existing issues that you've linked to understand where they stand, then I'll also discuss this internally.

I'll try to get back to you here in a reasonable amount of time, but no earlier than a couple of weeks likely since we're going to focus on releasing v2 (this week) and Parser in the coming weeks.

dreamorosi avatar Feb 28 '24 21:02 dreamorosi

An issue I opened to the AWS SDK team to improve tree shaking was addressed: smithy-lang/smithy-typescript#1159.

With v2 out of the way, I'd like to revive this conversation and work on a RFC. I have gone through the issues & PR in the Python repo and it seems that the discussion as well as implementation have stalled due to incomplete RFC and lack of traction.

Over the next couple of weeks I'll start working on a RFC and update the discussion here.

dreamorosi avatar Apr 10 '24 13:04 dreamorosi

Hi - just wanted to follow up on this.

We have been discussing this internally and we still intend to work on this utility but at the moment we are prioritizing the new Event Handler utility due to higher demand.

We'll revisit this in 3 months to see if bandwidth allows us to move this forward.

--

For future readers: ine thing that would be extremely helpful to prioritize is to have company names, as GitHub doesn't always have that info -- feel free to email us [email protected] if you don't feel comfortable sharing in public.

dreamorosi avatar Jun 14 '24 10:06 dreamorosi

Hey @cino @dreamorosi

I just stumbled upon this request by accident.

I'm maintaining two libraries called aws-sigv4-sign and aws-sigv4-fetch to sign HTTP requests with AWS Signature V4. Both libraries are built entirely on the official AWS SDK for JavaScript v3. The first one aws-sigv4-sign signs a Response object and adds the AWS authorization headers. The second aws-sigv4-fetch wraps a provided fetch function to automatically sign each outgoing HTTP request.

If this feature request gains momentum again, I'd love to help design/implement it. In the meantime, @cino please let me know if one of the libraries would help your use case.

zirkelc avatar Oct 06 '25 11:10 zirkelc