Build workforce-api REST + MCP layers (Layer 3), full build in one pass

16 routes: Office (single key, full CRUD + employees sub-resource)
and Employee (single key, full CRUD + reports + customers
sub-resources). MCP layer built with the single-route pattern from
the start.

Only domain where customer role has zero access — verified against
ReferenceDataPermission.check(): read_only/product_manager/support
get reads, writes are admin-only, customer isn't in the allow-list
at all. All 9 MCP tool ACLs reflect this exactly.

Keycloak (local): workforce-api-audience + mcp-workforce-audience
client scopes, resource clients, broker/librechat attachments.
Deploy key and broker secret reused/mirrored, same pattern as every
domain since payments-api.
This commit is contained in:
Stéphane Tailland
2026-08-23 17:13:45 +02:00
parent 7430a88563
commit 2880e21ef1
28 changed files with 1609 additions and 11 deletions
+25
View File
@@ -0,0 +1,25 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: workforce-api-git-auth
namespace: workforce
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-kong-v2
target:
name: workforce-api-git-auth
data:
- secretKey: identity
remoteRef:
key: kong-v2/workforce-api/git-deploy-key
property: identity
- secretKey: identity.pub
remoteRef:
key: kong-v2/workforce-api/git-deploy-key
property: identity.pub
- secretKey: known_hosts
remoteRef:
key: kong-v2/workforce-api/git-deploy-key
property: known_hosts
+32
View File
@@ -0,0 +1,32 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: workforce-dev-api
namespace: workforce
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: workforce-api-dev
path: ./kong
prune: true
dependsOn:
- name: workforce-dev-api-gateway
namespace: flux-system
postBuild:
substitute:
NAME: workforce-dev
NAMESPACE: workforce
CONTROL_PLANE_REF_NAME: workforce-dev-6cq27
BACKEND_HOST: classic-models-api.classic-models.svc.cluster.local
OIDC_ISSUER: https://keycloak.sttlab.local/realms/classic-models
API_AUDIENCE: '["workforce-api"]'
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: workforce-dev.sttlab.local
TOKEN_EXCHANGE_CLIENT_ID: kong-token-exchange-broker
substituteFrom:
- kind: Secret
name: workforce-token-exchange-broker
+12
View File
@@ -0,0 +1,12 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: workforce-api-dev
namespace: workforce
spec:
interval: 5m
url: ssh://git@gitea.sttlab.eu:2222/stt/kong-workforce-api.git
secretRef:
name: workforce-api-git-auth
ref:
branch: main
@@ -0,0 +1,17 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: workforce-token-exchange-broker
namespace: workforce
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-kong-v2
target:
name: workforce-token-exchange-broker
data:
- secretKey: TOKEN_EXCHANGE_CLIENT_SECRET
remoteRef:
key: kong-v2/workforce-api/token-exchange-broker
property: client_secret