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
+149
View File
@@ -0,0 +1,149 @@
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-listoffices
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-createoffice
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-getoffice
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/$(uri_captures.officecode)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-updateoffice
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/$(uri_captures.officecode)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-patchoffice
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/$(uri_captures.officecode)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-deleteoffice
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/$(uri_captures.officecode)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-getofficeemployees
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/offices/$(uri_captures.officecode)/employees/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-listemployees
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-createemployee
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-getemployee
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-updateemployee
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-patchemployee
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-deleteemployee
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-getemployeereports
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/reports/
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: ${NAME}-workforce-api-rewrite-getemployeecustomers
namespace: ${NAMESPACE}
plugin: request-transformer-advanced
config:
replace:
uri: /classic-models/api/v1/employees/$(uri_captures.employeenumber)/customers/