Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ary-nodejs into drop-node-10
  • Loading branch information
danielbankhead committed Apr 14, 2022
2 parents 91a9f43 + e4a5430 commit 78dfe89
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Expand Up @@ -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
17 changes: 17 additions & 0 deletions .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
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
},
Expand Down
10 changes: 1 addition & 9 deletions src/auth/googleauth.ts
Expand Up @@ -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;
}
Expand Down Expand Up @@ -790,12 +787,7 @@ export class GoogleAuth<T extends AuthClient = JSONClient> {
* 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);
Expand Down
1 change: 0 additions & 1 deletion src/auth/oauth2client.ts
Expand Up @@ -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<RefreshAccessTokenResponse>;
Expand Down
8 changes: 0 additions & 8 deletions test/test.googleauth.ts
Expand Up @@ -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'
Expand Down
8 changes: 0 additions & 8 deletions test/test.oauth2.ts
Expand Up @@ -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.');
Expand Down

0 comments on commit 78dfe89

Please sign in to comment.