Skip to content

Feature/security#445

Open
woodlonestar-lang wants to merge 4 commits into
AnnabelJoe:mainfrom
woodlonestar-lang:feature/security
Open

Feature/security#445
woodlonestar-lang wants to merge 4 commits into
AnnabelJoe:mainfrom
woodlonestar-lang:feature/security

Conversation

@woodlonestar-lang
Copy link
Copy Markdown

closes #140
closes #134
closes #131
closes #129

Summary

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • CI / tooling

Related issue

Closes #

Checklist

  • Tests pass
  • No new lint warnings
  • Docs updated if needed
  • CHANGELOG.md updated
  • PR targets develop
  • Supabase queries audited for SQL injection (no raw SQL, parameterized methods used)

- HSTS max-age=31536000; includeSubDomains
- X-Frame-Options: DENY
- X-Content-Type-Options: nosniff
- Referrer-Policy: strict-origin-when-cross-origin
- Permissions-Policy (camera, microphone, geolocation off)
- Content-Security-Policy baseline

Closes AnnabelJoe#129
- Migration: add api_key column to meters (backfill existing rows)
- POST /api/meters generates a unique mk_* API key on registration
- POST /api/readings validates X-Api-Key header before Ed25519 check
- POST /api/meters/[id]/rotate-key issues a replacement key instantly
- Fix pre-existing broken imports in readings route (enforceRateLimit,
  getIdempotentResponse, storeIdempotentResponse, NONCE_TTL_MS)
- All 109 tests pass

Closes AnnabelJoe#131
)

- Add createAnonClient() (anon key, RLS enforced) to supabase.ts
- Switch GET /api/verify and GET /api/verify/[id] to anon client
- Add migration 010: public SELECT RLS policies on certificates/readings
  so the verifier works without the service role key
- ADR 007 documents every remaining service role usage with justification

Closes AnnabelJoe#134
…nnabelJoe#140)

- lib/email.ts: Resend-backed sendMintedEmail, sendRetiredEmail,
  sendMintFailedEmail with branded HTML template and unsubscribe link
- POST /api/readings: fires sendMintedEmail on success,
  sendMintFailedEmail on failure (fire-and-forget)
- POST /api/certificates/[id]/retire: fires sendRetiredEmail
- No-op when RESEND_API_KEY is not set
- .env.example: RESEND_API_KEY, NOTIFICATION_FROM_EMAIL,
  NOTIFICATION_EMAIL, NEXT_PUBLIC_APP_URL

Closes AnnabelJoe#140
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant