refactor(auth): consume Utopia OAuth2 clients and validators - #13227
Draft
eldadfux wants to merge 5 commits into
Draft
refactor(auth): consume Utopia OAuth2 clients and validators#13227eldadfux wants to merge 5 commits into
eldadfux wants to merge 5 commits into
Conversation
Switch account, VCS, and Project OAuth2 flows to Utopia\Auth\OAuth2\Provider adapters, and password/phone input rules to Utopia\Auth\Validator plus Phone(knownCallingCode: true). Appwrite keeps Key, MFA, and a thin OAuth2Client helper that injects _APP_OPENSSL_KEY_V1 and the Appwrite user agent. Adapter unit tests move with the library. Co-authored-by: Eldad A. Fux <eldadfux@users.noreply.github.com>
Composer cannot resolve utopia-php/auth ^0.11 or the CallingCode Phone API from Packagist yet. Point auth at the split-dev snapshot on the mirror and validators at a small dist tarball of the monorepo package so Checks, Image, and Build can install. Co-authored-by: Eldad A. Fux <eldadfux@users.noreply.github.com>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Mock-number 400 responses now use the library description (7–15 digits) instead of the old Appwrite Phone wording. Co-authored-by: Eldad A. Fux <eldadfux@users.noreply.github.com>
Password, dictionary, strength, personal-data, and email-whitelist coverage lives in utopia-php/auth. Phone coverage lives in utopia-php/validators. Keep KeyTest, which still exercises Appwrite code. Co-authored-by: Eldad A. Fux <eldadfux@users.noreply.github.com>
Replace the package-type tar.gz pins with the documented Split Dev consume path: utopia-php/auth is required as dev-cursor/auth-validators-oauth2-1299 as 0.10.999 from the VCS mirror. Validators stays on published 0.5.0, so Phone params no longer pass knownCallingCode (that flag is not in 0.5.0). Co-authored-by: Eldad A. Fux <eldadfux@users.noreply.github.com>
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?
Switches Appwrite off the in-tree Auth OAuth2 adapters and validators, which now live in Utopia:
Utopia\Auth\OAuth2\Providers\*viaAppwrite\Auth\OAuth2Client(injects_APP_OPENSSL_KEY_V1for PKCE and the Appwrite user agent).Utopia\Auth\Validator\*.Utopia\Validator\Phone(E.164).knownCallingCodeis not on validators 0.5.0; restore it after that API is released.src/Appwrite/Auth/OAuth2*andsrc/Appwrite/Auth/Validator/*. KeepsKeyand MFA.packages/authin the Utopia monorepo.Stacked on #13226 (Phrase). Depends on utopia-php/monorepo#137.
Unpublished packages
No vendored tarballs. Composer consumes the in-flight auth branch the way Utopia Split Dev documents:
from the existing
github.com/utopia-php/authVCS repository (Packagist already lists that branch).utopia-php/validatorsstays on published^0.5(0.5.0).To also consume the unpublished CallingCode Phone API, dispatch Split Dev on the monorepo branch for
validators, then switch that constraint todev-cursor/auth-validators-oauth2-1299 as 0.5.999and passknownCallingCode: trueagain.Before merge, replace the auth alias with a released Packagist constraint (
^0.11or whatever the tag is).Tests
Removed Appwrite unit tests that only re-ran library behavior now covered in Utopia:
Password,PasswordDictionary,PasswordStrength,PersonalData,EmailWhitelist→packages/auth/tests/Auth/Validator/Phone→packages/validators/tests/Validator/PhoneTest.phptests/unit/Auth/KeyTest.phpstays. Appwrite E2E and Project/VCS unit tests that exercise Appwrite wiring stay.Projects E2E
testUpdateMockNumbersexpects the Utopia Phone description (between 7 and 15 digits).Related PRs and Issues