-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extend
universe_domain
support (#1633)
* feat: extend `universe_domain` support * style: lint * chore: minor fix * chore: lint * chore: lint * run lint --------- Co-authored-by: Sofia Leon <[email protected]>
- Loading branch information
Showing
4 changed files
with
85 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import { | |
EXPIRATION_TIME_OFFSET, | ||
BaseExternalAccountClient, | ||
BaseExternalAccountClientOptions, | ||
DEFAULT_UNIVERSE, | ||
} from '../src/auth/baseexternalclient'; | ||
import { | ||
OAuthErrorResponse, | ||
|
@@ -80,7 +81,6 @@ describe('BaseExternalAccountClient', () => { | |
credential_source: { | ||
file: '/var/run/secrets/goog.id/token', | ||
}, | ||
universe_domain: 'universe.domain.com', | ||
}; | ||
const externalAccountOptionsWithCreds = { | ||
type: 'external_account', | ||
|
@@ -294,6 +294,26 @@ describe('BaseExternalAccountClient', () => { | |
}); | ||
}); | ||
|
||
describe('universeDomain', () => { | ||
it('should be the default universe if not set', () => { | ||
const client = new TestExternalAccountClient(externalAccountOptions); | ||
|
||
assert.equal(client.universeDomain, DEFAULT_UNIVERSE); | ||
}); | ||
|
||
it('should be set if provided', () => { | ||
const universeDomain = 'my-universe.domain.com'; | ||
const options: BaseExternalAccountClientOptions = { | ||
...externalAccountOptions, | ||
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]'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters