Repository navigation
[M2.2c3b] Deliver identity codes over verified SMTP TLS - #47
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.2c3a-private-mail-queue
branch
from
November 5, 2026 12:15
38054d9 to
0c74633
Compare
samuelmbabhazi
changed the base branch from
feat/m2.2c3a-private-mail-queue
to
main
November 5, 2026 12:15
samuelmbabhazi
force-pushed
the
feat/m2.2c3b-smtp-delivery
branch
from
November 5, 2026 12:15
6fdde0c to
21c05e5
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
Browser session guards now reject unauthenticated requests by default and require both an exact configured Origin and a session-bound CSRF header for mutations. Explicit anonymous routes still enforce Origin on writes. HTTPS cookies are host-bound, Secure and SameSite=Strict; only the CSRF cookie is JavaScript-readable. The rate guard applies the persisted quotas before DTO processing, normalizes account subjects, and returns Retry-After and quota metadata. Duplicate credentials and bearer-to-cookie fallback fail closed. Global registration and account endpoints follow in M2.2c4b. Validation: API lint, strict typecheck and all 92 unit tests pass, including eight new HTTP/cookie boundary tests. Tests cover cross-site requests, missing or mismatched CSRF, duplicate cookies, untrusted forwarded IPs and quota responses. No database migration or generated-contract change in this slice. Security: the CSRF header joins the logging redaction list. No raw credentials are logged; authentication reuses the validated session service. This PR is stacked on #47; do not merge automatically. - [x] M2.2c4a acceptance criteria documented and met - [x] Relevant tests, lint and typecheck pass locally - [x] No new shell invocation or secret exposure path - [x] No new business state mutation; session activity and throttle counters reuse existing stores - [x] Threat model and plan updated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
M2.2c3b, part of #21. Depends on #46; base
feat/m2.2c3a-private-mail-queue.What changed and why
Add SMTP delivery over implicit TLS with mandatory certificate-chain/hostname verification and TLS 1.2 minimum. Configure the SMTP host, sender, optional credentials and optional public CA bundle through validated/redacting application configuration. A ten-second inactivity timeout and twenty-second total deadline bound delivery; sockets close on both success and failure.
Emails link to a clean verification/reset page and provide a separate code to paste, keeping bearer credentials out of URLs. Public API URLs must be bare origins and use HTTPS in production. emailjs is pinned to MIT-licensed version 5.0.4. Providers must support implicit TLS (normally port 465); STARTTLS/plaintext SMTP is outside this implementation.
Validation
Security considerations
There is no TLS verification bypass. SMTP credentials are exposed only to the transport and protocol logging is disabled. Untrusted certificates fail before SMTP authentication. Transport errors are opaque before the durable worker sees them. Production signup endpoints still await HTTP integration in M2.2c4.
Checklist