Repository navigation
fix(account): apply project email policies to ID-token sign-in on self-hosted - #14633
Conversation
…f-hosted ID-token sign-in now uses the same plan gate as email sign-up, OAuth2, and user/membership email updates so project email policies apply when the injected plan is empty. Co-authored-by: Jake Barnby <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
Review complete. No issues found — approved ✅. This PR introduces a new
Reviewed commit: 5c88aaf |
🟢 Tier S · Ready to merge
The ID-token sign-in flow now treats an empty plan as allowing configured email policies, matching other self-hosted account paths while retaining Cloud plan-feature gating. E2E coverage exercises free, disposable, aliased, and corporate email policies for sign-up, new-user sign-in, backfill, and allowed addresses.
📂 Walkthrough · 2
Reviewed |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
… them The ID-token email policy tests from appwrite#14633 enable deny-free-email, deny-disposable-email, deny-aliased-email and deny-corporate-email through the project policies API, which refuses each with general_access_forbidden on a Cloud plan that lacks the feature. Cloud runs this suite on such a plan, so all four tests failed in setup. Skip them there, the way MigrationsBase already tolerates the same refusal; self-hosted has an empty plan and still runs them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en-email-policies-c522 fix(account): apply project email policies to ID-token sign-in on self-hosted (cherry picked from commit 04d8428)
What does this PR do?
ID-token sign-in (
POST /v1/account/sessions/id-token) now applies the same project email policies as email/password sign-up, OAuth2 redirect, Users create/update email, and team membership creation.Those other paths treat an empty injected
plan(self-hosted) as allowing the project's configured policies. The ID-token path only checkedconsoleor a populated plan feature flag, so self-hosted skipped the checks. Cloud behaviour is unchanged: a populated plan still gates each policy on the matchingsupports*flag.The gate in
parseEmail()(canonicalize) andassertEmailPolicy()now matches the existing expression used elsewhere:console || empty($plan) || $plan['supports…']This covers both new-user creation and the email backfill path. A shared helper was considered; the existing inline expression was kept so this file stays consistent with the other call sites.
Test Plan
AccountCustomClientTestfordeny-free-emailanddeny-disposable-emailon the ID-token path:finallyso later tests are unaffectedRelated PRs and Issues
Checklist