feat: admin wallet allowlist guard - #110
Merged
EmeditWeb merged 1 commit intoJul 27, 2026
Merged
Conversation
- Add ADMIN_WALLETS env var with comma-separated Stellar addresses - Validate entries at startup (fail-fast on invalid addresses) - Create AdminGuard that checks wallet against allowlist - Apply AdminGuard to audit controller (GET /admin/audit-logs) - Empty/unset ADMIN_WALLETS denies all admin access by design - Generic 403 response does not leak allowlist contents - Add unit tests (8 tests) for all guard scenarios - Audit all controllers: no other endpoints require admin protection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Close #97
Adds an admin access control system based on a Stellar wallet allowlist. Any wallet that completes the normal nonce-and-signature flow currently has access to the full admin audit log via GET /admin/audit-logs. This PR gates all admin endpoints behind an AdminGuard that checks the authenticated wallet against a configurable allowlist.
Closes the admin access control gap identified in the codebase.
Changes
eq.user\ and checks membership in the allowlist.
Design Decisions
Controller Audit
Audited all 16 controllers for endpoints assuming administrator access without enforcement:
No other controllers have endpoints that assume administrator access. Vendor approval, protocol pause, and parameter governance (mentioned in the issue) do not yet exist as endpoints — this PR establishes the admin guard infrastructure for when they are built.
Testing
pm run build\ — zero TypeScript errors
pm run lint\ — zero lint errors
pm test\ — 325/325 tests pass (29 suites), no test count decrease
Acceptance Criteria
Files Changed