From 3e312af456cb368d4e721cdbb80fed040f84d36c Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Tue, 27 Oct 2026 17:39:33 +0100 Subject: [PATCH] fix(proxy): [OCISDEV-1464] log why the guest role mapping does not apply mapGuestRole dropped the extractRoles error without a log line. When PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM had a wrong claim name, each guest kept the guest role, and the admin could not find the cause. mapGuestRole now writes a debug log line with the claim name and the error. A guest without a roles claim is valid, and the role assigner runs on each request, so the log level is debug and not warning. Co-Authored-By: Claude Opus 5.5 --- services/proxy/pkg/userroles/oidcroles.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/proxy/pkg/userroles/oidcroles.go b/services/proxy/pkg/userroles/oidcroles.go index dc5a82cb383..34d7f587d1e 100644 --- a/services/proxy/pkg/userroles/oidcroles.go +++ b/services/proxy/pkg/userroles/oidcroles.go @@ -260,6 +260,8 @@ func GuestRoleMapping(cfg *config.Config) ([]config.RoleMapping, error) { func (ra oidcRoleAssigner) mapGuestRole(claims map[string]interface{}, guestRole string, roleNamesToRoleIDs map[string]string) (string, error) { claimRoles, err := extractRoles(ra.rolesClaim, claims) if err != nil || len(claimRoles) == 0 { + // a guest without roles claim is valid, log at debug level to help find a wrong claim name + ra.logger.Debug().Err(err).Str("claim", ra.rolesClaim).Msg("no roles in claim, the guest keeps the guest role") return guestRole, nil }