Skip to content

Commit

Permalink
build: remove codecov action (#1172)
Browse files Browse the repository at this point in the history
* build: remove codecov action

Source-Author: Benjamin E. Coe <bencoe@google.com>
Source-Date: Tue May 11 17:35:28 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: b891fb474173f810051a7fdb0d66915e0a9bc82f
Source-Link: googleapis/synthtool@b891fb4

* lint fix

Co-authored-by: Takashi Matsuo <tmatsuo@google.com>
  • Loading branch information
yoshi-automation and Takashi Matsuo committed May 18, 2021
1 parent 241063a commit 7870f64
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 77 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
- run: rm -rf node_modules
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions ${{ matrix.node }}
fail_ci_if_error: false
windows:
runs-on: windows-latest
steps:
Expand All @@ -38,11 +33,6 @@ jobs:
node-version: 14
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions windows
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 8 additions & 16 deletions browser-test/fixtures/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,21 @@
// https://tools.ietf.org/html/rfc7517
export const privateKey = {
kty: 'RSA',
n:
'0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzK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nb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk',
dp: 'G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0',
dq: 's9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk',
qi: 'GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU',
alg: 'RS256',
kid: '2011-04-29',
};

export const publicKey = {
kty: 'RSA',
n:
'0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw',
n: '0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw',
e: 'AQAB',
alg: 'RS256',
kid: '2011-04-29',
Expand Down
6 changes: 2 additions & 4 deletions browser-test/test.oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ const FEDERATED_SIGNON_JWK_CERTS = [
e: 'AQAB',
kty: 'RSA',
alg: 'RS256',
n:
'o27xh_y7EEIoBXJuXzgfvFY80Cbk8Efn2b5ZFEwPIwFFBoNxvfbRt3wsZoMulMcZbU5uQ8q82FZBUmpwAlybQ0pBm79XDnL0kEDl1pJjyuaNE4JGOdBosvG5_SBaa7CCq9ukTeTLZgDR_YfcmP4-XQfhWuS-vx7hTz13GzmVgO8FyMH4EYm2ZyOY-otx35sM6toF__W1MiGcwty4Dp0qPHeZ3a34saNc_miQS5lzMcUgMYBKCQZ-P7pSeQhgVmwGYWr_93fqZEPQdOFC-Qwgrww1dZ7cv9INkjFkBKiWQLEiXJKoUSp2BwL2CqENYhuS04g5ZkDV7lVpOxOuHucEzQ',
n: 'o27xh_y7EEIoBXJuXzgfvFY80Cbk8Efn2b5ZFEwPIwFFBoNxvfbRt3wsZoMulMcZbU5uQ8q82FZBUmpwAlybQ0pBm79XDnL0kEDl1pJjyuaNE4JGOdBosvG5_SBaa7CCq9ukTeTLZgDR_YfcmP4-XQfhWuS-vx7hTz13GzmVgO8FyMH4EYm2ZyOY-otx35sM6toF__W1MiGcwty4Dp0qPHeZ3a34saNc_miQS5lzMcUgMYBKCQZ-P7pSeQhgVmwGYWr_93fqZEPQdOFC-Qwgrww1dZ7cv9INkjFkBKiWQLEiXJKoUSp2BwL2CqENYhuS04g5ZkDV7lVpOxOuHucEzQ',
use: 'sig',
},
{
Expand All @@ -48,8 +47,7 @@ const FEDERATED_SIGNON_JWK_CERTS = [
e: 'AQAB',
kty: 'RSA',
alg: 'RS256',
n:
'sFlU5LpHUtYIm7B27iiu7c4ZPZk7ULUNmFdMVsTmYJxJqQBKUIKU9ozwF6TlUsECmYUMLpQhX_iHuaZRcpG2YiG7jbmi9HMlonIXX7uUe7PIf8rNHhveX_VI7ZpwPTnab3_7ciy_o8ZFde6KNltkx_DLRO6hXf6z6ow1APFIIriaNlF8niz5cy0fPIv0e_Z2p13Sz3mnAACjBKZGPw2X9GWh5XpRoDEQBcibXpeLuA7ti8zLZuH-9ybXOoou699fr4QHFxUkcd_8fFqmzO5PKnlOnJZ0gtuXCCYYc9XPX-WSqlqbGNMZy0Giu2wHbNbeWdepkgVlGuJonTnMx4gLuQ',
n: 'sFlU5LpHUtYIm7B27iiu7c4ZPZk7ULUNmFdMVsTmYJxJqQBKUIKU9ozwF6TlUsECmYUMLpQhX_iHuaZRcpG2YiG7jbmi9HMlonIXX7uUe7PIf8rNHhveX_VI7ZpwPTnab3_7ciy_o8ZFde6KNltkx_DLRO6hXf6z6ow1APFIIriaNlF8niz5cy0fPIv0e_Z2p13Sz3mnAACjBKZGPw2X9GWh5XpRoDEQBcibXpeLuA7ti8zLZuH-9ybXOoou699fr4QHFxUkcd_8fFqmzO5PKnlOnJZ0gtuXCCYYc9XPX-WSqlqbGNMZy0Giu2wHbNbeWdepkgVlGuJonTnMx4gLuQ',
},
];
const FEDERATED_SIGNON_JWK_CERTS_AXIOS_RESPONSE = {
Expand Down
3 changes: 2 additions & 1 deletion src/auth/authclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export declare interface AuthClient {

export abstract class AuthClient
extends EventEmitter
implements CredentialsClient {
implements CredentialsClient
{
protected quotaProjectId?: string;
transporter = new DefaultTransporter();
credentials: Credentials = {};
Expand Down
5 changes: 2 additions & 3 deletions src/auth/baseexternalclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,8 @@ export abstract class BaseExternalAccountClient extends AuthClient {
},
responseType: 'json',
};
const response = await this.transporter.request<IamGenerateAccessTokenResponse>(
opts
);
const response =
await this.transporter.request<IamGenerateAccessTokenResponse>(opts);
const successResponse = response.data;
return {
access_token: successResponse.accessToken,
Expand Down
9 changes: 4 additions & 5 deletions src/auth/googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,8 @@ export class GoogleAuth {
// Check for the existence of a local environment variable pointing to the
// location of the credential file. This is typically used in local
// developer scenarios.
credential = await this._tryGetApplicationCredentialsFromEnvironmentVariable(
options
);
credential =
await this._tryGetApplicationCredentialsFromEnvironmentVariable(options);
if (credential) {
if (credential instanceof JWT) {
credential.defaultScopes = this.defaultScopes;
Expand Down Expand Up @@ -609,8 +608,8 @@ export class GoogleAuth {
exec('gcloud config config-helper --format json', (err, stdout) => {
if (!err && stdout) {
try {
const projectId = JSON.parse(stdout).configuration.properties.core
.project;
const projectId =
JSON.parse(stdout).configuration.properties.core.project;
resolve(projectId);
return;
} catch (e) {
Expand Down
8 changes: 5 additions & 3 deletions src/auth/jwtclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ export class JWT extends OAuth2Client implements IdTokenProvider {
if (!this.apiKey && !this.hasUserScopes() && url) {
if (
this.additionalClaims &&
(this.additionalClaims as {
target_audience: string;
}).target_audience
(
this.additionalClaims as {
target_audience: string;
}
).target_audience
) {
const {tokens} = await this.refreshToken();
return {
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/google-auth-library-nodejs.git",
"sha": "b134da65f87be7f929ff50cbdfe849bd79a68639"
"sha": "241063a8c7d583df53ae616347edc532aec02165"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "e6f3d54be015a394b6ab5a25903ec09062a2b424"
"sha": "b891fb474173f810051a7fdb0d66915e0a9bc82f"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion system-test/test.kitchen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as path from 'path';
import * as tmp from 'tmp';
import {promisify} from 'util';

const mvp = (promisify(mv) as {}) as (...args: string[]) => Promise<void>;
const mvp = promisify(mv) as {} as (...args: string[]) => Promise<void>;
const ncpp = promisify(ncp);
const keep = !!process.env.GALN_KEEP_TEMPDIRS;
const stagingDir = tmp.dirSync({keep, unsafeCleanup: true});
Expand Down
68 changes: 42 additions & 26 deletions test/test.googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,16 @@ describe('googleauth', () => {
it('tryGetApplicationCredentialsFromEnvironmentVariable should return null when env const is not set', async () => {
// Set up a mock to return a null path string.
mockEnvVar('GOOGLE_APPLICATION_CREDENTIALS');
const client = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const client =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
assert.strictEqual(client, null);
});

it('tryGetApplicationCredentialsFromEnvironmentVariable should return null when env const is empty string', async () => {
// Set up a mock to return an empty path string.
mockEnvVar('GOOGLE_APPLICATION_CREDENTIALS');
const client = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const client =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
assert.strictEqual(client, null);
});

Expand All @@ -657,7 +659,8 @@ describe('googleauth', () => {
'GOOGLE_APPLICATION_CREDENTIALS',
'./test/fixtures/private.json'
);
const result = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const result =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const jwt = result as JWT;
assert.strictEqual(privateJSON.private_key, jwt.key);
assert.strictEqual(privateJSON.client_email, jwt.email);
Expand All @@ -672,9 +675,10 @@ describe('googleauth', () => {
'GOOGLE_APPLICATION_CREDENTIALS',
'./test/fixtures/private.json'
);
const result = await auth._tryGetApplicationCredentialsFromEnvironmentVariable(
{eagerRefreshThresholdMillis: 60 * 60 * 1000}
);
const result =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable({
eagerRefreshThresholdMillis: 60 * 60 * 1000,
});
const jwt = result as JWT;
assert.strictEqual(privateJSON.private_key, jwt.key);
assert.strictEqual(privateJSON.client_email, jwt.email);
Expand All @@ -687,40 +691,46 @@ describe('googleauth', () => {
it('_tryGetApplicationCredentialsFromWellKnownFile should build the correct directory for Windows', async () => {
mockWindows();
mockWindowsWellKnownFile();
const result = (await auth._tryGetApplicationCredentialsFromWellKnownFile()) as JWT;
const result =
(await auth._tryGetApplicationCredentialsFromWellKnownFile()) as JWT;
assert.ok(result);
assert.strictEqual(result.email, private2JSON.client_email);
});

it('_tryGetApplicationCredentialsFromWellKnownFile should build the correct directory for non-Windows', async () => {
mockLinuxWellKnownFile();
const client = (await auth._tryGetApplicationCredentialsFromWellKnownFile()) as JWT;
const client =
(await auth._tryGetApplicationCredentialsFromWellKnownFile()) as JWT;
assert.strictEqual(client.email, private2JSON.client_email);
});

it('_tryGetApplicationCredentialsFromWellKnownFile should fail on Windows when APPDATA is not defined', async () => {
mockWindows();
mockEnvVar('APPDATA');
mockWindowsWellKnownFile();
const result = await auth._tryGetApplicationCredentialsFromWellKnownFile();
const result =
await auth._tryGetApplicationCredentialsFromWellKnownFile();
assert.strictEqual(null, result);
});

it('_tryGetApplicationCredentialsFromWellKnownFile should fail on non-Windows when HOME is not defined', async () => {
mockEnvVar('HOME');
mockLinuxWellKnownFile();
const result = await auth._tryGetApplicationCredentialsFromWellKnownFile();
const result =
await auth._tryGetApplicationCredentialsFromWellKnownFile();
assert.strictEqual(null, result);
});

it('_tryGetApplicationCredentialsFromWellKnownFile should fail on Windows when file does not exist', async () => {
mockWindows();
const result = await auth._tryGetApplicationCredentialsFromWellKnownFile();
const result =
await auth._tryGetApplicationCredentialsFromWellKnownFile();
assert.strictEqual(null, result);
});

it('_tryGetApplicationCredentialsFromWellKnownFile should fail on non-Windows when file does not exist', async () => {
const result = await auth._tryGetApplicationCredentialsFromWellKnownFile();
const result =
await auth._tryGetApplicationCredentialsFromWellKnownFile();
assert.strictEqual(null, result);
});

Expand Down Expand Up @@ -846,7 +856,7 @@ describe('googleauth', () => {
configuration: {properties: {core: {project: STUB_PROJECT}}},
});

((child_process.exec as unknown) as sinon.SinonStub).restore();
(child_process.exec as unknown as sinon.SinonStub).restore();
const stub = sandbox
.stub(child_process, 'exec')
.callsArgWith(1, null, stdout, null);
Expand All @@ -858,7 +868,7 @@ describe('googleauth', () => {
it('getProjectId should use GCE when well-known file and env const are not set', async () => {
const scope = createGetProjectIdNock(STUB_PROJECT);
const projectId = await auth.getProjectId();
const stub = (child_process.exec as unknown) as sinon.SinonStub;
const stub = child_process.exec as unknown as sinon.SinonStub;
stub.restore();
assert(stub.calledOnce);
assert.strictEqual(projectId, STUB_PROJECT);
Expand Down Expand Up @@ -1150,7 +1160,8 @@ describe('googleauth', () => {
'GOOGLE_APPLICATION_CREDENTIALS',
'./test/fixtures/private.json'
);
const result = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const result =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
assert(result);
const jwt = result as JWT;
const body = await auth.getCredentials();
Expand All @@ -1169,7 +1180,8 @@ describe('googleauth', () => {
const spy = sinon.spy(auth, 'getClient');
const body = await auth.getCredentials();

const result = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const result =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
if (!(result instanceof JWT)) {
throw new assert.AssertionError({
message: 'Credentials are not a JWT object',
Expand Down Expand Up @@ -1198,7 +1210,8 @@ describe('googleauth', () => {

it('getCredentials should return error when env const is not set', async () => {
// Set up a mock to return a null path string
const client = await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
const client =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable();
assert.strictEqual(null, client);
await assert.rejects(auth.getCredentials());
});
Expand Down Expand Up @@ -1900,9 +1913,10 @@ describe('googleauth', () => {

describe('getApplicationCredentialsFromFilePath()', () => {
it('should correctly read the file and create a valid client', async () => {
const actualClient = await auth._getApplicationCredentialsFromFilePath(
'./test/fixtures/external-account-cred.json'
);
const actualClient =
await auth._getApplicationCredentialsFromFilePath(
'./test/fixtures/external-account-cred.json'
);

assertExternalAccountClientInitialized(
actualClient,
Expand Down Expand Up @@ -2002,9 +2016,10 @@ describe('googleauth', () => {
'GOOGLE_APPLICATION_CREDENTIALS',
'./test/fixtures/external-account-cred.json'
);
const result = await auth._tryGetApplicationCredentialsFromEnvironmentVariable(
refreshOptions
);
const result =
await auth._tryGetApplicationCredentialsFromEnvironmentVariable(
refreshOptions
);

assert(result);
assertExternalAccountClientInitialized(
Expand All @@ -2017,9 +2032,10 @@ describe('googleauth', () => {
it('tryGetApplicationCredentialsFromWellKnownFile() should resolve', async () => {
// Set up a mock to return path to a valid credentials file.
mockLinuxWellKnownFile('./test/fixtures/external-account-cred.json');
const result = await auth._tryGetApplicationCredentialsFromWellKnownFile(
refreshOptions
);
const result =
await auth._tryGetApplicationCredentialsFromWellKnownFile(
refreshOptions
);

assert(result);
assertExternalAccountClientInitialized(
Expand Down

0 comments on commit 7870f64

Please sign in to comment.