Skip to content

Commit 8adb44c

Browse files
authored
fix: Disable Universe Domain Check (#1878)
* fix: Disable Universe Domain Check * chore: compodoc nonsense
1 parent 66f60bc commit 8adb44c

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"ncp": "^2.0.0",
5757
"nock": "^13.0.0",
5858
"null-loader": "^4.0.0",
59+
"pdfmake": "0.2.12",
5960
"puppeteer": "^21.0.0",
6061
"sinon": "^18.0.0",
6162
"ts-loader": "^8.0.0",

src/auth/googleauth.ts

-6
Original file line numberDiff line numberDiff line change
@@ -457,12 +457,6 @@ export class GoogleAuth<T extends AuthClient = JSONClient> {
457457

458458
// Determine if we're running on GCE.
459459
if (await this._checkIsGCE()) {
460-
// set universe domain for Compute client
461-
if (!originalOrCamelOptions(options).get('universe_domain')) {
462-
options.universeDomain =
463-
await this.getUniverseDomainFromMetadataServer();
464-
}
465-
466460
(options as ComputeOptions).scopes = this.getAnyScopes();
467461
return await this.#prepareAndCacheClient(new Compute(options));
468462
}

test/test.googleauth.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,8 @@ describe('googleauth', () => {
11491149

11501150
it('getCredentials should get metadata from the server when running on GCE', async () => {
11511151
const clientEmail = '[email protected]';
1152-
const universeDomain = 'my-amazing-universe.com';
11531152
const scopes = [
1154-
nockIsGCE({universeDomain}),
1153+
nockIsGCE(),
11551154
createGetProjectIdNock(),
11561155
nock(host).get(svcAccountPath).reply(200, clientEmail, HEADERS),
11571156
];
@@ -1160,7 +1159,6 @@ describe('googleauth', () => {
11601159
const body = await auth.getCredentials();
11611160
assert.ok(body);
11621161
assert.strictEqual(body.client_email, clientEmail);
1163-
assert.strictEqual(body.universe_domain, universeDomain);
11641162
assert.strictEqual(body.private_key, undefined);
11651163
scopes.forEach(s => s.done());
11661164
});
@@ -1644,14 +1642,6 @@ describe('googleauth', () => {
16441642
assert.notEqual(universe_domain, DEFAULT_UNIVERSE);
16451643
assert.equal(await auth.getUniverseDomain(), universe_domain);
16461644
});
1647-
1648-
it('should use the metadata service if on GCP', async () => {
1649-
const universeDomain = 'my.universe.com';
1650-
const scope = nockIsGCE({universeDomain});
1651-
1652-
assert.equal(await auth.getUniverseDomain(), universeDomain);
1653-
await scope.done();
1654-
});
16551645
});
16561646

16571647
function mockApplicationDefaultCredentials(path: string) {

0 commit comments

Comments
 (0)