Skip to content

Commit

Permalink
fix: jwt logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Feb 11, 2025
1 parent 958ef8e commit 9ebbe71
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/org/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
// sequentially, in probabilistic order
// eslint-disable-next-line no-await-in-loop
authFieldsBuilder = await this.tryJwtAuth(options.clientId, login, audience, privateKeyContents);
this.logger.debug(
`authFieldsBuilder response for ${login} | ${audience}: ${JSON.stringify(authFieldsBuilder, null, 2)}`
);
break;
} catch (err) {
const error = err as Error;
Expand Down Expand Up @@ -1047,6 +1050,20 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
}
);

this.logger.debug(
`JWT payload: ${JSON.stringify(
{
iss: clientId,
sub: this.getUsername(),
aud: audienceUrl,
},
null,
2
)}`
);
this.logger.debug(`JWT token: ${os.EOL + jwtToken + os.EOL}`);
this.logger.debug(`loginUrl: ${loginUrl}`);

const oauth2 = new OAuth2({ loginUrl });
return ensureJsonMap(
await oauth2.requestToken({
Expand Down

2 comments on commit 9ebbe71

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 9ebbe71 Previous: 0f998f8 Ratio
Child logger creation 334964 ops/sec (±1.70%) 323766 ops/sec (±1.08%) 0.97
Logging a string on root logger 859757 ops/sec (±9.58%) 833980 ops/sec (±7.65%) 0.97
Logging an object on root logger 39041 ops/sec (±184.61%) 659245 ops/sec (±11.85%) 16.89
Logging an object with a message on root logger 413813 ops/sec (±8.12%) 23352 ops/sec (±185.96%) 0.05643128659563619
Logging an object with a redacted prop on root logger 515419 ops/sec (±8.52%) 551418 ops/sec (±8.61%) 1.07
Logging a nested 3-level object on root logger 18759 ops/sec (±187.29%) 16140 ops/sec (±189.86%) 0.86

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - windows-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 9ebbe71 Previous: 0f998f8 Ratio
Logging an object on root logger 39041 ops/sec (±184.61%) 659245 ops/sec (±11.85%) 16.89

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.