[release-11.4.7] IAM: Return 401 if identity type is not valid in GetUserPreferences (#107826)
Backend Unit Tests / Grafana (push) Has been cancelled Details
Backend Unit Tests / Grafana Enterprise (push) Has been cancelled Details
CodeQL checks / Analyze (go) (push) Has been cancelled Details
CodeQL checks / Analyze (javascript) (push) Has been cancelled Details
CodeQL checks / Analyze (python) (push) Has been cancelled Details
Lint Frontend / Verify i18n (push) Has been cancelled Details
Lint Frontend / Lint (push) Has been cancelled Details
Lint Frontend / Typecheck (push) Has been cancelled Details
Lint Frontend / Betterer (push) Has been cancelled Details
End-to-end tests / Build & Package Grafana (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (1) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (2) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (3) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (4) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (5) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (6) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (7) (push) Has been cancelled Details
Frontend tests / Unit tests (${{ matrix.chunk }} / 8) (8) (push) Has been cancelled Details
Integration Tests / Sqlite (push) Has been cancelled Details
Integration Tests / MySQL (push) Has been cancelled Details
Integration Tests / Postgres (push) Has been cancelled Details
Dispatch sync to mirror / dispatch-job (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (dashboards-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (panels-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (smoke-tests-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (various-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (old arch) (old-arch/dashboards-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (old arch) (old-arch/panels-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (old arch) (old-arch/smoke-tests-suite) (push) Has been cancelled Details
End-to-end tests / ${{ matrix.suite }} (old arch) (old-arch/various-suite) (push) Has been cancelled Details

IAM: Return 401 if identity type is not valid in GetUserPreferences (#107760)

fix(GetUserPreferences): Return 401 if identity type is not valid

(cherry picked from commit e4743a9092)
This commit is contained in:
grafana-delivery-bot[bot] 2025-07-09 08:05:42 +01:00 committed by GitHub
parent 9b9589e5ff
commit 5342207517
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ func (hs *HTTPServer) SetHomeDashboard(c *contextmodel.ReqContext) response.Resp
func (hs *HTTPServer) GetUserPreferences(c *contextmodel.ReqContext) response.Response {
userID, err := identity.UserIdentifier(c.SignedInUser.GetID())
if err != nil {
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", err)
return response.Error(http.StatusUnauthorized, "Not a valid identity", err)
}
return prefapi.GetPreferencesFor(c.Req.Context(), hs.DashboardService, hs.preferenceService, c.SignedInUser.GetOrgID(), userID, 0)