Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make universeDomain private #1552

Merged
merged 4 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 'service-1234@service-name.iam.gserviceaccount.com';
Expand Down