Skip to content

Check Provider Readiness

Provider Preflight is an automatable readiness check under examples/providerPreflight. Use it after creating a provider-backed resource, before cutting traffic over, and from CI before each deploy. It walks the same chain a real Gateway request depends on — control plane, Gateway dependencies, application identity, provider binding and configuration, network paths, and the active policy decision — and reports exactly which link is broken and how to fix it.

Checks run in five phases:

PhaseCheckWhat it confirms
readinessAdmin API readinessThe control plane responds ready on GET /ready.
readinessGateway readinessThe Gateway responds ready, which verifies its bindings, Postgres, Redis, revocation freshness, audit replay, and STS.
dependenciesResource bindingThe resource resolves to exactly one credential provider and a Gateway application.
dependenciesApplicationThe application exists, is not expired, and matches the resource’s routing binding.
configurationProvider configurationKind-required fields are present and allowed_token_hosts covers the token endpoint.
configurationScope coverageEvery requested scope is declared on the resource.
configurationRuntime injectionRuntime-injection eligibility is enabled when required.
connectivityToken endpoint hostOAuth token endpoints are HTTPS and publicly routable.
connectivityCallback reachabilityAuthorization-code callback origins are HTTPS and reachable.
connectivityUpstream reachabilityThe protected upstream is reachable, with a warning when it resolves to a private address.
authorizationPolicy authorizationSimulating the active policy set with the input shape STS uses for real token exchanges returns allow.

The preflight fails closed. Any failed check exits non-zero, and every failure or warning prints a fix: line with the concrete remediation.

Terminal window
cd examples/providerPreflight
CARACAL_API_URL=http://127.0.0.1:3000 \
CARACAL_ADMIN_TOKEN=<admin-token> \
PREFLIGHT_ZONE_ID=<zone-id> \
PREFLIGHT_RESOURCE_ID=<resource-id> \
PREFLIGHT_APPLICATION_ID=<app-id> \
PREFLIGHT_SCOPES=pipernet:read,pipernet:write \
npm run preflight

Optional settings:

VariablePurpose
PREFLIGHT_GATEWAY_URLProbes the Gateway’s /ready endpoint; without it the Gateway phase reports a warning instead of validating.
PREFLIGHT_REQUIRE_RUNTIME_INJECTION=trueRequires providers to allow runtime injection.
PREFLIGHT_OUTPUT=jsonEmits the full report as JSON for CI pipelines and dashboards.

Exit codes: 0 when all checks pass, 1 when any check fails, 2 when the preflight itself cannot run.

Upstream reachability and Callback reachability run from the host executing the script. Run it from a network position comparable to Gateway, or inside the cluster, when you need the reachability result to match production routing.

Terminal window
cd examples/providerPreflight
npm test

The tests inject network, DNS, and policy responses and do not call live systems.

Continue to Iterate Policy Safely when a denied request needs to become a tested policy change.