MCPcopy Create free account
hub / github.com/docker/docker-agent / buildTestJWT

Function buildTestJWT

cmd/root/debug_auth_test.go:15–21  ·  view source on GitHub ↗
(claims map[string]any)

Source from the content-addressed store, hash-verified

13)
14
15func buildTestJWT(claims map[string]any) string {
16 header := base64.RawURLEncoding.EncodeToString([]byte(`{"alg":"HS256","typ":"JWT"}`))
17 payload, _ := json.Marshal(claims)
18 payloadB64 := base64.RawURLEncoding.EncodeToString(payload)
19 sig := base64.RawURLEncoding.EncodeToString([]byte("fakesig"))
20 return fmt.Sprintf("%s.%s.%s", header, payloadB64, sig)
21}
22
23func TestParseAuthInfo_ValidToken(t *testing.T) {
24 t.Parallel()

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected