MCPcopy
hub / github.com/containerd/containerd / WithAuthHeader

Function WithAuthHeader

core/remotes/docker/authorizer.go:76–86  ·  view source on GitHub ↗

WithAuthHeader provides HTTP headers for authorization We need to merge instead of replacing because header may be set by a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers)

(hdr http.Header)

Source from the content-addressed store, hash-verified

74// We need to merge instead of replacing because header may be set by
75// a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers)
76func WithAuthHeader(hdr http.Header) AuthorizerOpt {
77 return func(opt *authorizerConfig) {
78 if opt.header == nil {
79 opt.header = hdr.Clone()
80 } else {
81 for k, v := range hdr {
82 opt.header[k] = append(opt.header[k], v...)
83 }
84 }
85 }
86}
87
88// OnFetchRefreshToken is called on fetching request token.
89type OnFetchRefreshToken func(ctx context.Context, refreshToken string, req *http.Request)

Callers 3

ConfigureHostsFunction · 0.92
registryHostsMethod · 0.92
NewResolverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…