Merge pull request #128 from gbw/fix/oidc-env-vars-in-admin-panel
This commit is contained in:
@@ -149,7 +149,6 @@ impl AdminSettingsService {
|
|||||||
/// Get OIDC settings for display in admin UI (secrets masked).
|
/// Get OIDC settings for display in admin UI (secrets masked).
|
||||||
pub async fn get_oidc_settings(&self) -> Result<OidcSettingsDto, DomainError> {
|
pub async fn get_oidc_settings(&self) -> Result<OidcSettingsDto, DomainError> {
|
||||||
let db = self.settings_repo.get_by_category("oidc").await?;
|
let db = self.settings_repo.get_by_category("oidc").await?;
|
||||||
let d = OidcConfig::default();
|
|
||||||
|
|
||||||
let has_secret = db
|
let has_secret = db
|
||||||
.get("oidc.client_secret")
|
.get("oidc.client_secret")
|
||||||
@@ -159,29 +158,20 @@ impl AdminSettingsService {
|
|||||||
.map(|s| !s.is_empty())
|
.map(|s| !s.is_empty())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
|
// Load effective config with env var overrides applied
|
||||||
|
let effective = self.load_effective_oidc_config().await?;
|
||||||
|
|
||||||
Ok(OidcSettingsDto {
|
Ok(OidcSettingsDto {
|
||||||
enabled: db
|
enabled: effective.enabled,
|
||||||
.get("oidc.enabled")
|
issuer_url: effective.issuer_url,
|
||||||
.and_then(|v| v.parse().ok())
|
client_id: effective.client_id,
|
||||||
.unwrap_or(d.enabled),
|
|
||||||
issuer_url: db.get("oidc.issuer_url").cloned().unwrap_or_default(),
|
|
||||||
client_id: db.get("oidc.client_id").cloned().unwrap_or_default(),
|
|
||||||
client_secret_set: has_secret,
|
client_secret_set: has_secret,
|
||||||
scopes: db.get("oidc.scopes").cloned().unwrap_or(d.scopes),
|
scopes: effective.scopes,
|
||||||
auto_provision: db
|
auto_provision: effective.auto_provision,
|
||||||
.get("oidc.auto_provision")
|
admin_groups: effective.admin_groups,
|
||||||
.and_then(|v| v.parse().ok())
|
disable_password_login: effective.disable_password_login,
|
||||||
.unwrap_or(d.auto_provision),
|
provider_name: effective.provider_name,
|
||||||
admin_groups: db.get("oidc.admin_groups").cloned().unwrap_or_default(),
|
callback_url: effective.redirect_uri.clone(),
|
||||||
disable_password_login: db
|
|
||||||
.get("oidc.disable_password_login")
|
|
||||||
.and_then(|v| v.parse().ok())
|
|
||||||
.unwrap_or(d.disable_password_login),
|
|
||||||
provider_name: db
|
|
||||||
.get("oidc.provider_name")
|
|
||||||
.cloned()
|
|
||||||
.unwrap_or(d.provider_name),
|
|
||||||
callback_url: self.callback_url(),
|
|
||||||
env_overrides: self.get_env_overrides(),
|
env_overrides: self.get_env_overrides(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user