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

fix(signature-v4): add secrets to signing key cache key #1776

Merged
merged 2 commits into from
Dec 19, 2020

Conversation

AllanZhengYP
Copy link
Contributor

Fixes #1002

Description of changes:
This change fix the issue that signing key is not refreshed between requests with only different secret access keys. I added a hash of both access key id and secrete access key as the cache key is signing keys.

However, previously we cached pending promise of signing keys, but now we only cache the resolved promise of signing keys. So it's safer but may have wild performance implication. We can optimize this after we have benchmark metrics of this module.

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-io commented Dec 14, 2020

Codecov Report

Merging #1776 (0dc9971) into master (de75f7e) will decrease coverage by 0.49%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1776      +/-   ##
==========================================
- Coverage   79.77%   79.28%   -0.50%     
==========================================
  Files         325      367      +42     
  Lines       12087    15116    +3029     
  Branches     2553     3221     +668     
==========================================
+ Hits         9643    11985    +2342     
- Misses       2444     3131     +687     
Impacted Files Coverage Δ
protocol_tests/aws-json/models/models_0.ts 79.36% <0.00%> (-20.64%) ⬇️
packages/util-user-agent-node/src/index.ts 88.88% <0.00%> (-11.12%) ⬇️
protocol_tests/aws-restjson/models/models_0.ts 89.43% <0.00%> (-10.57%) ⬇️
...rotocol_tests/aws-restxml/protocols/Aws_restXml.ts 64.10% <0.00%> (-2.15%) ⬇️
...ackages/node-http-handler/src/node-http-handler.ts 98.00% <0.00%> (-2.00%) ⬇️
packages/middleware-sdk-sqs/src/send-message.ts 86.66% <0.00%> (-0.84%) ⬇️
protocol_tests/aws-query/protocols/Aws_query.ts 66.34% <0.00%> (-0.38%) ⬇️
...kages/middleware-sdk-sqs/src/send-message-batch.ts 92.30% <0.00%> (-0.29%) ⬇️
...kages/fetch-http-handler/src/fetch-http-handler.ts 9.30% <0.00%> (-0.23%) ⬇️
protocol_tests/aws-ec2/protocols/Aws_ec2.ts 66.93% <0.00%> (-0.01%) ⬇️
... and 188 more

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 388b180...0dc9971. Read the comment docs.

Copy link
Member

@trivikr trivikr left a comment

Choose a reason for hiding this comment

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

LGTM! Added some nit for unit tests

packages/signature-v4/src/credentialDerivation.spec.ts Outdated Show resolved Hide resolved
packages/signature-v4/src/credentialDerivation.spec.ts Outdated Show resolved Hide resolved
packages/signature-v4/src/credentialDerivation.spec.ts Outdated Show resolved Hide resolved
@AllanZhengYP
Copy link
Contributor Author

Rebase it to pass the Java test

@AllanZhengYP AllanZhengYP merged commit 8785ad4 into aws:master Dec 19, 2020
@github-actions
Copy link

github-actions bot commented Jan 8, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2021
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.

Credentials not reset between commands
3 participants