(ctx context.Context)
| 251 | } |
| 252 | |
| 253 | func (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 | |
| 264 | func (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) { |
| 265 | username, secret := ah.common.Username, ah.common.Secret |
no test coverage detected