Skip to main content

redact_credentials

Function redact_credentials 

Source
pub fn redact_credentials(input: &str) -> String
Expand description

Redact credentials from a string before it enters an error message.

Connection strings and driver errors can carry scheme://user:password@host. We collapse the userinfo to *** so passwords (and usernames) never reach a log line or a surfaced diagnostic, while keeping the scheme/host for context.