Build customers-api REST layer (Layer 3), mirroring catalog-api

8 routes over Customer + orders/payments sub-resources, proxying to
classic-models-api. openid-connect with RFC 8693 token exchange to
classic-models-api audience, rate-limiting, proxy-cache, audit-log —
same plugin set and structure as catalog-api's REST surface.

Not deployed: dev/gitrepository.yaml points at a gitea repo that
doesn't exist yet (kong-customers-api.git, 404). No MCP layer yet
either, unlike catalog-api.
This commit is contained in:
Stéphane Tailland
2026-08-23 14:34:47 +02:00
parent 7ab1cbb569
commit 66565367f1
17 changed files with 775 additions and 9 deletions
+25
View File
@@ -0,0 +1,25 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: customers-api-git-auth
namespace: customers
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-kong-v2
target:
name: customers-api-git-auth
data:
- secretKey: identity
remoteRef:
key: kong-v2/customers-api/git-deploy-key
property: identity
- secretKey: identity.pub
remoteRef:
key: kong-v2/customers-api/git-deploy-key
property: identity.pub
- secretKey: known_hosts
remoteRef:
key: kong-v2/customers-api/git-deploy-key
property: known_hosts
+37
View File
@@ -0,0 +1,37 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: customers-dev-api
namespace: customers
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: customers-api-dev
path: ./kong
prune: true
dependsOn:
- name: customers-dev-api-gateway
namespace: flux-system
postBuild:
substitute:
NAME: customers-dev
NAMESPACE: customers
CONTROL_PLANE_REF_NAME: customers-dev-tw8tn
BACKEND_HOST: classic-models-api.classic-models.svc.cluster.local
OIDC_ISSUER: https://keycloak.sttlab.local/realms/classic-models
API_AUDIENCE: '["customers-api"]'
# Unused today — same dead variable already present in catalog-api's
# flux-kustomization.yaml (no file under kong/rest/ or kong/mcp/
# actually reads API_SCOPES_REQUIRED). Kept for parity; fix in both
# places together if this ever gets wired up for real.
API_SCOPES_REQUIRED: '["customers:read"]'
BACKEND_AUDIENCE: '["classic-models-api"]'
BACKEND_SCOPES: '[]'
API_RATE_LIMIT_MINUTE: "60"
AUDIT_LOG_ENDPOINT: http://audit-log-collector.observability.svc.cluster.local/logs
REST_HOSTNAME: customers-dev.sttlab.local
TOKEN_EXCHANGE_CLIENT_ID: kong-token-exchange-broker
substituteFrom:
- kind: Secret
name: customers-token-exchange-broker
+12
View File
@@ -0,0 +1,12 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: customers-api-dev
namespace: customers
spec:
interval: 5m
url: ssh://git@gitea.sttlab.eu:2222/stt/kong-customers-api.git
secretRef:
name: customers-api-git-auth
ref:
branch: main
@@ -0,0 +1,17 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: customers-token-exchange-broker
namespace: customers
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-kong-v2
target:
name: customers-token-exchange-broker
data:
- secretKey: TOKEN_EXCHANGE_CLIENT_SECRET
remoteRef:
key: kong-v2/customers-api/token-exchange-broker
property: client_secret