Skip to content

Secure /access/* management APIs and complete HTTP authz coverage#58

Merged
ScottArbeit merged 4 commits intomainfrom
enhancement/access-endpoint-auth
Jan 19, 2026
Merged

Secure /access/* management APIs and complete HTTP authz coverage#58
ScottArbeit merged 4 commits intomainfrom
enhancement/access-endpoint-auth

Conversation

@ScottArbeit
Copy link
Owner

@ScottArbeit ScottArbeit commented Jan 19, 2026

Secure /access/* endpoints, enforce HTTP authz coverage, add bootstrap + metrics guardrails, and tests

Resolves #57.

Summary

This PR closes the authorization gaps across the HTTP surface and hardens /access/* administration. It introduces full route classification (AllowAnonymous / Authenticated / Authorized), adds scope-aware admin checks for /access mutations and listing, and supports one-time bootstrap seeding for initial SystemAdmin access. It also adds guardrails for /metrics, aligns RepoAdmin with BranchAdmin operations, and expands server tests. Documentation now covers bootstrap + TestAuth dev flow, and a manual /access auth verification script is included.

Key Changes

  • Authorization coverage: Centralized security map in Startup.Server.fs with explicit classification for all routes, SignalR hub, and metrics endpoint.
  • /access enforcement: Admin-at-scope checks for grant/revoke/list assignments; RepoAdmin for path ACL management; scoped introspection for checkPermission.
  • Bootstrap: One-time SystemAdmin seeding at system scope via grace__authz__bootstrap__system_admin_users/groups.
  • Role catalog: RepoAdmin now includes BranchAdmin operations.
  • Metrics: Default auth required, optional anonymous via grace__metrics__allow_anonymous with warning.
  • Tests: Expanded server tests for 401/403 behavior, access scope enforcement, bootstrap seeding, and RoleCatalog alignment.
  • Docs: Updated docs/Authentication.md with bootstrap and TestAuth guidance; added .markdownlint.jsonc and config usage in AGENTS.md.
  • Manual testing: New scripts/TestAccessPathAuth.ps1 to exercise /access/* auth flows under TestAuth.

Manual Testing

  • pwsh scripts/TestAccessPathAuth.ps1
    • Requires GRACE_TESTING=1 and grace__authz__bootstrap__system_admin_users set to the admin user in the script.

Automated Testing

  • dotnet build -c Release src\Grace.sln
  • dotnet test -c Release src\Grace.sln

Notes

  • docs/Authentication.md now assumes markdownlint config via .markdownlint.jsonc (MD013 = 120 chars).
  • This branch was rebased on main and force-pushed.

@ScottArbeit ScottArbeit force-pushed the enhancement/access-endpoint-auth branch from 33cc191 to f2e704e Compare January 19, 2026 08:52
Scott Arbeit added 4 commits January 19, 2026 11:25
- Add .markdownlint.jsonc to set MD013 line length to 120
- Expand AGENTS.md with markdown and documentation guidelines
- Rewrite Authentication.md: clarify auth mechanisms, add quickstart, detailed Auth0 setup, PAT usage, env vars, troubleshooting
- Refactor launchSettings.json: reorder properties, enable TestAuth and admin bootstrap for DebugLocal, clean up comments
@ScottArbeit ScottArbeit force-pushed the enhancement/access-endpoint-auth branch from f2e704e to c510529 Compare January 19, 2026 19:26
@ScottArbeit ScottArbeit merged commit e2687ec into main Jan 19, 2026
3 checks passed
@ScottArbeit ScottArbeit deleted the enhancement/access-endpoint-auth branch January 19, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functional specification: Secure /access/* management APIs and complete HTTP authz coverage

1 participant