Skip to content

Commit

Permalink
fix: add redacted oauth options as error data
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed May 14, 2024
1 parent 3d19629 commit 6aba25d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/org/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,20 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
this.logger.info(`Exchanging auth code for access token using loginUrl: ${options.loginUrl}`);
authFields = await oauth2.requestToken(ensure(options.authCode));
} catch (err) {
const error = SfError.wrap(err);
error.message = messages.getMessage('authCodeExchangeError', [error.message]);
let error: SfError;
let errorMsg: string;
if (err instanceof Error) {
errorMsg = `${err.name}::${err.message}`;
error = SfError.create({
message: errorMsg,
name: 'AuthCodeExchangeError',
cause: err,
});
} else {
error = SfError.wrap(err);
errorMsg = error.message;
}
error.message = messages.getMessage('authCodeExchangeError', [errorMsg]);
error.setData(getRedactedErrData(options));
throw error;
}
Expand Down

2 comments on commit 6aba25d

@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 - ubuntu-latest

Benchmark suite Current: 6aba25d Previous: 80246cd Ratio
Child logger creation 486749 ops/sec (±1.60%) 481998 ops/sec (±1.47%) 0.99
Logging a string on root logger 796617 ops/sec (±10.23%) 815132 ops/sec (±13.10%) 1.02
Logging an object on root logger 624070 ops/sec (±8.45%) 601616 ops/sec (±6.61%) 0.96
Logging an object with a message on root logger 30489 ops/sec (±181.38%) 8110 ops/sec (±206.28%) 0.27
Logging an object with a redacted prop on root logger 487103 ops/sec (±6.01%) 485479 ops/sec (±8.78%) 1.00
Logging a nested 3-level object on root logger 24289 ops/sec (±183.66%) 371132 ops/sec (±7.69%) 15.28

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 - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6aba25d Previous: 80246cd Ratio
Logging a nested 3-level object on root logger 24289 ops/sec (±183.66%) 371132 ops/sec (±7.69%) 15.28

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

Please sign in to comment.