LookoutUI: configure displayname#4795
Open
d2burkhalter wants to merge 3 commits intoarmadaproject:masterfrom
Open
LookoutUI: configure displayname#4795d2burkhalter wants to merge 3 commits intoarmadaproject:masterfrom
d2burkhalter wants to merge 3 commits intoarmadaproject:masterfrom
Conversation
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…playname Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Contributor
Greptile SummaryThis PR adds a configurable Key points:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Server as Go Server
participant Window as window.__LOOKOUT_UI_CONFIG__
participant Config as getConfig()
participant Hook as useUsername hook
participant OIDC as OIDC UserManager
participant UI as React UI
Server->>Window: Serve UIConfig (with oidc.displayNameClaim)
Note over Config: Module initialization (once)
Window->>Config: getConfig() reads config
Config-->>Hook: config (module-level constant)
Hook->>OIDC: userManager.getUser()
OIDC-->>Hook: user (with profile claims)
alt displayNameClaim configured
Hook->>Hook: profile[displayNameClaim]
alt claim is a string
Hook->>UI: setUsername(displayName)
else claim missing or not a string
Hook->>Hook: console.warn(misconfiguration)
Hook->>UI: setUsername(user.profile.sub)
end
else no displayNameClaim
Hook->>UI: setUsername(user.profile.sub)
end
Reviews (2): Last reviewed commit: "fix: make displayNameClaim type more gen..." | Re-trigger Greptile |
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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