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

chore: move expiration under RequestPresigningArguments #1030

Merged
merged 9 commits into from
Mar 23, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Mar 23, 2020

Issue #, if available:

Description of changes:
Move expiration under RequestSigningArguments

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-io
Copy link

Codecov Report

Merging #1030 into smithy-codegen will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           smithy-codegen    #1030   +/-   ##
===============================================
  Coverage           91.42%   91.42%           
===============================================
  Files                 145      145           
  Lines                2857     2858    +1     
  Branches              506      507    +1     
===============================================
+ Hits                 2612     2613    +1     
  Misses                245      245           
Impacted Files Coverage Δ
packages/middleware-sdk-ec2/src/index.ts 86.20% <0.00%> (ø)
packages/middleware-sdk-rds/src/index.ts 87.75% <0.00%> (ø)
packages/signature-v4/src/SignatureV4.ts 100.00% <0.00%> (ø)
packages/s3-request-presigner/src/index.ts 100.00% <0.00%> (ø)
packages/chunked-blob-reader-rn/src/index.ts
packages/chunked-blob-reader-native/src/index.ts 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f786a0...a146861. Read the comment docs.

@aws-sdk-js-automation

This comment has been minimized.

@@ -139,6 +138,7 @@ export class SignatureV4

const {
signingDate = new Date(),
expiration = new Date(Date.now() + 3600 * 1000),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this 1 hr expiration come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for applying the change. I have a few comments.

/**
* The time at which the signed request should no longer be honored.
*/
expiration?: DateInput;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignatureV4.sign() also uses RequestSigningArguments. Adding the parameter here makes signing a request with a useless expiration parameter, it will confuse the users. Can you use another options name(e.g. RequestPresignArguments) extending from RequestSigningArguments with expiration property?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 50a2658

@trivikr trivikr changed the title chore: move expiration under RequestSigningArguments chore: move expiration under RequestPresigningArguments Mar 23, 2020
@aws-sdk-js-automation

This comment has been minimized.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 900498f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@trivikr trivikr merged commit 845e25f into aws:smithy-codegen Mar 23, 2020
@trivikr trivikr deleted the presign-expiration-arguments branch March 23, 2020 19:25
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Mar 24, 2020
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Mar 24, 2020
@lock
Copy link

lock bot commented Apr 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants