Skip to content

Commit

Permalink
fix: make universeDomain private (#1552)
Browse files Browse the repository at this point in the history
* feat: adds universe_domain field to base external client

* fix: make universeDomain private

* fixing merge issue
  • Loading branch information
aeitzman authored May 19, 2023
1 parent 7412d7c commit 73b63d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/auth/baseexternalclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export abstract class BaseExternalAccountClient extends AuthClient {
private readonly stsCredential: sts.StsCredentials;
private readonly clientAuth?: ClientAuthentication;
private readonly workforcePoolUserProject?: string;
private universeDomain?: string;
public projectId: string | null;
public projectNumber: string | null;
public universeDomain?: string;
public readonly eagerRefreshThresholdMillis: number;
public readonly forceRefreshOnFailure: boolean;
/**
Expand Down
21 changes: 1 addition & 20 deletions test/test.baseexternalclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('BaseExternalAccountClient', () => {
credential_source: {
file: '/var/run/secrets/goog.id/token',
},
universe_domain: 'universe.domain.com',
};
const externalAccountOptionsWithCreds = {
type: 'external_account',
Expand Down Expand Up @@ -283,26 +284,6 @@ describe('BaseExternalAccountClient', () => {
});
});

describe('universeDomain', () => {
it('should be undefined if not set', () => {
const client = new TestExternalAccountClient(externalAccountOptions);

assert(client.universeDomain === undefined);
});

it('should be set if provided', () => {
const universeDomain = 'universe.domain.com';
const options: BaseExternalAccountClientOptions = Object.assign(
{},
externalAccountOptions
);
options.universe_domain = universeDomain;
const client = new TestExternalAccountClient(options);

assert.equal(client.universeDomain, universeDomain);
});
});

describe('getServiceAccountEmail()', () => {
it('should return the service account email when impersonation is used', () => {
const saEmail = '[email protected]';
Expand Down

0 comments on commit 73b63d5

Please sign in to comment.