MCPcopy
hub / github.com/containerd/containerd / TestAnonymousTokenResolver

Function TestAnonymousTokenResolver

core/remotes/docker/resolver_test.go:115–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestAnonymousTokenResolver(t *testing.T) {
116 th := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
117 if r.Method != http.MethodGet {
118 rw.WriteHeader(http.StatusMethodNotAllowed)
119 return
120 }
121 rw.Header().Set("Content-Type", "application/json")
122 rw.WriteHeader(http.StatusOK)
123 rw.Write([]byte(`{"access_token":"perfectlyvalidopaquetoken"}`))
124 })
125
126 runBasicTest(t, "testname", withTokenServer(th, nil))
127}
128
129func TestBasicAuthTokenResolver(t *testing.T) {
130 th := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 5

withTokenServerFunction · 0.85
HeaderMethod · 0.80
runBasicTestFunction · 0.70
SetMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…