feat: oidc provider config route

feat: add auth config attributes `API_HOSTNAME` and `API_PUBLIC_URL`

feat: `introspectionEndpoint` and `revocationEndpoint` for `GetOpenIDProviderConfigResponse`
This commit is contained in:
2025-09-29 21:07:45 +01:00
parent 958f96b3e5
commit 1b0cc09aad
6 changed files with 321 additions and 256 deletions

View File

@@ -68,6 +68,15 @@ type ServiceConfigOpts struct {
// Generated from PrivateKey
PublicJwk *pb.PublicEcJWK
// Env Var: "API_HOSTNAME"
// i.e. "api.example.com"
ApiHostname string
// Env Var: "API_PUBLIC_URL"
// default: http://localhost/api
// i.e: "https://example.com/api" or "https://api.example.com"
ApiPublicUrl string
}
// Load the ServiceConfigOpts
@@ -84,6 +93,21 @@ func (opts *ServiceConfigOpts) Load() error {
// prepare the JWK public key
opts.PublicJwk = preparePublicJwk(opts.PrivateKey)
// load other attributes
apiHostname, err := config.RequireFromEnv("API_HOSTNAME")
if err != nil {
return err
}
opts.ApiHostname = apiHostname
apiPublicUrl, err := config.RequireFromEnv("API_PUBLIC_URL")
if err != nil {
return err
}
opts.ApiPublicUrl = apiPublicUrl
return nil
}