feat(admin): add issuer management endpoints#223
Merged
dev-fatima-24 merged 2 commits intoMay 5, 2026
Merged
Conversation
- POST /admin/issuers — add issuer via add_issuer contract call - DELETE /admin/issuers/:address — revoke issuer via revoke_issuer - GET /admin/issuers — list authorized issuers via list_issuers simulation - Introduce 'admin' JWT role (separate from 'issuer' and 'patient') - Admin public key now receives 'admin' role on SEP-10 login - All three endpoints require admin JWT; 403 for any other role - Audit log entries on add/revoke actions - 13 tests covering auth, validation, and happy paths Closes dev-fatima-24#34
|
@mathewsap45 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! 🚀 |
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
Closes #34
Implements the three admin endpoints for issuer management that invoke the existing
add_issuerandrevoke_issuerSoroban contract functions.Changes
backend/src/routes/admin.js— Added three new endpoints:POST /admin/issuers— authorizes a new issuer viaadd_issuercontract call (admin JWT required)DELETE /admin/issuers/:address— revokes an issuer viarevoke_issuercontract call (admin JWT required)GET /admin/issuers— lists all authorized issuers by reading contract stateadminOnlymiddleware to checkrole === 'admin'instead ofrole === 'issuer'backend/src/middleware/auth.js— Added'admin'as a valid JWT role alongside'patient'and'issuer'backend/src/routes/auth.js— Admin JWT is issued whenADMIN_PUBLIC_KEYmatches the authenticated walletbackend/tests/admin-issuers.test.js— Unit tests for all three endpointsAcceptance Criteria
POST /admin/issuers— add an issuer (admin JWT required)DELETE /admin/issuers/:address— revoke an issuer (admin JWT required)GET /admin/issuers— list all authorized issuersTesting