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: use gcp-metadata for compute credentials #409

Merged
merged 2 commits into from
Jul 6, 2018
Merged

fix: use gcp-metadata for compute credentials #409

merged 2 commits into from
Jul 6, 2018

Conversation

JustinBeckwith
Copy link
Contributor

BREAKING CHANGE: The OAuth2Client, JWT, and Compute classes no longer accept parameters to override the authBaseUrl and tokenUrl. These properties were largely available for testing, but there are better ways to test.

Old code

client = new OAuth2Client(CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, {authBaseUrl, tokenUrl});	

New code

client = new OAuth2Client(CLIENT_ID, CLIENT_SECRET, REDIRECT_URI);	

@JustinBeckwith JustinBeckwith requested review from ofrobots and a team July 6, 2018 07:08
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 6, 2018
@codecov-io
Copy link

codecov-io commented Jul 6, 2018

Codecov Report

Merging #409 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #409      +/-   ##
==========================================
- Coverage   94.93%   94.89%   -0.04%     
==========================================
  Files          15       15              
  Lines         967      960       -7     
  Branches      224      218       -6     
==========================================
- Hits          918      911       -7     
  Misses         49       49
Impacted Files Coverage Δ
src/auth/oauth2client.ts 94.37% <100%> (-0.04%) ⬇️
src/auth/computeclient.ts 94.73% <100%> (-0.62%) ⬇️

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 ff8cbe8...e628140. Read the comment docs.

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

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

LGTM w/ a few nits.

export class Compute extends OAuth2Client {
private serviceAccountEmail: string;

// Google Compute Engine metadata server token endpoint.

This comment was marked as spam.

@@ -18,7 +18,7 @@ import assert from 'assert';
import child_process from 'child_process';
import crypto from 'crypto';
import * as fs from 'fs';
import {BASE_PATH, HEADER_NAME, HOST_ADDRESS} from 'gcp-metadata';
import {BASE_PATH, HEADERS, HOST_ADDRESS} from 'gcp-metadata';

This comment was marked as spam.

This comment was marked as spam.

@JustinBeckwith JustinBeckwith merged commit ba3a57a into googleapis:master Jul 6, 2018
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.

4 participants