MCPcopy
hub / github.com/containerd/containerd / authorize

Method authorize

core/remotes/docker/authorizer.go:253–262  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

251}
252
253func (ah *authHandler) authorize(ctx context.Context) (string, string, error) {
254 switch ah.scheme {
255 case auth.BasicAuth:
256 return ah.doBasicAuth(ctx)
257 case auth.BearerAuth:
258 return ah.doBearerAuth(ctx)
259 default:
260 return "", "", fmt.Errorf("failed to find supported auth scheme: %s: %w", string(ah.scheme), errdefs.ErrNotImplemented)
261 }
262}
263
264func (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) {
265 username, secret := ah.common.Username, ah.common.Secret

Callers 1

AuthorizeMethod · 0.45

Calls 2

doBasicAuthMethod · 0.95
doBearerAuthMethod · 0.95

Tested by

no test coverage detected