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

Advanced request signing using Cro::HTTP::Client #43

Open
zostay opened this issue Jul 17, 2018 · 1 comment
Open

Advanced request signing using Cro::HTTP::Client #43

zostay opened this issue Jul 17, 2018 · 1 comment

Comments

@zostay
Copy link

zostay commented Jul 17, 2018

Is there a way to insert some sort of middleware into Cro::HTTP::Client after constructing the request but before transmissions? I'd like to implement AWS request signatures, but doing so requires working with a completed request. I have implemented something like this here:

https://github.com/zostay/Amazon-DynamoDB/blob/master/lib/Amazon/DynamoDB.pm6#L764

But it seems like this would be much nicer to do in the pipeline. This would need to go into the pipeline after the body has been serialized, but before transmission. I don't see a place where I can do that.

@jnthn
Copy link
Member

jnthn commented Jul 17, 2018

We've considered providing for middleware in Cro::HTTP::Client, and it would be relatively easy to add; we'll give it a priority boost given somebody has a concrete use for it. :-)

For now, you could do it with with a body serializer, perhaps by making one that delegates to the standard body serializer and then adds the extra headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants