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: introduce v4 signed url #637

Merged
merged 83 commits into from
Apr 4, 2019
Merged

feat: introduce v4 signed url #637

merged 83 commits into from
Apr 4, 2019

Conversation

jkwlui
Copy link
Member

@jkwlui jkwlui commented Mar 22, 2019

requires googleapis/google-auth-library-nodejs#649 for system-tests to pass

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 22, 2019
@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #637 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #637      +/-   ##
==========================================
+ Coverage   97.92%   98.04%   +0.11%     
==========================================
  Files           9        9              
  Lines         869      921      +52     
  Branches       99      100       +1     
==========================================
+ Hits          851      903      +52     
  Misses          9        9              
  Partials        9        9
Impacted Files Coverage Δ
src/util.ts 100% <100%> (ø) ⬆️
src/file.ts 98.8% <100%> (+0.16%) ⬆️

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 00d61bc...5e1b00d. Read the comment docs.

Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

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

Half done, more to come :)

src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/file.ts Outdated Show resolved Hide resolved
src/util.ts Outdated Show resolved Hide resolved
system-test/storage.ts Outdated Show resolved Hide resolved
test/file.ts Outdated Show resolved Hide resolved
test/file.ts Show resolved Hide resolved
test/file.ts Outdated Show resolved Hide resolved
@JustinBeckwith
Copy link
Contributor

@jkwlui thanks for hanging with me on the feedback on this one 🙃

@jkwlui jkwlui added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 28, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 28, 2019
@jkwlui
Copy link
Member Author

jkwlui commented Mar 28, 2019

Not at all LOL I appreciate the feedback!

hold off merging until @frankyn had a chance to take a look :)

Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

I had a few nits.
Additionally, please add conformance tests into the PR to align implementations across languages before merging.

src/file.ts Outdated Show resolved Hide resolved
src/file.ts Show resolved Hide resolved
src/file.ts Show resolved Hide resolved
});

let promise: Promise<SignedUrlQuery>;
if (version === 'v2') {
Copy link
Member

Choose a reason for hiding this comment

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

Could you log the future change:

You have generated a signed URL using the default v2 signing implementation. In the future, this will default to v4. You may experience breaking changes if you use longer than 7 day expiration times with v4. To opt-in to the behavior specify config.version='v4'

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't really do these in Node.

@JustinBeckwith do we have any best-practices/alternatives for warning users of impending change in API during runtime in addition to jsdoc notes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we do! Checkout what I did here for google-auth-library:
https://github.com/googleapis/google-auth-library-nodejs/blob/master/src/messages.ts

You want to use process.emitWarning, but there is a lot of nuance. Following gal is probably a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

gal?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, google-auth-library

Copy link
Member

Choose a reason for hiding this comment

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

Only default is fine in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we do!

Heh I must've remembered a different conversion about emitting warnings in Node. 😛
I am trying to add a similar emitWarning logic here and I feel like I'm duplicating most of the code you have on google-auth-library. Any hints here, or should I just go ahead with it?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's entirely possible there's a library to do this - not sure! @googleapis/node-team?

Copy link
Member Author

Choose a reason for hiding this comment

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

@JustinBeckwith are you okay with me keeping the (mostly duplicated) code? I've looked high and low and couldn't find anything :(

Copy link
Contributor

Choose a reason for hiding this comment

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

I am ok with it

src/file.ts Show resolved Hide resolved
src/file.ts Show resolved Hide resolved
src/file.ts Show resolved Hide resolved
@jkwlui jkwlui requested a review from frankyn March 29, 2019 22:37
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 29, 2019
Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

+1 Node.js is good and isn't impacted by the timestamp issue mentioned in the email.

Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Implementation lgtm, pending surface example review before approving. Once approved please merge and release. Thank you for your work and patience!

* Revert "split out conformance test"

This reverts commit ce00255.

* sync conformance-test cases; parse cases without modification

* this.skip

* refactor: lift interface
@JustinBeckwith
Copy link
Contributor

@jkwlui @frankyn this is out of SLO - can we get it landed?

@frankyn
Copy link
Member

frankyn commented Apr 4, 2019

@jkwlui please merge and release when issues are resolved.

@jkwlui jkwlui merged commit 521eafd into master Apr 4, 2019
@stephenplusplus stephenplusplus deleted the v4-signedurl branch November 26, 2019 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. 🚨 This issue needs some love.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants