Skip to content

feat: add Admin/Viewer RBAC and indexer retry logging - #302

Merged
wagmiiii merged 3 commits into
accensa:mainfrom
nekwasar:feat/stellar-drips-wave-143-156
Aug 31, 2026
Merged

feat: add Admin/Viewer RBAC and indexer retry logging#302
wagmiiii merged 3 commits into
accensa:mainfrom
nekwasar:feat/stellar-drips-wave-143-156

Conversation

@nekwasar

Copy link
Copy Markdown
Contributor

Two Stellar Wave issues for this week:

  • RBAC (User roles (Admin vs Viewer) in the Next.js dashboard #156): session JWT carries a role claim (Admin default / Viewer),
    middleware forwards x-accensa-role, profile/webhook PATCH and refund
    preflight return 403 for viewers, and the dashboard hides the refund panel
    for viewer sessions via a new /api/session endpoint. Legacy sessions
    without a role claim resolve to Admin.
  • Indexer retry (Implement robust retry mechanism for failed contract syncs #143): RPC calls already retried with exponential backoff
    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

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
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@codexhange is attempting to deploy a commit to the ACCENSA Team on Vercel.

A member of the Team first needs to authorize it.

@mergekeeper

mergekeeper Bot commented Aug 31, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #156.
Verdict: clean

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: 94b4b793188ba34155482dd44866aff02e2cebac.
CI and merge eligibility are checked separately.

@mergekeeper

mergekeeper Bot commented Aug 31, 2026

Copy link
Copy Markdown

MergeKeeper merge status

Status: blocked
PR state: open
Mergeability: conflicts / not mergeable
Checked commit: 94b4b793188ba34155482dd44866aff02e2cebac.

Reason: This branch has merge conflicts with the current base branch.

Next steps:

  1. Update this branch with the latest main (rebase or merge main into the branch).
  2. Resolve every conflict locally.
  3. Run the relevant tests, commit the resolution, and push it.
  4. MergeKeeper will automatically re-review the new head commit after the push.

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@mergekeeper

mergekeeper Bot commented Aug 31, 2026

Copy link
Copy Markdown

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 conflicting refunded and role state declarations introduced by conflicting hunks.
  • apps/web/src/dashboard/page.tsx:155: Duplicate reload function definition and state variable reloadToken mismatch.

Reviewed commit: 56107d8a410fbd30fb8347650e96a637f980b25f.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 conflicting refunded and role state declarations introduced by conflicting hunks.
  • apps/web/src/dashboard/page.tsx:155: Duplicate reload function definition and state variable reloadToken mismatch.

Reviewed commit: 56107d8a410fbd30fb8347650e96a637f980b25f.

@wagmiiii
wagmiiii merged commit 2c134b4 into accensa:main Aug 31, 2026
0 of 11 checks passed
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.

User roles (Admin vs Viewer) in the Next.js dashboard Implement robust retry mechanism for failed contract syncs

3 participants