Internal (gateway) APIs¶
Spec 109 / RW-758; contract published + gated by spec 110 / RW-933. The multi-tenancy-core service
exposes a small set of internal endpoints under the /internal/** prefix, consumed by the API
gateway (Kong) — not by end users. They are blocked at the public edge and carry no tenant/PAT
auth in the usual sense; the gateway calls them over the internal network.
These endpoints are the contract Kong depends on, so they are published and protected the same way the public API is — a change to either endpoint's shape fails CI, so it can no longer silently break the gateway:
- They are documented in a dedicated
internalspringdoc group (InternalApiDocsConfig), served at/v3/api-docs/internal, tagged@Tag("Internal — gateway")on the controllers. - They stay out of the public contract (
api-spec/multi-tenancy-core-v1.json, generated from thepublic-v1group, which excludes/internal/**) and never appear on the public API portal — no internal shapes leak to public clients. - Their contract is committed as
api-spec/multi-tenancy-core-internal-v1.jsonand backward-compatibility-gated (theOpenApiRegenITregen gate + theoasdiffbreaking-change gate), the same gates that police the public contract.
Endpoints¶
GET /internal/auth/introspect¶
Forward-auth introspection used by the gateway to validate a presented credential (PAT / session) and return the resolved principal + tenant scope for downstream authorization. Never returns the secret itself. Called by Kong's forward-auth on protected routes.
- Consumer: API gateway (forward-auth).
- Returns: principal identity, tenant scope, validity — a lean introspection response.
- Edge: blocked at the public edge; reachable only on the internal network.
GET /internal/gateway/rate-limits¶
Exports the per-tenant + per-operator rate-limit configuration as YAML for the gateway to load into its rate-limiting plugin. Internal-only; the "operators are always included" policy is applied server-side.
- Consumer: API gateway (rate-limit config sync).
- Produces:
application/yaml. - Edge: blocked at the public edge.
Embedded reference (this site)¶
The committed internal contract, rendered from api-spec/multi-tenancy-core-internal-v1.json:
Discoverability¶
- The
internalspringdoc group is declared inresortwise-services-core/.../infrastructure/config/InternalApiDocsConfig.kt; when the platform is running it is reachable at/v3/api-docs/internaland in the Swagger UI group selector. - This page is the versioned, human-readable reference and is published on the docs site (see architecture.md → docs platform).
- The controllers live under
.../infrastructure/gateway/(IntrospectionController,GatewayRateLimitController).