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

Add AWS request signing callback #408

Open
jaguililla opened this issue Jul 11, 2021 · 6 comments
Open

Add AWS request signing callback #408

jaguililla opened this issue Jul 11, 2021 · 6 comments
Assignees
Labels
easy enhancement good first issue Earn your wings at the OSS community help wanted

Comments

@jaguililla
Copy link
Member

jaguililla commented Jul 11, 2021

Create an HTTP callback to sign HTTP requests using the AWS signing request algorithm.

Callbacks already developed in the http/http_server module (on the com/hexagonkt/http/server/callbacks package) can be used as reference for development and testing of such components.

There is also an example of a callback used in the HTTP client as opposed to the callbacks used in the server (the class name is com.hexagonkt.rest.SerializeRequestCallback).

Note that the callback should be of before type and to pass the modified request, the request method should be used instead send.

The callback should be added to the http/rest_tools module on the com.hexagonkt.rest.tools.aws package.

A previous Java implementation can be checked at: https://github.com/jaguililla/sabina/blob/master/bali/src/main/java/co/there4/bali/Aws.java

The callback must pass the most of the AWS signing V4 Test Suite cases, and at least implement the tests included here: https://github.com/jaguililla/sabina/tree/master/bali/src/test/resources/aws-sig-v4-test-suite

Previous Java implementation tests can be found at: https://github.com/jaguililla/sabina/blob/master/bali/src/test/groovy/co/there4/bali/AwsTest.groovy

For information on how to build the project and pass the tests please refer to the contributing guide.

If you have any question or suggestion, please feel free to use this issue's comments to discuss them 🙂

@jaguililla jaguililla removed the v2.x label Feb 24, 2022
@jaguililla jaguililla changed the title Add AWS request signing from 'Sabina' Add AWS request signing callback Aug 28, 2023
@manuelkour
Copy link

Hi! I'd like to work on this issue if it's still up to grab.

@jaguililla
Copy link
Member Author

Absolutely, it's all yours. I'll update the task's status.

Thanks for your cooperation and if you need anything, just write me :)

@manuelkour
Copy link

I have a question regarding some of the parameters required to sign an AWS request. (This is the reference from the AWS documentation I've been following so far.)
To calculate the signing key, the AWS (secret) access key, region and service are required. Are we expecting the HttpContext passed to the callback to contain these or in what other way could this be done?
If there's a misunderstanding on how the callback is supposed to work, could you please show me to the correct part in the documentation to read up on this?
Thanks in advance!

@jaguililla
Copy link
Member Author

Ok, as the callback is a class. Could you pass those values as parameters in the constructor?

The user then will be forced to supply values for those parameters at callback instantiation time (at the application start up or routing definition).

The user could fetch those values from environment, configuration files, etc. before passing them to the callback (decoupling the AWS signing from the configuration/environment).

What do you think? does this make sense to you?

@manuelkour
Copy link

Passing it to the constructor makes it easy then, thanks!

@jaguililla
Copy link
Member Author

Hello, the Hexagon GitHub organization has been renamed to https://github.com/hexagontk. You will need to change your local clone remotes to reflect this change. Thanks and sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy enhancement good first issue Earn your wings at the OSS community help wanted
Projects
Status: In Progress
Development

No branches or pull requests

2 participants