fix: repair a logic bug for domain-wide delegation (#178)

This commit is contained in:
Seth Vargo 2022-05-18 10:04:31 -04:00 committed by GitHub
parent 714f1fe243
commit 7c32666372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -210,12 +210,14 @@ async function run(): Promise<void> {
// perform Domain-Wide Delegation. Otherwise, use the modern IAM
// Credentials endpoints.
let accessToken, expiration;
if (accessTokenSubject && accessTokenLifetime > 3600) {
if (accessTokenSubject) {
if (accessTokenLifetime > 3600) {
logInfo(
`An access token subject was specified, triggering Domain-Wide ` +
`Delegation flow. This flow does not support specifying an ` +
`access token lifetime of greater than 1 hour.`,
);
}
const unsignedJWT = buildDomainWideDelegationJWT(
serviceAccount,