Documentation menu

Configuration

Each setting is a flag of jwks-bridge serve and an environment variable. Flags win over the environment.

Listeners

VariableFlagDefaultDescription
JWKSB_PUBLIC_ADDR--public-addr:8080Public JWKS and health. Empty disables it.
JWKSB_PRIVATE_ADDR--private-addr:8443Private keyset listener. Empty disables it.
JWKSB_ADMIN_ADDR--admin-addr:9090Metrics and probes.

Private listener

VariableFlagDescription
JWKSB_TLS_CERT, JWKSB_TLS_KEY--tls-cert, --tls-keyServer certificate and key. Required. Reloaded when the files change.
JWKSB_CLIENT_CA--client-caCA bundle; enables mTLS client authentication.
JWKSB_ALLOWED_CLIENT_SANS--allowed-client-sansComma-separated SAN or CN allowlist. Empty accepts any certificate from the CA.
JWKSB_BASIC_USER--basic-userBasic auth user.
JWKSB_BASIC_PASSWORD_FILE--basic-password-fileFile holding the Basic auth password.
JWKSB_PRIVATE_INSECURE_PLAINTEXT--private-insecure-plaintexttrue serves the keyset without TLS. Local development only.

At least one of mTLS or Basic auth is required. When both are set, either one admits the caller.

Source and keysets

VariableFlagDefaultDescription
JWKSB_SOURCE--sourcevaultvault or file.
JWKSB_KEYSETS--keysetsdefault=secret/jwks-bridge/defaultComma-separated name=path pairs.
JWKSB_FILE_DIR--file-dirBase directory for relative paths with the file source.

Vault

VariableFlagDefaultDescription
JWKSB_VAULT_AUTH--vault-authtokentoken, kubernetes or approle.
JWKSB_VAULT_ROLE--vault-roleKubernetes auth role.
JWKSB_VAULT_AUTH_MOUNT--vault-auth-mountmethod nameAuth mount path.
JWKSB_VAULT_K8S_TOKEN_PATH--vault-k8s-token-pathprojected SA tokenService account token file.
JWKSB_VAULT_APPROLE_ROLE_ID--vault-approle-role-idAppRole role id.
JWKSB_VAULT_APPROLE_SECRET_ID_FILE--vault-approle-secret-id-fileFile holding the AppRole secret id.

The Vault client also reads VAULT_ADDR, VAULT_TOKEN, VAULT_CACERT, VAULT_NAMESPACE and the other standard variables.

Timing

VariableFlagDefaultDescription
JWKSB_REFRESH_INTERVAL--refresh-interval30sSource poll interval, ±10 % jitter.
JWKSB_MAX_STALE--max-stale1h/readyz fails when the source has not confirmed a keyset for longer.
JWKSB_JWKS_MAX_AGE--jwks-max-age300sCache-Control: max-age of the public JWKS.
JWKSB_MIN_STAGE_DURATION--min-stage-duration10mStaging guard; at least twice the refresh interval.

Logging and tracing

JWKSB_LOG_LEVEL (debug, info, warn, error) and JWKSB_LOG_FORMAT (json, text). Tracing uses the OTEL_* variables listed in Metrics and tracing.