Skip to content

Commit

Permalink
fix: repair a logic bug for domain-wide delegation (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored May 18, 2022
1 parent 714f1fe commit 7c32666
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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.`,
);
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,
Expand Down

0 comments on commit 7c32666

Please sign in to comment.