Repository navigation
fix(facilitator): parse boolean env vars strictly - #162
Merged
Merged
Conversation
z.coerce.boolean() treats any non-empty string as true, so SUPABASE_SMTP_CONFIGURED=false and OFAC_ENABLED=false enabled both. Accept only true/false/1/0 and reject anything else at startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Problem
apps/facilitator/src/config.tsparsedSUPABASE_SMTP_CONFIGUREDandOFAC_ENABLEDwithz.coerce.boolean(), which turns any non-empty string intotrue. Setting either to"false"(as.env.exampleshows) enabled it:SUPABASE_SMTP_CONFIGURED=falsebypassed the 503 guard, so signup reported "verification email sent" while Supabase's built-in SMTP silently dropped the OTP (the mechanism behind bug: Supabase OTP emails never delivered; signup endpoint returns false success #128/bug: signup endpoint returns verification_email_sent without confirming Supabase actually delivered #129).OFAC_ENABLED=falsewould turn OFAC screening on.Fix
A strict
envBooleanschema: acceptstrue/false/1/0(and upper-caseTRUE/FALSE), defaults tofalsewhen unset, and fails startup with a named error for anything else (e.g.yes).Tests
src/__tests__/config.test.ts(8 tests): each accepted value for both flags, unset defaults to false, unrecognized value throws.shutdown-load.test.tsthat passed 3/3 with and without this change (filed as Flaky test: shutdown-load concurrent requests under full suite #161).Deploy note
Merging this deploys the facilitator from latest
master(it changes a file under the service'sapps/facilitator/**watch path). Production currently leaves both flags unset, so behavior is unchanged untilSUPABASE_SMTP_CONFIGURED=trueis set after Resend SMTP is configured.Relates to #128.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF