-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fixes #25555: #5903
Fixes #25555: #5903
Conversation
PR updated with a new commit |
// Show the first 4 chars: enough to disambiguate, and preserves 166 bits of randomness. | ||
def exposeSecretBeginning: String = { | ||
val acceptableToReveal = 4 | ||
value.take(acceptableToReveal) + '*'.toString() * (value.size - acceptableToReveal) |
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.
You don't actually need to use the real length of * here, it might be already a valuable information. A fixed 6 * or whatever would be better.
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.
Yes, I wondered about it. As it is a Rudder token is should always be 32 chars long, and I wanted to avoid provided "false information" about the length that would hamper debugging. I'll try to find a suitable format.
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.
Updated with a bit different solution
PR updated with a new commit |
OK, squash merging this PR |
https://issues.rudder.io/issues/25555
The problem was that the log message used the raw token and not the typed
ApiToken
(which has a customtoString
). But it is useful to be able to identify an unknown token, and we can afford to lose a bit of randomness.