feat: MSW frontend testing, Stellar Horizon webhook verification, AWS KMS signer, and onboarding CLI - #1208
Open
kokobutter-web wants to merge 1 commit into
Conversation
…nboarding CLI - Configure MSW handlers and Vitest setup for frontend component unit testing (StellarDevHub#1206) - Implement Stellar Horizon HMAC-SHA256 webhook signature verification with 5-min timestamp window and idempotency (StellarDevHub#1192) - Integrate AWS KMS key signer wrapper for platform master keys with local software fallback (StellarDevHub#1193) - Build 1-command contributor environment onboarding CLI via npm run setup (StellarDevHub#1207)
|
Someone is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@kokobutter-web 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
This Pull Request resolves four core issues in the repository:
npm run setup) #1207)Detailed Changes Made
1. Deploy Mock Service Worker (MSW) for Frontend Testing (Closes #1206)
frontend/src/mocks/handlers.tsfor authentication (/api/auth/*), courses (/api/courses/*), and certificates (/api/certificates/*).setupServerinfrontend/src/test/setup.tswithbeforeAll,afterEach, andafterAllserver lifecycles.frontend/src/components/__tests__/MswComponentTesting.test.tsxcovering loading, error (500), empty data, and success states.2. Stellar Horizon Webhook Signature Verification (Closes #1192)
verifyStellarWebhookSignatureinbackend/src/services/webhooks/stellarWebhook.service.tsvalidating incomingX-Stellar-Signatureheaders via HMAC-SHA256 with timing-safe comparison.X-Stellar-Timestamp) to automatically reject replay attacks.txHash) to prevent double-crediting balances.POST /api/webhooks/stellarreturning 401 Unauthorized on forged signatures/expired timestamps and verified via Jest suite inbackend/tests/stellar-webhook.test.ts.3. AWS KMS Key Signer Wrapper (Closes #1193)
KmsStellarSignerinbackend/src/blockchain/kmsSigner.tsrouting transaction signing requests through AWS KMSkms:SignAPI with zero local private key storage in KMS mode.NODE_ENV === 'development' || NODE_ENV === 'test').getKmsIamPolicy()helper for least-privilege IAM configuration.backend/tests/kms-signer.test.ts.4. 1-Command Contributor Environment Onboarding CLI (Closes #1207)
"setup": "bash scripts/setup.sh"to rootpackage.json.scripts/setup.shwith automated prerequisite checks for Node.js, Rust, Cargo, Docker, and Stellar CLI with terminal installation guidance for missing toolchains.Verification & Testing Passed
pnpm test src/components/__tests__/MswComponentTesting.test.tsx(7/7 tests passed).npx jest tests/stellar-webhook.test.ts tests/kms-signer.test.ts(7/7 tests passed).bash scripts/setup.shruns end-to-end diagnostics and environment configuration clean.Closes #1206
Closes #1192
Closes #1193
Closes #1207