feat: add Admin/Viewer RBAC and indexer retry logging - #302
Conversation
Add RBAC to the merchant dashboard session state: the signed session JWT now carries a role claim (Admin by default, Viewer supported), the middleware forwards it as x-accensa-role, and admin-only surfaces are gated both server-side (profile/webhook PATCH, refund preflight return 403 for viewers) and in the UI (refund panel hidden via the new /api/session endpoint). Legacy sessions without a role claim resolve to Admin so existing cookies are never locked out mid-deployment. Closes accensa#156
Emit one structured JSON line per retried Soroban RPC call so transient network blips are visible in logs instead of only surfacing when a run fails outright. Backoff stays exponential (2^attempt * 100ms) and is now capped at 2s; the committed ledger cursor already lets a partial run resume cleanly on the next poll, and the dashboard's 15s poll remains the fallback when the real-time stream drops. Closes accensa#143
|
@codexhange is attempting to deploy a commit to the ACCENSA Team on Vercel. A member of the Team first needs to authorize it. |
|
MergeKeeper review Scope: in scope for linked issue The pull request correctly implements Admin and Viewer RBAC with session state, route guards, and UI updates for #156, and adds structured exponential backoff retry logging for RPC calls for #143. Reviewed commit: |
|
MergeKeeper merge status Status: blocked Reason: This branch has merge conflicts with the current base branch. Next steps:
|
|
@nekwasar Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Needs changes Dashboard page contains syntax/duplication errors from malformed hunk application around state declarations and reload definitions.
Reviewed commit: |
There was a problem hiding this comment.
Needs changes
Dashboard page contains syntax/duplication errors from malformed hunk application around state declarations and reload definitions.
apps/web/src/dashboard/page.tsx:70: Duplicate or conflictingrefundedandrolestate declarations introduced by conflicting hunks.apps/web/src/dashboard/page.tsx:155: Duplicatereloadfunction definition and state variablereloadTokenmismatch.
Reviewed commit: 56107d8a410fbd30fb8347650e96a637f980b25f.
Two Stellar Wave issues for this week:
middleware forwards
x-accensa-role, profile/webhook PATCH and refundpreflight return 403 for viewers, and the dashboard hides the refund panel
for viewer sessions via a new
/api/sessionendpoint. Legacy sessionswithout a role claim resolve to Admin.
and the ledger cursor is persisted; this adds structured retry logging so
transient RPC failures are visible, caps backoff at 2s, and documents the
15s dashboard poll as the fallback when the real-time stream drops.
Closes #156
Closes #143