Gateway Overview
The Gateway module connects your registered API specs to Kong, generating configuration and collecting traffic logs.
What it does
- Spec-driven config: Declare routes, upstreams, and plugins in a
gateway.config.yamlfile. The CLI validates every route against the registered spec when you push. If the route doesn't exist in the spec, the push is blocked. - Provisioning via decK: The
grapity gateway provisioncommand fetches a stored config from the registry, generates decK-compatible YAML, and runsdeck gateway diff(orsyncwith--sync) against your Kong instance. - Log ingestion: Kong pushes access logs to the registry via the
http-logplugin. The registry normalizes payloads, resolves caller identity from configurable rules, and stores structured gateway logs for querying and analysis. - Versioned configs: Every push creates a new version of the gateway config. The registry keeps the latest 5 versions, so you can diff or roll back.
External dependencies
The Registry stores and validates gateway configs, but the runtime is outside Grapity:
- decK must be installed and on
PATHforgrapity gateway provision. - Kong must be running and reachable at the
kongAddrdeclared in each environment. - The Kong
http-logplugin must be configured to POST to/v1/gateway-logs/ingest/:provider/:environment. - When the Registry uses Keycloak auth, log ingestion requires a bearer token. The Kong
http-logplugin must send anAuthorizationheader with a token that has thegateway-logs:writescope. The operator is responsible for obtaining and rotating that token. Grapity does not manage it.
Grapity does not start or manage decK, Kong, or Keycloak.
How it works
OAS spec (in registry)
|
gateway.config.yaml --> grapity gateway push --> stored in registry
|
grapity gateway provision --> decK YAML --> Kong
|
http-log plugin --> registry log ingest --> queryable logsGetting started
- Register a spec with
grapity registry push - Write a
gateway.config.yamlthat references the spec - Run
grapity gateway push payments-gateway.config.yamlto store it in the registry - Run
grapity gateway provision --name payments-gateway --env staging --syncto apply to Kong - Configure the
http-logplugin to POST logs to the registry
Supported plugins
Kong plugins can be declared directly in gateway.config.yaml. Verified plugins include rate-limiting, jwt, request-transformer, response-transformer, openid-connect, request-validator, and http-log. See the architecture doc for YAML examples of each.
Log querying
Once logs are flowing, use grapity gateway logs <config> to query traffic from the command line, or call the registry REST API directly at GET /v1/gateway-logs.
See also
- CLI Reference: grapity gateway — Manage gateway configs and logs
- grapity serve — Start the Registry and Hub
- Registry Overview — How specs are stored and validated