PR M: API-key role binding (req.actorRole) #17
Reference in New Issue
Block a user
Delete Branch "devin/1776881763-pr-m-role-binding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes gap-analysis v2 §7.7.
What
API_KEYSentries now acceptkey:role(back-compat: bare keys default tooperator). Known roles come fromActorRoleintransactionState.ts(coordinator / approver / releaser / validator / exception_manager / operator).apiKeyAuth+optionalApiKeyAuthinjectreq.actorRolealongsidereq.apiKey, so SoD enforcement in the state machine can consult the authenticated role directly.requireRole(...roles)guard for per-route role gating.operator. Cache auto-invalidates whenAPI_KEYSchanges.Why
The middleware previously only validated that a key was present and registered — it never attached a role to the request, so the SoD layer in the state machine had to fall back on user-agent heuristics. Binding the role at the authentication layer closes that hole.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.