Skip to content

Commit 67cfed5

Browse files
authored
check twice for forbidden before return (fixes #554) (#555)
5248a3a introduced better error handling for FORBIDDEN errors. This caused a slight regression in the authentication handling for OIDC logins (introduced in #497). This PR moves the error message outside of the "retry" block. Signed-off-by: Sebastian Höffner <info@sebastian-hoeffner.de>
1 parent 1a11d78 commit 67cfed5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ func (c *Client) SendRequest(method string, path string, payload interface{}, st
117117
}
118118
}
119119
}
120+
}
121+
122+
if resp.StatusCode == http.StatusForbidden {
120123
return "", "", resp.StatusCode, fmt.Errorf("[ERROR] forbidden: status=%s, code=%d \nIf you are using a robot account, this is likely due to RBAC limitations. See: https://github.com/goharbor/community/blob/main/proposals/new/Robot-Account-Expand.md", resp.Status, resp.StatusCode)
121124
}
122125

0 commit comments

Comments
 (0)