Replace the userinfo of a URL (https://user:secret@host/...) with ***, so a
credential in a base URL never reaches an error message, a log or CI output.
A value that does not parse as a URL (a port typo, an unencoded "#" in the
password) is cut by text instead (credentialsIn + redactCredentials); one without
userinfo, or without a scheme (user:pw@host is no URL), is returned unchanged.
Replace the userinfo of a URL (
https://user:secret@host/...) with***, so a credential in a base URL never reaches an error message, a log or CI output. A value that does not parse as a URL (a port typo, an unencoded "#" in the password) is cut by text instead (credentialsIn+redactCredentials); one without userinfo, or without a scheme (user:pw@hostis no URL), is returned unchanged.