MCPcopy
hub / github.com/minio/minio-go / redactSignature

Function redactSignature

utils.go:478–492  ·  view source on GitHub ↗

Redact out signature value from authorization string.

(origAuth string)

Source from the content-addressed store, hash-verified

476
477// Redact out signature value from authorization string.
478func redactSignature(origAuth string) string {
479 if !strings.HasPrefix(origAuth, signV4Algorithm) {
480 // Set a temporary redacted auth
481 return "AWS **REDACTED**:**REDACTED**"
482 }
483
484 // Signature V4 authorization header.
485
486 // Strip out accessKeyID from:
487 // Credential=<access-key-id>/<date>/<aws-region>/<aws-service>/aws4_request
488 newAuth := regCred.ReplaceAllString(origAuth, "Credential=**REDACTED**/")
489
490 // Strip out 256-bit signature from: Signature=<256-bit signature>
491 return regSign.ReplaceAllString(newAuth, "Signature=**REDACTED**")
492}
493
494// Get default location returns the location based on the input
495// URL `u`, if region override is provided then all location

Callers 2

dumpHTTPMethod · 0.85
TestRedactSignatureFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRedactSignatureFunction · 0.68