fix: disable /loaduser [Backport release/0.4.z]#980
Merged
carlosthe19916 merged 1 commit intorelease/0.4.zfrom Apr 10, 2026
Merged
fix: disable /loaduser [Backport release/0.4.z]#980carlosthe19916 merged 1 commit intorelease/0.4.zfrom
carlosthe19916 merged 1 commit intorelease/0.4.zfrom
Conversation
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> (cherry picked from commit 2007d2c)
Merged
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBackports a configuration-driven toggle to disable the OIDC /loaduser call by introducing a new OIDC_LOAD_USER env/config parameter, wiring it through the Rust UI config, shared environment builder, and client OIDC settings so that loadUserInfo can be turned off without code changes. Sequence diagram for conditional OIDC loadUserInfo callsequenceDiagram
actor User
participant Browser
participant Config
participant OIDCProvider
User->>Browser: Initiate login
Browser->>Config: Read OIDC_LOAD_USER
Config-->>Browser: OIDC_LOAD_USER value
Browser->>OIDCProvider: Authorization request (response_type=code)
OIDCProvider-->>Browser: Authorization code
Browser->>OIDCProvider: Token request (code)
OIDCProvider-->>Browser: ID token and access token
alt OIDC_LOAD_USER is true
Browser->>OIDCProvider: /userinfo (loadUserInfo)
OIDCProvider-->>Browser: User profile
else OIDC_LOAD_USER is false
Browser--xOIDCProvider: Skip /userinfo call
end
Class diagram for OIDC_LOAD_USER configuration flowclassDiagram
class TrustificationEnvType {
+string? OIDC_SERVER_URL
+string? OIDC_SERVER_EMBEDDED_PATH
+string? OIDC_CLIENT_ID
+string? OIDC_SCOPE
+string? OIDC_LOAD_USER
}
class BuildTrustificationEnv {
+buildTrustificationEnv(AUTH_REQUIRED, OIDC_CLIENT_ID, OIDC_SCOPE, OIDC_LOAD_USER, UI_INGRESS_PROXY_BODY_SIZE, TRUSTIFY_API_URL, OIDC_SERVER_URL, OIDC_SERVER_IS_EMBEDDED, OIDC_SERVER_EMBEDDED_PATH) TrustificationEnvType
}
class UI {
+string oidc_scope
+string oidc_load_user
}
class OidcModule {
+string OIDC_SERVER_URL
+string OIDC_CLIENT_ID
+boolean OIDC_LOAD_USER
}
class OidcClientSettings {
+string authority
+string client_id
+string redirect_uri
+string post_logout_redirect_uri
+string response_type
+boolean loadUserInfo
+string scope
}
BuildTrustificationEnv ..> TrustificationEnvType : constructs
UI ..> TrustificationEnvType : serializes_to_env
OidcModule ..> TrustificationEnvType : reads_from_ENV
OidcClientSettings ..> OidcModule : uses
OidcClientSettings : loadUserInfo = OIDC_LOAD_USER
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The frontend currently defaults
OIDC_LOAD_USERtofalsewhen the env var is missing (ENV.OIDC_LOAD_USER === "true"), which changes behavior if an older backend doesn’t provide the variable; consider defaulting totrue(e.g.ENV.OIDC_LOAD_USER !== "false") to preserve existing behavior unless explicitly disabled. - On the Rust side,
oidc_load_useris modeled as aString; consider using aboolwith appropriate serde handling to avoid accidentally accepting invalid values and to better reflect the intended semantics.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The frontend currently defaults `OIDC_LOAD_USER` to `false` when the env var is missing (ENV.OIDC_LOAD_USER === "true"), which changes behavior if an older backend doesn’t provide the variable; consider defaulting to `true` (e.g. `ENV.OIDC_LOAD_USER !== "false"`) to preserve existing behavior unless explicitly disabled.
- On the Rust side, `oidc_load_user` is modeled as a `String`; consider using a `bool` with appropriate serde handling to avoid accidentally accepting invalid values and to better reflect the intended semantics.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
carlosthe19916
approved these changes
Apr 10, 2026
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.
Description
Backport of #975 to
release/0.4.z.Summary by Sourcery
Make OIDC user info loading configurable via an environment variable and propagate it through the UI configuration.
New Features:
Bug Fixes:
Enhancements: