Skip to main content

redact_credentials

Function redact_credentials 

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

Ported from RedactCredentials. Returns target safe for logging: credentials embedded in a URL-form remote target’s userinfo are removed, leaving scheme, host, path, and query. The whole userinfo goes, not just the password, because tokens are commonly passed as a bare username. Local paths are returned unchanged.