diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b4c08f9a..4ed84dc1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:f74e740638e66be7ced1540626217dbb72980eb73885b2339a70592f38c9ff2c -# created: 2022-04-06T18:36:33.987617127Z + digest: sha256:80bfa0c67226453b37b501be7748b2fa2a2676cfeec0012e79e3a1a8f1cbe6a3 +# created: 2022-04-14T19:57:08.518420247Z diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..1b362683 --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,17 @@ +branchProtectionRules: + - pattern: main + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - "ci/kokoro: Samples test" + - "ci/kokoro: System test" + - docs + - lint + - test (10) + - test (12) + - test (14) + - cla/google + - windows + - OwlBot Post Processor diff --git a/package.json b/package.json index c2ae7323..5871ca41 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "fast-text-encoding": "^1.0.0", "gaxios": "^4.0.0", "gcp-metadata": "^4.2.0", - "gtoken": "^5.0.4", + "gtoken": "^5.3.2", "jws": "^4.0.0", "lru-cache": "^6.0.0" }, diff --git a/src/auth/googleauth.ts b/src/auth/googleauth.ts index 19f05f3d..e84402ce 100644 --- a/src/auth/googleauth.ts +++ b/src/auth/googleauth.ts @@ -59,9 +59,6 @@ export interface CredentialCallback { (err: Error | null, result?: JSONClient): void; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -interface DeprecatedGetClientOptions {} - export interface ADCCallback { (err: Error | null, credential?: AuthClient, projectId?: string | null): void; } @@ -790,12 +787,7 @@ export class GoogleAuth { * Automatically obtain a client based on the provided configuration. If no * options were passed, use Application Default Credentials. */ - async getClient(options?: DeprecatedGetClientOptions) { - if (options) { - throw new Error( - 'Passing options to getClient is forbidden in v5.0.0. Use new GoogleAuth(opts) instead.' - ); - } + async getClient() { if (!this.cachedCredential) { if (this.jsonContent) { this._cacheClientFromJSON(this.jsonContent, this.clientOptions); diff --git a/src/auth/oauth2client.ts b/src/auth/oauth2client.ts index 0fdf8dcf..34ff13d4 100644 --- a/src/auth/oauth2client.ts +++ b/src/auth/oauth2client.ts @@ -709,7 +709,6 @@ export class OAuth2Client extends AuthClient { /** * Retrieves the access token using refresh token * - * @deprecated use getRequestHeaders instead. * @param callback callback */ refreshAccessToken(): Promise; diff --git a/test/test.googleauth.ts b/test/test.googleauth.ts index 8ec8f264..f9b601cb 100644 --- a/test/test.googleauth.ts +++ b/test/test.googleauth.ts @@ -1496,14 +1496,6 @@ describe('googleauth', () => { ); }); - it('should throw if options are passed to getClient()', async () => { - const auth = new GoogleAuth(); - await assert.rejects( - auth.getClient({hello: 'world'}), - /Passing options to getClient is forbidden in v5.0.0/ - ); - }); - it('getRequestHeaders populates x-goog-user-project with quota_project if present', async () => { const tokenReq = mockApplicationDefaultCredentials( './test/fixtures/config-with-quota' diff --git a/test/test.oauth2.ts b/test/test.oauth2.ts index ea85ff1e..763eb329 100644 --- a/test/test.oauth2.ts +++ b/test/test.oauth2.ts @@ -900,14 +900,6 @@ describe('oauth2', () => { }); }); - it('should not emit warning on refreshAccessToken', async () => { - let warned = false; - sandbox.stub(process, 'emitWarning').callsFake(() => (warned = true)); - client.refreshAccessToken(() => { - assert.strictEqual(warned, false); - }); - }); - it('should return error in callback on refreshAccessToken', done => { client.refreshAccessToken((err, result) => { assert.strictEqual(err!.message, 'No refresh token is set.');