-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[Rust] Support for withAWSV4Signature option #11690
Conversation
"{{{httpMethod}}}", | ||
{{#hasBodyParam}} | ||
{{#bodyParams}} | ||
&serde_json::to_string(&{{{paramName}}}).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is generally a safe unwrap I'd think that an expect
with some context would have been more useful.
#[derive(Debug, Clone)] | ||
pub struct AWSv4Key { | ||
pub access_key: String, | ||
pub secret_key: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be wrapped in something like secrecy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't knew about secrecy, I will fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I don't insist on secrecy specifically (just happens to be the one I've used).
.build() | ||
.unwrap(); | ||
let signable_request = SignableRequest::from(&request); | ||
let (mut signing_instructions, _signature) = sign(signable_request, &signing_params).unwrap().into_parts(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about all the unwrap
s in here. Maybe propagate them up the stack proper instead?
…ools#11193) Signed-off-by: Jérôme Jutteau <[email protected]>
…penAPITools#11193) Signed-off-by: Jérôme Jutteau <[email protected]>
Signed-off-by: Jérôme Jutteau <[email protected]>
f5e4304
to
60d3579
Compare
Hi @farcaller, thanks for your review. I pushed a new version which should fix what you pointed out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your updates, this looks solid.
@wing328 what's with the failing node2 test? |
@farcaller please kindly ignore the circleci node 2 failure. |
Tested the new samples (option) locally and the result is good:
Other Rust tests passed via https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/247229008 |
FYI. I've pushed 8c023fa to replace tabs with 4-space. |
Hi @farcaller
This PR is about supporting AWSV4Signature in rust generator (see issue #11193).
Few notes:
false
samples/client/petstore/rust/*
which seems to have changedPR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x