Manage per-user application access #6

Merged
exler merged 1 commit from camila/per-user-app-access into main 2026-10-18 07:26:28 +02:00
Collaborator

Summary

  • Explicit per-user application allowlists editable at account creation (invite or initial password) and later on a user access page. Empty selection grants nothing.
  • Administrators, including CLI admins, may use every current and future app. Grants are independent of roles and sign-in history.
  • One-time migration preserves existing non-admin access to currently registered apps; future apps/users default deny.
  • Branded HTTP 403: “You do not have access to this application.” Authorization-code exchange and userinfo also recheck access.
  • User/grant changes are transactional. Token issuance serializes permission validation and token DB writes with revocation. Auth codes remain single-use, including failed exchanges.
  • Add PR test execution with Go race detector; container publishing remains push-only.

Verification

  • Parent independently reran go test -count=1 ./..., go vet ./..., sqlc diff (v1.31.1), git diff --check: all pass.
  • Tests cover migration/backfill vs future apps/users, admin bypass/CLI, create/edit/revoke, validation/CSRF/nonadmin checks, rollback after partial grant insertion failure, OIDC denied/no code, outstanding code/token revocation, deterministic token/revocation serialization with real SQLite/handlers.
  • Test-first and mutation evidence: disabling each OIDC access guard fails tests; racing revocation reproduced successful token issuance before transaction fix and passes afterward.
  • Browser QA with synthetic loopback-only accounts/DB: create user, update apps, denied third application (403). Screenshots attached below.
  • Local go test -race cannot start on this Raspberry Pi kernel (ThreadSanitizer unsupported VMA range, 47 vs48). Remote x86_64 CI run 619 passed go vet and go test -race ./...; image publishing correctly skipped for PR.

Operational behavior

No production deployment. Migration preserves existing nonadmins’ current apps as requested. New apps require explicit grants (except admins). Revocation prevents new IDP authorizations/token exchanges and userinfo access, but cannot terminate an app’s already-established session or recall offline-validated ID tokens; no refresh-token flow exists. Go dependencies unchanged.

Visual verification (local synthetic fixture)

create-user-form.png
user-access-editor-saved.png
access-denied.png

## Summary - Explicit per-user application allowlists editable at account creation (invite or initial password) and later on a user access page. Empty selection grants nothing. - Administrators, including CLI admins, may use every current and future app. Grants are independent of roles and sign-in history. - One-time migration preserves existing non-admin access to currently registered apps; future apps/users default deny. - Branded HTTP 403: “You do not have access to this application.” Authorization-code exchange and userinfo also recheck access. - User/grant changes are transactional. Token issuance serializes permission validation and token DB writes with revocation. Auth codes remain single-use, including failed exchanges. - Add PR test execution with Go race detector; container publishing remains push-only. ## Verification - Parent independently reran go test -count=1 ./..., go vet ./..., sqlc diff (v1.31.1), git diff --check: all pass. - Tests cover migration/backfill vs future apps/users, admin bypass/CLI, create/edit/revoke, validation/CSRF/nonadmin checks, rollback after partial grant insertion failure, OIDC denied/no code, outstanding code/token revocation, deterministic token/revocation serialization with real SQLite/handlers. - Test-first and mutation evidence: disabling each OIDC access guard fails tests; racing revocation reproduced successful token issuance before transaction fix and passes afterward. - Browser QA with synthetic loopback-only accounts/DB: create user, update apps, denied third application (403). Screenshots attached below. - Local go test -race cannot start on this Raspberry Pi kernel (ThreadSanitizer unsupported VMA range, 47 vs48). Remote x86_64 CI run 619 passed go vet and go test -race ./...; image publishing correctly skipped for PR. ## Operational behavior No production deployment. Migration preserves existing nonadmins’ current apps as requested. New apps require explicit grants (except admins). Revocation prevents new IDP authorizations/token exchanges and userinfo access, but cannot terminate an app’s already-established session or recall offline-validated ID tokens; no refresh-token flow exists. Go dependencies unchanged. ## Visual verification (local synthetic fixture) ![create-user-form.png](https://git.marut.network/attachments/90c13e16-9256-462b-904a-ac3fdf7386d0) ![user-access-editor-saved.png](https://git.marut.network/attachments/0d1cb71c-e1c5-4795-a843-f7e8e56754ab) ![access-denied.png](https://git.marut.network/attachments/606fd012-b4b4-447c-9486-5ed36d0028ee)
Control application access per user with transactional OIDC checks
All checks were successful
Push Docker Image / test (pull_request) Successful in 58s
Push Docker Image / push (pull_request) Has been skipped
Push Docker Image / test (push) Successful in 58s
Push Docker Image / push (push) Successful in 50s
3551ebd330
exler merged commit 3551ebd330 into main 2026-10-18 07:26:28 +02:00
exler deleted branch camila/per-user-app-access 2026-10-18 07:26:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/thermopylae!6
No description provided.