Skip to content

feat: SSRF guard DNS resolution, webhook encryption, outbox worker, a… - #148

Merged
Busiii-adetiba merged 1 commit into
SynapsVault:mainfrom
kurehkim334-lang:feat/admin-key-webhook-ssrf-encryption-outbox-46-47-48-49
Oct 20, 2026
Merged

Busiii-adetiba merged 1 commit into
SynapsVault:mainfrom
kurehkim334-lang:feat/admin-key-webhook-ssrf-encryption-outbox-46-47-48-49

Conversation

@kurehkim334-lang

Copy link
Copy Markdown
Contributor

…dmin key config (#46 #47 #48 #49)

#49 — ADMIN_API_KEY through config layer

  • Add ADMIN_API_KEY (optional) to envSchema in config.ts
  • adminAuth reads config.ADMIN_API_KEY instead of process.env
  • Log boot warning when key is unset; admin routes return 401
  • Update admin.test.ts to mock config instead of process.env

#47 — Encrypt webhook secrets at rest

  • Add WEBHOOK_ENCRYPTION_KEY (optional) to envSchema; boot warning when unset
  • Add encryptWebhookSecret / decryptWebhookSecret helpers (reuse AES-256-GCM)
  • publishers.ts encrypts secret before storing; decrypts before delivering/testing
  • webhookService.ts resolveTarget() decrypts secret on load
  • Migration 0016: idempotent marker (re-encryption happens at app layer)

#46 — SSRF guard resolves DNS at delivery time

  • Add isPrivateIp() covering IPv4 private/loopback/link-local + IPv6 equivalents
  • Add resolveHostname() wrapping dns.promises.lookup
  • deliver() resolves hostname before each attempt; blocks on private IPs
  • Guards against DNS rebinding: re-resolves on every retry attempt
  • Update webhookService.test.ts: mock node:dns, add SSRF + rebinding tests

#48 — Persistent webhook outbox

  • Add webhook_outbox table to schema + migration 0015
  • Add enqueueWebhookEvent() — writes to outbox before delivery
  • Replace void emitToPublisher() with void enqueueWebhookEvent() in all callers
  • New webhookOutboxWorker.ts: polls pending rows, exponential backoff, marks delivered/failed, survives process restarts
  • Wire worker start/stop into index.ts with the other background workers
  • Add GET /publishers/me/webhooks/deliveries endpoint for delivery history

.gitignore: add *.snap, *.tmp, .bak, npm-debug.log

close #46
close #47
close #48
close #49

…dmin key config (SynapsVault#46 SynapsVault#47 SynapsVault#48 SynapsVault#49)

SynapsVault#49 — ADMIN_API_KEY through config layer
- Add ADMIN_API_KEY (optional) to envSchema in config.ts
- adminAuth reads config.ADMIN_API_KEY instead of process.env
- Log boot warning when key is unset; admin routes return 401
- Update admin.test.ts to mock config instead of process.env

SynapsVault#47 — Encrypt webhook secrets at rest
- Add WEBHOOK_ENCRYPTION_KEY (optional) to envSchema; boot warning when unset
- Add encryptWebhookSecret / decryptWebhookSecret helpers (reuse AES-256-GCM)
- publishers.ts encrypts secret before storing; decrypts before delivering/testing
- webhookService.ts resolveTarget() decrypts secret on load
- Migration 0016: idempotent marker (re-encryption happens at app layer)

SynapsVault#46 — SSRF guard resolves DNS at delivery time
- Add isPrivateIp() covering IPv4 private/loopback/link-local + IPv6 equivalents
- Add resolveHostname() wrapping dns.promises.lookup
- deliver() resolves hostname before each attempt; blocks on private IPs
- Guards against DNS rebinding: re-resolves on every retry attempt
- Update webhookService.test.ts: mock node:dns, add SSRF + rebinding tests

SynapsVault#48 — Persistent webhook outbox
- Add webhook_outbox table to schema + migration 0015
- Add enqueueWebhookEvent() — writes to outbox before delivery
- Replace void emitToPublisher() with void enqueueWebhookEvent() in all callers
- New webhookOutboxWorker.ts: polls pending rows, exponential backoff, marks
  delivered/failed, survives process restarts
- Wire worker start/stop into index.ts with the other background workers
- Add GET /publishers/me/webhooks/deliveries endpoint for delivery history

.gitignore: add *.snap, *.tmp, *.bak, npm-debug.log*
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@kurehkim334-lang is attempting to deploy a commit to the work Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@kurehkim334-lang 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

@Busiii-adetiba
Busiii-adetiba merged commit 777117f into SynapsVault:main Oct 20, 2026
0 of 2 checks 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

2 participants