Skip to content

Alternative to #5538: my/routes allowed-route manifest#5556

Merged
ramonsmits merged 1 commit into
add-mypermissions-endpointfrom
spike/my-routes-manifest
Jun 26, 2026
Merged

Alternative to #5538: my/routes allowed-route manifest#5556
ramonsmits merged 1 commit into
add-mypermissions-endpointfrom
spike/my-routes-manifest

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Jun 25, 2026

Copy link
Copy Markdown
Member

Alternative to:

Instead of exposing ServiceControl's internal instance:resource:action permission vocabulary (my/permissions/all + a boolean summary), each instance exposes a single GET /api/my/routes returning the API routes the current token may call, as [{ method, urlTemplate }]. ServicePulse gates its UI on the HTTP routes it already calls, so it never has to learn or hand-maintain the permission grammar — the route is a public contract SP already depends on, so gating on it adds no new coupling.

  • Manifest is generated from the same EndpointDataSource metadata the authorization middleware enforces (no hand-listed routes; can't drift from what's enforced).
  • Per-instance (each process reports only its own routes), per-request resolution, fail-open when auth/RBAC is disabled.
  • Permissions stay internal; an anti-drift guard test asserts every [Authorize(Policy=…)] is a known permission.

Compare #5538 branch vs this branch: add-mypermissions-endpoint...spike/my-routes-manifest

@ramonsmits ramonsmits changed the base branch from add-mypermissions-endpoint to auth June 25, 2026 11:56
@ramonsmits ramonsmits requested a review from dvdstelt June 26, 2026 07:46
@ramonsmits ramonsmits changed the base branch from auth to add-mypermissions-endpoint June 26, 2026 09:13
@ramonsmits ramonsmits marked this pull request as ready for review June 26, 2026 09:13
Alternative to #5538. Instead of leaking internal permission strings to
ServicePulse, expose the concrete set of API routes the caller is allowed to
reach, so the UI gates on a stable route contract rather than coupling to the
permission catalogue.

- Project the ASP.NET EndpointDataSource into a route⇒permission table and
  resolve per-request effective permissions, filtering the manifest to the
  routes the caller can reach.
- Add the my/routes controller (served by every instance), route template
  normalization, and the manifest DTOs.
- Remove the my/permissions endpoint, MeController, PermissionsResponse and
  the root-doc permission fields.
- Add an admin role (read-all + manage config/admin-area resources, no
  message-triage write actions), sitting between reader and writer.
- Acceptance, infrastructure and approval tests for the new surface, plus an
  anti-drift policy guard.
@ramonsmits ramonsmits force-pushed the spike/my-routes-manifest branch from 39c934b to f644e7c Compare June 26, 2026 09:21
@ramonsmits ramonsmits merged commit ecd3e0e into add-mypermissions-endpoint Jun 26, 2026
33 checks passed
@ramonsmits ramonsmits deleted the spike/my-routes-manifest branch June 26, 2026 09:25
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.

2 participants