LookoutUI: configure displayname#4795
Conversation
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…playname Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Greptile SummaryThis PR allows operators to configure which OIDC claim is used to display the username in LookoutUI (defaulting to Confidence Score: 5/5Safe to merge — all previous review concerns are addressed and no new issues introduced. All previously flagged concerns (type narrowness, silent fallback, YAML comment) are addressed in this revision. The implementation follows established codebase patterns (module-level No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Op as Operator Config
participant Go as Go UIConfig (types.go)
participant TS as TypeScript OidcConfig (types.ts)
participant Hook as useUsername hook (hooks.ts)
participant OIDC as OIDC Provider
Op->>Go: displayNameClaim: "name"
Go->>TS: JSON: { displayNameClaim: "name" }
Hook->>OIDC: getUser()
OIDC-->>Hook: user.profile { sub, name, ... }
Hook->>Hook: config.oidc.displayNameClaim = "name"
Hook->>Hook: profile["name"] === string? setUsername("name")
Hook->>Hook: else console.warn + setUsername(sub)
Reviews (3): Last reviewed commit: "Merge branch 'master' into fix/configure..." | Re-trigger Greptile |
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
What type of PR is this?
This PR allows operators to configure which oidc claim is used to display a username
What this PR does / why we need it
Currently the username is set to the sub claim which is not always human readable for example when doing local development using authentication with Keycloak


Default:
With
uiConfig.oidc.displayNameClaim=name:Special notes for your reviewer