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: make x-goog-user-project work for additional auth clients #848

Merged
merged 5 commits into from Dec 10, 2019

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Dec 10, 2019

quota_project_id was not working for JWT clients, which are easier to test in our integration environment (which authenticates based on a service account, set in GOOGLE_APPLICATION_CREDENTIALS).

This PR:

  1. pulls the logic for populating additional special headers into the AuthClient base class.
  2. adds tests to make sure we're getting returned the types of client instances we expect, and that x-goog-user-project is populated for a JWT client.

@bcoe bcoe requested a review from broady December 10, 2019 15:12
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 10, 2019
@bcoe bcoe requested a review from jeanbza December 10, 2019 15:12
@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #848 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #848      +/-   ##
=========================================
+ Coverage   85.19%   85.2%   +0.01%     
=========================================
  Files          17      17              
  Lines         959     960       +1     
  Branches      215     215              
=========================================
+ Hits          817     818       +1     
  Misses         85      85              
  Partials       57      57
Impacted Files Coverage Δ
src/auth/authclient.ts 100% <100%> (ø) ⬆️
src/auth/jwtclient.ts 88.63% <100%> (ø) ⬆️
src/auth/oauth2client.ts 83.16% <100%> (-0.17%) ⬇️

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 7587265...3f60f85. Read the comment docs.

src/auth/authclient.ts Outdated Show resolved Hide resolved
@bcoe bcoe merged commit 46af865 into master Dec 10, 2019
@bcoe bcoe deleted the header-copy-logic branch December 10, 2019 20:01
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

3 participants