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

feat(s3-request-presigner): add getSignedUrl() from client and commands #1454

Merged
merged 2 commits into from Aug 21, 2020

Conversation

AllanZhengYP
Copy link
Contributor

Add getSignedUrl() to get signed url from client and command. The existing presigning method using S3RequestPresigner only takes existing HTTP request. It has 2 problems:

  1. Users need to write verbose code to generate an S3 presigned URL. Before calling S3RequestPresigner they usually need to use @aws-sdk/util-create-request dependency to get the HTTP request from command and client.
  2. Doesn't support presigning with overriden signing region and signing serivce which comes from handle execution context. For example, is user has a request that needs to be signed with region inferred from input parameter("useArnRegion"), the logic will be too complexed.

getSignedUrl also provide a familiar method compared to V2 SDK.

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

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2020

Codecov Report

Merging #1454 into master will increase coverage by 0.02%.
The diff coverage is 97.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1454      +/-   ##
==========================================
+ Coverage   79.77%   79.80%   +0.02%     
==========================================
  Files         297      298       +1     
  Lines       11480    11502      +22     
  Branches     2470     2475       +5     
==========================================
+ Hits         9158     9179      +21     
- Misses       2322     2323       +1     
Impacted Files Coverage Δ
packages/s3-request-presigner/src/getSignedUrl.ts 95.45% <95.45%> (ø)
packages/s3-request-presigner/src/presigner.ts 100.00% <100.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 8a0febd...65ace72. Read the comment docs.

Copy link
Contributor

@alexforsyth alexforsyth left a comment

Choose a reason for hiding this comment

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

very minor comments. LGTM!

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, just one nit

@AllanZhengYP AllanZhengYP merged commit 88baaad into aws:master Aug 21, 2020
@github-actions
Copy link

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 17, 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.

None yet

4 participants