Skip to content

feat: integrate rate limit store, upgrade WebhookTester, API key creation flow, and settings security validation - #419

Merged
therealjhay merged 5 commits into
Betta-Pay:mainfrom
OlolaJaco:main
Jul 28, 2026
Merged

feat: integrate rate limit store, upgrade WebhookTester, API key creation flow, and settings security validation #419
therealjhay merged 5 commits into
Betta-Pay:mainfrom
OlolaJaco:main

Conversation

@OlolaJaco

Copy link
Copy Markdown
Contributor

Description

This PR resolves several key issues across the Developer tools and Merchant Settings sections:                                                                                       
                                                                                                                                                                                     
1. **Rate Limit Store Integration & Display (Closes #323)**:                                                                                                                         
   - Updated `useRateLimitStore` (`lib/store/rateLimitStore.ts`) to track the rate-limited endpoint URL and rate limit policy (max requests allowed per window).                     
   - Updated the `axios` response interceptor (`lib/api/axios.ts`) to capture 429 rate limit details (`retry-after` header, endpoint URL, `X-RateLimit-Limit`) and update            

useRateLimitStore.
- Connected RateLimitDisplay (components/developers/RateLimitDisplay.tsx) to subscribe to useRateLimitStore.
- Displays an active HTTP 429 banner featuring:
- Countdown timer with remaining seconds (formatted as HH:MM:SS and Xs remaining), driven by the store's tick() function.
- Rate-limited endpoint URL.
- Rate limit policy (max requests per window).
- Added unit tests in RateLimitDisplay.test.tsx validating 429 state display and timer countdown logic.

2. **Authenticated Webhook Tester (Closes #322)**:                                                                                                                                   
   - Upgraded `WebhookTester` (`components/developers/WebhookTester.tsx`) to send real HTTP requests via `apiClient`.                                                                
   - Added options to configure custom webhook target endpoints, custom headers, and custom JSON payload structures.                                                                 
   - Integrated webhook HMAC signature headers (`X-Webhook-Signature`) and payload delivery status reporting.                                                                        
   - Added unit tests in `WebhookTester.test.tsx`.                                                                                                                                   
                                                                                                                                                                                     
3. **Secure API Key Generation Flow (Closes #321)**:                                                                                                                                 
   - Implemented real API key creation in `app/(merchant)/developers/page.tsx` posting to `/api/keys`.                                                                               
   - Added a "Save Your API Key" modal displaying the full secret API key once upon creation with explicit copy functionality and security warnings.                                 
   - Added unit tests in `page.test.tsx` verifying key creation and success dialog interactions.                                                                                     
                                                                                                                                                                                     
4. **Settings Page Security & Password Validation(Closes #320 )**:                                                                                                                                 
   - Added client-side password validation logic (current password, new password complexity criteria, and password confirmation matching) in `app/(merchant)/settings/page.tsx`.     
   - Added comprehensive unit tests in `securityValidation.test.tsx`.                                                                                                                
                                                                                                                                                                                     
---                                                                                                                                                                                  
                                                                                                                                                                                     
## Issues Closed                                                                                                                                                                     

- Closes #323
- Closes #322
- Closes #321
- Closes #320 

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@OlolaJaco is attempting to deploy a commit to the therealjhay's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

@therealjhay
therealjhay merged commit 5ef1100 into Betta-Pay:main Jul 28, 2026
1 check failed
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.

2 participants