Backend Security and RBAC¶
Authentication Flow¶
Primary backend auth filter:
JwtAuthenticationAuthorizationFilter
Behavior:
- If
enable.authis disabled, requests pass with a non-authenticated context - If enabled, non-
PermitAllendpoints requireAuthorization: Bearer <token> - Token is verified and mapped to
UserSecurityContext - Missing/invalid token results in
401
Authorization Enforcement¶
Authorization is annotation-driven:
@RolesAllowedon resource classes/methods- Runtime enforcement by
RolesAllowedDynamicFeature
Role constants are defined in utils/Roles.java:
system_adminadministratordevice_rolefield_roledata_roleinventory_rolecustom_official_rolemanager_role*(ALL_ROLES)
Role Coverage Snapshot (Code-Generated)¶
From governance RBAC artifacts (governance-data.json, endpoint-role occurrences):
| Role | Endpoint Occurrences |
|---|---|
ADMINISTRATOR |
122 |
CUSTOM_OFFICIAL |
67 |
MANAGER |
47 |
INVENTORY |
37 |
SYSTEM_ADMIN |
32 |
FIELD_OFFICIAL |
31 |
DEVICE |
28 |
ALL_ROLES |
11 |
DATA |
6 |
Frontend Role Gate Mapping¶
Portal route wrappers in Navigation.jsx check roles such as:
ects_view_cargoects_view_journeyects_view_routeects_view_inventoryects_view_deviceects_view_alertsects_view_reports- corresponding
ects_edit_*roles
This means practical access control is two-layered:
- Frontend route/menu visibility based on role claims
- Backend API-level
@RolesAllowedenforcement
Security Engineering Checklist¶
- Keep
enable.auth=truefor non-local environments - Validate OpenID/keycloak config values before deployment
- Ensure every new endpoint has explicit role requirements
- Align frontend role strings with backend role-to-capability model
- Audit for any
ALL_ROLESusage and narrow when possible