fix(api): clarify nolint comment and add fallback doc in bearer_oidc.go

Agent-Logs-Url: https://github.com/project-zot/zot/sessions/1a321663-3147-46e9-9321-989e5dd0ed3c

Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-19 02:02:52 +00:00
committed by GitHub
parent 4372a3faca
commit 1182981b0d
+3 -1
View File
@@ -236,10 +236,12 @@ func getOIDCTokenFromAuthorizationHeader(header string, allowBasicAuth bool) (st
}
pair := strings.SplitN(string(decodedStr), ":", 2) //nolint:mnd
if len(pair) != 2 { //nolint:mnd
if len(pair) != 2 { //nolint:mnd
return "", zerr.ErrInvalidBearerToken
}
// Prefer the password field as the token; fall back to the username field
// when the password is empty (e.g. "token:" basic-auth encoding).
tokenString := pair[1]
if tokenString == "" {
tokenString = pair[0]