fix: OIDC env vars ignored when no oidc.enc file exists
When OIDC_* environment variables were set but no oidc.enc config file existed, cfg.OIDC was nil and MergeFromEnv would silently return without applying the env vars (due to nil receiver check). Fix: Initialize cfg.OIDC to default values before merging env vars if it's nil. This ensures OIDC can be configured purely through environment variables without requiring a pre-existing config file. Related to #853
This commit is contained in:
parent
358d38f97f
commit
9dc365c9c6
1 changed files with 4 additions and 0 deletions
|
|
@ -1163,6 +1163,10 @@ func Load() (*Config, error) {
|
|||
oidcEnv["OIDC_CA_BUNDLE"] = val
|
||||
}
|
||||
if len(oidcEnv) > 0 {
|
||||
// Ensure cfg.OIDC is initialized before merging env vars
|
||||
if cfg.OIDC == nil {
|
||||
cfg.OIDC = NewOIDCConfig()
|
||||
}
|
||||
cfg.OIDC.MergeFromEnv(oidcEnv)
|
||||
}
|
||||
if authUser := os.Getenv("PULSE_AUTH_USER"); authUser != "" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue