MCPcopy
hub / github.com/containerd/containerd / doBasicAuth

Method doBasicAuth

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

Source from the content-addressed store, hash-verified

262}
263
264func (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) {
265 username, secret := ah.common.Username, ah.common.Secret
266
267 if username == "" || secret == "" {
268 return "", "", fmt.Errorf("failed to handle basic auth because missing username or secret")
269 }
270
271 auth := base64.StdEncoding.EncodeToString([]byte(username + ":" + secret))
272 return fmt.Sprintf("Basic %s", auth), "", nil
273}
274
275func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken string, err error) {
276 // copy common tokenOptions

Callers 1

authorizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected