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(tsc): audience property is not mandatory on verifyIdToken #972

Merged
merged 3 commits into from Jun 16, 2020

Conversation

sergioregueira
Copy link
Contributor

As code says, audience property is not mandatory on OAuth2Client.prototype.verifyIdToken() call despite the TypeScript interface currently requires it, so I have just updated the interface to make it optional.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 11, 2020
@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #972 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #972   +/-   ##
=======================================
  Coverage   92.89%   92.89%           
=======================================
  Files          19       19           
  Lines        4023     4023           
  Branches      488      454   -34     
=======================================
  Hits         3737     3737           
  Misses        286      286           
Impacted Files Coverage Δ
src/auth/oauth2client.ts 96.30% <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 9ddfb9b...3533ed9. Read the comment docs.

@JustinBeckwith
Copy link
Contributor

@bshaffer can I trouble you to take a look here?

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

will wait on @bshaffer for feedback, but this looks reasonable to me.

Copy link
Contributor

@bshaffer bshaffer left a 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 confused as to what this actually does, as our verify-iap sample currently works with a null audience. But otherwise, this is LGTM

@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2020
@sergioregueira
Copy link
Contributor Author

This is just a fix of TypeScript definition, not business logic involved.

The sample you mention works because expectedAudience is defined as any (no explicit type on definition), and any matches any argument type (including string | string[]).

@JustinBeckwith JustinBeckwith merged commit 17a7e24 into googleapis:master Jun 16, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants