You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds an explicit user-role registry backed by the control-plane SQLite
database. Tailscale provides identity; Axon now owns authorisation.
Role resolution priority:
1. Axon user-role registry (login → role, overrides everything)
2. Tailscale ACL tag mapping (tag:axon-admin/write/read)
3. --tailscale-default-role fallback
Changes:
- user_roles.rs: new UserRoleStore (Arc<RwLock<HashMap>>) with
write-through SQLite persistence and full unit tests
- control_plane.rs: migrate_user_roles() in schema migration; wrapper
methods list/set/remove_user_role()
- auth.rs: AuthContext gains user_roles field; resolve_peer checks
registry before tag-based fallback; with_user_roles() builder;
two new tests for registry override behaviour
- control_plane_routes.rs: ControlPlaneState gains UserRoleStore;
GET /control/users, PUT /control/users/{login},
DELETE /control/users/{login} endpoints; 5 new HTTP tests
- serve.rs: loads user roles from DB at startup, shares store with
both AuthContext and ControlPlaneState
- axon-cli: `axon user grant/revoke/list` — HTTP client mode calls
REST API; embedded mode opens control-plane SQLite directly
- axon-config: control_plane_sqlite_path() helper
- gateway.rs / service.rs: update actor assertions to user_login
(identity_from_tailscale already returned login; tests were stale)
Spec: FEAT-012-authorization.md updated with US-048 and V4 status row.
Verification: cargo check --workspace, cargo test --workspace (254 lib
tests pass; 1 pre-existing api_contract failure unrelated)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments