Skip to content

[Feature] Admin dashboard: auth gate #614

Description

@collinsezedike

Summary

Add an admin-only auth gate in front of a new admin dashboard route: connect a wallet, read the vault contract's get_admin(), and only render the dashboard if the connected wallet's public key matches. Otherwise show a clear blocked state, not a silent redirect.

Screenshots

Connect state:

Image

Blocked state:

Image

Motivation

The vault's admin currently has no UI for operational visibility (keeper health, vault state, recent admin actions), only stellar contract invoke calls or digging through GitHub Actions logs. This is the foundational piece the rest of the dashboard depends on.

Proposed Solution

  • New route, e.g. /admin.
  • On mount: if no wallet connected, show the "Admin access" connect screen (see Screenshots above).
  • On connect: read get_admin() for the vault contract (needs a small off-chain reader added to coordinator.ts, mirroring the existing read-only helpers there) and compare against the connected publicKey.
    • Match: render the dashboard (built in the follow-up issues).
    • Mismatch: show the "Not authorized" blocked screen (see Screenshots above), which shows only the connected wallet's address, not the real admin address, deliberately, so the page doesn't hand out a ready-made phishing target to every unauthorized visitor.
  • Re-check on wallet change/disconnect, matching the pattern useWalletStore's revalidate() already uses elsewhere.

Scope

Field Value
Area Frontend, SDK
Protocol affected None
Network Both
Breaking change? No

Acceptance Criteria

  • /admin renders the connect screen when no wallet is connected
  • /admin renders the blocked screen when the connected wallet doesn't match get_admin(), showing only the connected wallet's address
  • /admin renders the dashboard shell when the connected wallet matches
  • Re-validates on wallet change/disconnect
  • Matches the app's existing dark theme (#0d1117/#161b22 panel colors, border-gray-800, emerald accent), screenshots above show the exact spacing/colors expected

Additional Context

First of three admin-dashboard issues (auth gate, then observability panels, then the admin action history feed). Design reviewed and approved before filing; screenshots above.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendInvolves React components, Tailwind styling, or Next.js pagesmediumRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hourssdkInvolves Blend or DeFindex SDK helpers in packages/stellar-sdk-helpers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions