-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add oauth options data to auth code exchange errors #1068
Conversation
src/org/authInfo.ts
Outdated
@@ -1242,6 +1257,21 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> { | |||
} | |||
} | |||
|
|||
const getRedactedErrData = (options: JwtOAuth2Config): AnyJson => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check out
sfdx-core/src/logger/filters.ts
Line 71 in 2526e34
export const filterSecrets = (...args: unknown[]): unknown => |
since it's a function and not bound up inside Logger, it might be useful here.
And if it's not handling something well (ex: authCode) then we could add that and it'll automatically make Logger better.
src/org/authInfo.ts
Outdated
error = SfError.wrap(err); | ||
errorMsg = error.message; | ||
} | ||
error.message = messages.getMessage('authCodeExchangeError', [errorMsg]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would overwrite the message set from 1114?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of. I want the server's error name and error description to be part of the authCode exchange error message.
What does this PR do?
Adds oauth options data to auth code exchange errors, redacting sensitive information, to improve telemetry.
What issues does this PR fix or reference?
@W-15758926@