-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
jwtauthccl: use RedactableString for detailed error #127016
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
d9559ba
to
7108d7a
Compare
Also, only join the detailed error string if it's non-empty. Release note: None
7108d7a
to
915d33f
Compare
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.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)
pkg/ccl/jwtauthccl/authentication_jwt.go
line 189 at r1 (raw file):
jwkSet, err = authenticator.remoteFetchJWKS(ctx, issuerUrl) if err != nil { return redact.Sprintf("unable to fetch jwks: %v", err),
I found we can't redact this err
targetedly. link: https://reviewable.io/reviews/cockroachdb/cockroach/126227#-O1I-UnF7W0DluMm7qoz
pkg/sql/pgwire/auth_methods.go
line 786 at r1 (raw file):
if detailedErrors, authError := jwtVerifier.ValidateJWTLogin(ctx, execCfg.Settings, user, []byte(token), identMap); authError != nil { errForLog := authError if detailedErrors != "" {
took note of this and updated my implementation https://reviewable.io/reviews/cockroachdb/cockroach/126227
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.
thanks for the review!
bors r+
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @souravcrl)
pkg/ccl/jwtauthccl/authentication_jwt.go
line 189 at r1 (raw file):
Previously, souravcrl wrote…
I found we can't redact this
err
targetedly. link: https://reviewable.io/reviews/cockroachdb/cockroach/126227#-O1I-UnF7W0DluMm7qoz
that's correct, we cannot retroactively apply selective redaction to an error after it's constructed. it's up to the creator of the error to do that, or to define a SafeFormatError
function for that error type.
so for errors from 3rd party libraries, the entire error text will get redacted in logs.
Build failed (retrying...): |
Also, only join the detailed error string if it's non-empty.
Epic: None
Release note: None