Skip to content
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

Merged
merged 7 commits into from
May 16, 2024

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented May 14, 2024

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@

@shetzel shetzel requested a review from a team as a code owner May 14, 2024 17:32
@@ -1242,6 +1257,21 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
}
}

const getRedactedErrData = (options: JwtOAuth2Config): AnyJson => {
Copy link
Contributor

Choose a reason for hiding this comment

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

check out

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.

error = SfError.wrap(err);
errorMsg = error.message;
}
error.message = messages.getMessage('authCodeExchangeError', [errorMsg]);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@mshanemc
Copy link
Contributor

#1069

@mshanemc mshanemc merged commit ea859ed into main May 16, 2024
68 checks passed
@mshanemc mshanemc deleted the sh/auth-token-exchange-error-data branch May 16, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants