feat(config): add tokenUrl, clientId, clientSecret to auth config
CI / CI (pull_request) Successful in 3m20s
CI / CI (pull_request) Successful in 3m20s
Wire token exchange config for /auth/token and /auth/refresh endpoints. clientSecret loaded from AUTH_CLIENT_SECRET env var (never from YAML). Backward compatible — missing fields default to zero values. 3 new tests covering: full config, env-only secret, backward compat. Closes homelab#12 Co-authored-by: poimen <[email protected]>
This commit is contained in:
@@ -25,6 +25,8 @@ type rawAuth struct {
|
||||
Audience string `yaml:"audience"`
|
||||
JWKSURL string `yaml:"jwksUrl"`
|
||||
RequiredCapability string `yaml:"requiredCapability"`
|
||||
TokenURL string `yaml:"tokenUrl"`
|
||||
ClientID string `yaml:"clientId"`
|
||||
}
|
||||
|
||||
// rawRoute represents a single route in the YAML configuration.
|
||||
@@ -176,6 +178,9 @@ func LoadRoutesAndModelsFromFile(path string) (map[string]*Route, map[string]*Mo
|
||||
Audience: raw.Auth.Audience,
|
||||
JWKSURL: raw.Auth.JWKSURL,
|
||||
RequiredCapability: raw.Auth.RequiredCapability,
|
||||
TokenURL: raw.Auth.TokenURL,
|
||||
ClientID: raw.Auth.ClientID,
|
||||
ClientSecret: os.Getenv("AUTH_CLIENT_SECRET"),
|
||||
}
|
||||
|
||||
return routes, models, adapters, authConfig, nil
|
||||
|
||||
Reference in New Issue
Block a user