Redact out signature value from authorization string.
(origAuth string)
| 476 | |
| 477 | // Redact out signature value from authorization string. |
| 478 | func 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 |
no outgoing calls