fix(privacy): NODE_ENV-guard 4 debug-routes (before-launch privacy review)
Privacy/PII review-pass van Server Actions, API-routes, debug-paths en Sentry config: ✅ Sentry sendDefaultPii: false in alle drie configs (server/edge/client) ✅ Geen wachtwoord/email/token in console-logs ✅ Pair-id-logs zijn metadata-only (5-min TTL, geen secret) ⚠️ Vier debug-routes hadden geen auth-guard: - /api/debug/realtime-stream — rauwe pg_notify-stream zonder filtering - /api/debug/emit-test-notify — anonieme test-emit op het kanaal - /debug-env — lekt env-var-metadata (hostnames, lengtes, pooled-flag) - /debug-realtime — UI op dezelfde rauwe pg_notify-stream Allemaal gemarkeerd als TIJDELIJK met VERWIJDEREN-comments uit M8. Voor v1 launch: NODE_ENV-guard die in productie 404 retourneert. Lokaal dev blijft alles werken voor debugging. Toekomstige cleanup: kunnen worden verwijderd zodra M8-realtime stabiel draait in productie en niemand ze meer nodig heeft. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
95eff4087c
commit
0f40bc1c70
4 changed files with 18 additions and 0 deletions
|
|
@ -12,6 +12,11 @@ export const dynamic = 'force-dynamic'
|
|||
const CHANNEL = 'scrum4me_changes'
|
||||
|
||||
export async function POST(request: Request) {
|
||||
// Productie-guard: anonieme test-emit op pg_notify is niet voor productie.
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return new Response('Not found', { status: 404 })
|
||||
}
|
||||
|
||||
const directUrl = process.env.DIRECT_URL ?? process.env.DATABASE_URL
|
||||
if (!directUrl) {
|
||||
return Response.json({ error: 'DIRECT_URL/DATABASE_URL niet gezet' }, { status: 500 })
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ export const maxDuration = 300
|
|||
const CHANNEL = 'scrum4me_changes'
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
// Productie-guard: deze debug-stream lekt rauw alle pg_notify-events.
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return new Response('Not found', { status: 404 })
|
||||
}
|
||||
|
||||
const directUrl = process.env.DIRECT_URL ?? process.env.DATABASE_URL
|
||||
if (!directUrl) {
|
||||
return Response.json({ error: 'DIRECT_URL/DATABASE_URL niet gezet' }, { status: 500 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue