Repository navigation
Conversation
…ng policy Signed-off-by: Jyotirmoy Roy <[email protected]>
Contributor
|
…list The oauth-trust-provider-email policy previously enabled email-based account linking for every OAuth provider at once. Gate linking per provider by storing an explicit list of trusted provider IDs; an empty list keeps the default behavior unchanged. - PATCH /v1/project/policies/oauth-trust-provider-email now takes providers (array of provider IDs) instead of enabled - Policy model exposes providers; the V26 response filter mirrors it as authOauthTrustProviderEmailProviders - account.php only trusts a provider when it is in the stored list; a legacy boolean value on the project is normalized to an empty list - Account e2e asserts the unverified email stays blocked for untrusted providers and that linking never marks the email verified; identity cleanup is scoped to identities of accounts owned by the test email
Contributor
|
Want your agent to iterate on Greptile's feedback? Start a greploop in Claude Code and it will work through the open comments and keep going until this PR reviews clean. |
…ng policy Signed-off-by: Jyotirmoy Roy <[email protected]>
This branch has not been 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.
What does this PR do?
Adds an opt-in project policy (PATCH /v1/project/policies/oauth-trust-provider-email) that lets self-hosted deployments trust the email reported by an OAuth provider when linking an OAuth sign-in to an existing account by email. The motivating case is Microsoft OAuth, where
isEmailVerified()always returns false, so same-email linking never succeeds by default.The policy stores a list of trusted provider IDs:
auths.oauthTrustProviderEmailProviders(string[], default []). An empty list keeps the default strict behavior - an unverified email from any provider stays blocked. When a provider's ID is in the list, its reported (possibly unverified) email may link to an existing account with the same email.Scope is intentionally limited to the email-link step in
app/controllers/api/account.php. Other paths (canonicalization, verification emails, logged-in provider conflict, session token flow) are unchanged.Microsoft::isEmailVerified()still returns false, and the policy never sets Appwrite'semailVerificationflag - that stays driven by the provider.Trust only providers and directories you control (for example your own Microsoft tenant with accounts provisioned by IT). The policy affects email-based account linking only, not Appwrite-side email verification.
Test Plan
Ran locally:
providers(400)emailVerificationstays falseRelated PRs and Issues
Checklist