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

Function TestSignV4OutpostsCredentialScope

pkg/signer/request-signature-v4_test.go:55–66  ·  view source on GitHub ↗

TestSignV4OutpostsCredentialScope verifies that SignV4Outposts produces a credential scope containing s3-outposts.

(t *testing.T)

Source from the content-addressed store, hash-verified

53
54// TestSignV4OutpostsCredentialScope verifies that SignV4Outposts produces a credential scope containing s3-outposts.
55func 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}

Callers

nothing calls this directly

Calls 4

SignV4OutpostsFunction · 0.85
SetMethod · 0.45
GetMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected