Skip to content

Access request workflow UI (still v0.13.0)#111

Merged
rbardaji merged 3 commits intomainfrom
feature/110-access-requests-ui
Apr 23, 2026
Merged

Access request workflow UI (still v0.13.0)#111
rbardaji merged 3 commits intomainfrom
feature/110-access-requests-ui

Conversation

@rbardaji
Copy link
Copy Markdown
Collaborator

Summary

  • Add the UI layer on top of the backend shipped in Access request workflow backend (v0.13.0) #109 so the access-request workflow is usable end-to-end from the browser.
  • Denied users (AuthGuard 403) now see a "Request access to this Endpoint" button with an optional justification. The bearer token is held in the page only for this single call and never persisted to localStorage, so an unauthorized user is never considered signed in. On success the screen replaces the error with a confirmation panel.
  • A new "Access Requests" admin page (route /access-requests) lists pending, approved and rejected requests in three tabs. Administrators can approve a pending request with a member or admin grant (plus optional notes) or reject it (plus optional notes). Errors coming back from the AAI grant on approve (403 insufficient privileges, 404, 502) are surfaced inline.
  • A new nav entry "Access Requests" appears only for users whose /user/info payload contains either ndp_admin or an endpoint-scoped admin role. Everyone else never sees the link.
  • Version stays at 0.13.0 — this PR is grouped into the same release as Access request workflow backend (v0.13.0) #109. No version bump, no Docker push yet.

Closes #110

Test plan

  • Full backend test suite still passes (1101 tests)
  • black --check --diff . passes
  • flake8 api/ tests/ --max-line-length=88 --extend-ignore=E203,W503,E501,F401 passes
  • UI build succeeds inside the multi-stage Dockerfile
  • Manual end-to-end check in the browser (user submits a request after 403, administrator approves as member, user re-logs and enters the app) — to be done by the reviewer before releasing 0.13.0.

Notes

Raul Bardaji added 3 commits April 23, 2026 13:30
When a user logs in successfully against the IDP but the Endpoint denies
entry, the AuthGuard now holds the raw token in component state (never
in localStorage) and offers a 'Request access' button below the 403
message. Clicking it opens a small form with an optional justification;
submitting calls POST /user/access-requests with the held token through
a bare axios client and shows a success panel that tells the user an
administrator will review the request.

Duplicate requests (409), feature-disabled deployments (503) and
session-invalid errors (401/403) are translated into actionable
messages inline rather than surfaced as generic failures.

The reciprocal token- and credentials-based login forms are hidden
while the success panel is shown so the user is not invited to try
again while a pending request already exists.

Both authAPI.setAndValidateToken and authAPI.login now attach a
deniedToken property to the Error they raise on 403, letting the
AuthGuard recover the token without asking the user to re-enter it.

Refs #110
Introduce a new admin-only page that lists access requests and lets the
administrator approve or reject each pending one from the browser.

- pages/AccessRequests.js: three-tab view (Pending, Approved, Rejected)
  backed by the backend list endpoint. For each pending row the admin
  can open an inline panel to either approve (choosing member or admin
  grant, with optional notes) or reject (with optional notes). Approved
  and rejected rows display decider, timestamp, grant and notes.
  Backend errors (403 non-admin, 503 disabled, AAI 4xx/502 on approve)
  are surfaced inline rather than swallowed.
- App.js: register the /access-requests route.
- components/Navigation.js: fetch /user/info on mount and show the new
  Access Requests link only when the user holds either ndp_admin or
  the endpoint-scoped {UUID}_admin role. A non-admin never sees the
  link in the top nav.

Refs #110
@rbardaji rbardaji merged commit 3e324e7 into main Apr 23, 2026
1 check passed
@rbardaji rbardaji deleted the feature/110-access-requests-ui branch April 23, 2026 19:43
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.

UI for the access-request workflow

1 participant