Skip to content

Feat/be self service#406

Merged
Cedarich merged 2 commits intoPulsefy:mainfrom
zhero-o:feat/be-self-service
Apr 29, 2026
Merged

Feat/be self service#406
Cedarich merged 2 commits intoPulsefy:mainfrom
zhero-o:feat/be-self-service

Conversation

@zhero-o
Copy link
Copy Markdown
Contributor

@zhero-o zhero-o commented Apr 29, 2026

Summary

  • Adds GET /developer/ping for connectivity checks
  • Adds POST /developer/webhooks/:webhookId/test to send a test event to a webhook receiver
  • Adds POST /developer/keys/bulk-revoke for bulk key revocation (up to 100 keys)
  • Adds POST /developer/keys/:id/emergency-rotate for instant key rotation with no grace period
  • Adds GET /developer/health?owner_id= for a per-org integration health score (0–100, A–F grade)
  • All self-service actions are audit-logged via AuditService

Test plan

  • GET /developer/ping returns { status: "ok" }
  • POST /developer/webhooks/:id/test returns success: true for a reachable receiver
  • POST /developer/keys/bulk-revoke revokes listed keys; partial failures reported per-key
  • POST /developer/keys/:id/emergency-rotate issues a new key; old key rejected immediately
  • GET /developer/health?owner_id=<id> returns score and grade
  • All 18 unit tests pass (npm run test:unit)

Closes #396

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@zhero-o 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

zhero-o added 2 commits April 29, 2026 08:22
Implements the Developer Self-Service API providing five endpoints under
/developer that enable developers to test webhook receivers, bulk-revoke
or emergency-rotate API keys, and get a per-org integration health score.

- GET  /developer/ping β€” connectivity check, no auth required
- POST /developer/webhooks/:webhookId/test β€” sends a signed synthetic
  payment.received event to the webhook URL; returns latency and HTTP status
- POST /developer/keys/bulk-revoke β€” revokes up to 100 keys via
  Promise.allSettled; partial failures reported per-key
- POST /developer/keys/:id/emergency-rotate β€” rotates a key and clears
  key_hash_old immediately (no 24-hour grace window)
- GET  /developer/health?owner_id= β€” composite 0–100 health score (A–F
  grade) derived from webhook failure rate (60 pts) and quota utilisation
  (40 pts); all calls audited via AuditService

Supporting changes:
- ApiKeysRepository.emergencyUpdateKey() clears key_hash_old on update
- ApiKeysService.emergencyRotate() delegates to the new repo method
- DeveloperModule registered inside the existing !isLocalSupabase block
- Swagger tag "developer" added to main.ts DocumentBuilder
- 18 unit tests covering all service methods and edge cases
@zhero-o zhero-o force-pushed the feat/be-self-service branch from 4bf47bb to c4b7db4 Compare April 29, 2026 08:23
@Cedarich Cedarich merged commit 7be9d46 into Pulsefy:main Apr 29, 2026
1 check passed
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.

Developer Self-Service API (Ops & Health)

2 participants