fix: tooltip lists only the dashboard's relevant groups #49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/dashboard-tooltip-filter-groups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The previous header tooltip dumped every group claim from the OIDC
token, which on a shared Keycloak realm is way too much — a user
might be in nextcloud, glitchtip, uptime-kuma, talos, etc. groups
that the dashboard knows nothing about and doesn't authz against.
Filter the list to the intersection of the user's groups and the
dashboard's configured DASHBOARD_ALLOWED_GROUP / DASHBOARD_ADMIN_GROUP
before passing it to the template. Order-preserving from the token
so the displayed roles match the tokenised order. When neither
gating group is configured, the tooltip is silently omitted (any
authenticated user is allowed in that mode anyway).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Automated review by pr-reviewer v0.20.0 | Safety Check | Claude Sonnet 4 | tracking id
r-f473e2-a8e924This is an AI-gene2ated review and may contain mistakes.
Status: ✅ Completed
✅ Verdict: LGTM — The code correctly filters OIDC groups to only show dashboard-relevant ones, with proper edge case handling and comprehensive tests.
Complexity: moderate
This is a straightforward bug fix that improves the user experience by filtering out irrelevant OIDC groups from the tooltip display. The
relevantGroupsfunction properly handles edge cases (empty inputs, no configured groups) and maintains the original token order. The test coverage is comprehensive, covering all the important scenarios including boundary conditions.