MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / RedactBasicAuthURLPassword

Function RedactBasicAuthURLPassword

base/util.go:92–99  ·  view source on GitHub ↗

RedactBasicAuthURLPassword returns the given string, with a redacted HTTP basic auth password component.

(ctx context.Context, urlIn string)

Source from the content-addressed store, hash-verified

90
91// RedactBasicAuthURLPassword returns the given string, with a redacted HTTP basic auth password component.
92func RedactBasicAuthURLPassword(ctx context.Context, urlIn string) string {
93 redactedUrl, err := RedactBasicAuthURL(urlIn, true)
94 if err != nil {
95 WarnfCtx(ctx, "%v", err)
96 return ""
97 }
98 return redactedUrl
99}
100
101func RedactBasicAuthURL(urlIn string, passwordOnly bool) (string, error) {
102 urlParsed, err := url.Parse(urlIn)

Callers 1

RedactedMethod · 0.92

Calls 2

RedactBasicAuthURLFunction · 0.85
WarnfCtxFunction · 0.85

Tested by

no test coverage detected