fix(api): Refuse plus-tag emails for starter credits - #6258
Conversation
|
🤖 The AI agent says: Ready for review. This is the homemade plus-tag ban from #6256, with the Please check:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Skip the signup grant when the local part contains +, except @agenta.ai. Signup still succeeds. The person just does not get the free connection.
|
🤖 The AI agent says: Stripped Current head |
c1936d1 to
51619b9
Compare
Context
A person can sign up as
jane+1@gmail.com,jane+2@gmail.com, and so on. Each account gets its own starter-credit grant. Those addresses are one inbox.Changes
_mint_policy_allowsnow refuses any local part that contains+, except@agenta.ai(case-insensitive). The allowlist also skips the work-domain digit rule, soname+1@agenta.aiworks for internal testers.Signup still succeeds. No key is minted. A warning logs
rule=plus_local_partand the domain only.The check is hardcoded. It is not a PostHog field, so the live payload does not have to change.
Before:
jane+1@gmail.comgets a grant.After:
jane+1@gmail.comdoes not.jane@gmail.comstill does.jane+1@agenta.aistill does.Tests / notes
credits-starter-seeding([feat] Seed starter credits at signup via budget-capped proxy keys (EE) #6138). Base is that branch, notrelease/v0.114.0.How to review
Read the new constant in
types.py, then the two checks in_mint_policy_allows, thenTestMintPolicyAllows/TestRefusalLogging.