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
+299
View File
@@ -0,0 +1,299 @@
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-listoffices
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_listoffices
methods:
- GET
- OPTIONS
paths:
- /workforce/v1/offices/
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-createoffice
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_createoffice
methods:
- POST
- OPTIONS
paths:
- /workforce/v1/offices/
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-getoffice
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_getoffice
methods:
- GET
- OPTIONS
paths:
- ~/workforce/v1/offices/(?<officecode>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-updateoffice
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_updateoffice
methods:
- PUT
- OPTIONS
paths:
- ~/workforce/v1/offices/(?<officecode>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-patchoffice
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_patchoffice
methods:
- PATCH
- OPTIONS
paths:
- ~/workforce/v1/offices/(?<officecode>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-deleteoffice
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_deleteoffice
methods:
- DELETE
- OPTIONS
paths:
- ~/workforce/v1/offices/(?<officecode>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-getofficeemployees
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_getofficeemployees
methods:
- GET
- OPTIONS
paths:
- ~/workforce/v1/offices/(?<officecode>[^#?/]+)/employees/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-listemployees
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_listemployees
methods:
- GET
- OPTIONS
paths:
- /workforce/v1/employees/
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-createemployee
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_createemployee
methods:
- POST
- OPTIONS
paths:
- /workforce/v1/employees/
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-getemployee
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_getemployee
methods:
- GET
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-updateemployee
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_updateemployee
methods:
- PUT
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-patchemployee
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_patchemployee
methods:
- PATCH
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-deleteemployee
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_deleteemployee
methods:
- DELETE
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-getemployeereports
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_getemployeereports
methods:
- GET
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/reports/$
strip_path: false
tags:
- workforce
---
apiVersion: configuration.konghq.com/v1alpha1
kind: KongRoute
metadata:
name: ${NAME}-workforce-api-getemployeecustomers
namespace: ${NAMESPACE}
spec:
serviceRef:
type: namespacedRef
namespacedRef:
name: ${NAME}-workforce-api
name: workforce-api_getemployeecustomers
methods:
- GET
- OPTIONS
paths:
- ~/workforce/v1/employees/(?<employeenumber>[^#?/]+)/customers/$
strip_path: false
tags:
- workforce