TestSignV4OutpostsCredentialScope verifies that SignV4Outposts produces a credential scope containing s3-outposts.
(t *testing.T)
| 53 | |
| 54 | // TestSignV4OutpostsCredentialScope verifies that SignV4Outposts produces a credential scope containing s3-outposts. |
| 55 | func TestSignV4OutpostsCredentialScope(t *testing.T) { |
| 56 | req, _ := http.NewRequest(http.MethodGet, "https://myap-123.op-xyz.s3-outposts.eu-central-1.amazonaws.com/bucket/key", nil) |
| 57 | req.Header.Set("Host", req.URL.Host) |
| 58 | signed := SignV4Outposts(*req, "AKID", "SECRET", "", "eu-central-1") |
| 59 | auth := signed.Header.Get("Authorization") |
| 60 | if auth == "" { |
| 61 | t.Fatal("Authorization header missing") |
| 62 | } |
| 63 | if !strings.Contains(auth, "s3-outposts") { |
| 64 | t.Errorf("Expected Authorization credential scope to contain s3-outposts, got: %s", auth) |
| 65 | } |
| 66 | } |
nothing calls this directly
no test coverage detected