Skip to content

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 internal springdoc 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 the public-v1 group, 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.json and backward-compatibility-gated (the OpenApiRegenIT regen gate + the oasdiff breaking-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 internal springdoc group is declared in resortwise-services-core/.../infrastructure/config/InternalApiDocsConfig.kt; when the platform is running it is reachable at /v3/api-docs/internal and 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).