Commit Graph

2 Commits

Author SHA1 Message Date
Jeff Emmett 1d95d1f398 Replace Resend with self-hosted email relay for all email sending
- cryptidAuth.ts: sendEmail() now calls email-relay.jeffemmett.com
  instead of api.resend.com
- boardPermissions.ts: admin request emails use email relay
- types.ts: RESEND_API_KEY → EMAIL_RELAY_URL + EMAIL_RELAY_API_KEY
- wrangler.toml: updated secrets documentation
- Tests updated with new mock env vars

Email relay is a lightweight Flask service on Netcup that accepts
HTTP POST and sends via Mailcow SMTP. Needed because CF Workers
can't do TCP/SMTP directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 16:13:05 -07:00
Jeff Emmett 00a21f9610 feat: add worker unit tests for board permissions
Comprehensive test coverage for the board permissions system:
- handleGetPermission (authenticated/unauthenticated users)
- handleListPermissions (admin filtering)
- handleGrantPermission (editor assignment)
- handleRevokePermission (editor removal)
- handleUpdateBoard (protected status, global access)
- handleCreateAccessToken (security validation)
- handleListAccessTokens (admin-only access)
- handleRevokeAccessToken (token deletion)
- handleGetGlobalAdminStatus (admin checks)
- handleGetBoardInfo (board metadata)
- handleListEditors (editor listing)

Tests cover key security scenarios:
- Anonymous users get edit on new boards (permission model)
- Protected boards require authentication
- Access tokens cannot grant admin permissions
- View permission returned when database unavailable (secure default)

30 tests total, all passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:58:22 -05:00