Skip to content

refactor(account): use Utopia Auth Phrase proofs - #13226

Merged
eldadfux merged 1 commit into
mainfrom
cursor/use-utopia-phrase-1299
Aug 15, 2026
Merged

eldadfux merged 1 commit into
mainfrom
cursor/use-utopia-phrase-1299

Conversation

@eldadfux

Copy link
Copy Markdown
Member

What does this PR do?

Deletes the leftover Appwrite\Auth\Phrase helper and generates magic-URL / OTP security phrases through Utopia\Auth\Proofs\Phrase, which already ships in utopia-php/auth.

Phrase::generate() was a static wrapper around the same adjective/noun lists. The Utopia proof is instance-based, so call sites now use (new Phrase())->generate().

This is independent of the larger Auth validator and OAuth2 client moves.

Test Plan

  • Confirmed Appwrite\Auth\Phrase has no remaining references.
  • Magic-URL and OTP session routes still generate a phrase when the security-phrase option is enabled.

Related PRs and Issues

  • Follow-up: move remaining Auth validators and OAuth2 clients into Utopia Auth (monorepo).
Open in Web Open in Cursor 

Delete the leftover Appwrite Phrase helper and generate magic-URL and
OTP security phrases through Utopia\Auth\Proofs\Phrase.

Co-authored-by: Eldad A. Fux <[email protected]>
@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → cursor/use-utopia-phrase-1299 (after).

Metric Before After Change
🚀 Requests/sec 211.4 210.99 ⚪ -0.2%
⏱️ Latency P50 68.18 ms 68.21 ms ⚪ 0%
⏱️ Latency P95 231.78 ms 236.54 ms ⚪ +2.1%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 68.21 236.54 13,167 210.99 +4.75
Account 129.01 335.42 693 11.57 +13.17
TablesDB 65.22 212.89 7,161 116.26 +3.68
Storage 61.72 209.63 3,465 58.25 -11.59
Functions 107.66 298.34 1,848 31.7 +20.29

Top API waits (after)

API request Max wait (ms)
account.name.update 840.44
account.prefs.update 746.88
tokens.files.create 727.75
tablesdb.rows.create 634.58
tablesdb.rows.update 621.63

@eldadfux
eldadfux marked this pull request as ready for review August 15, 2026 08:20
@eldadfux
eldadfux merged commit c4afc2b into main Aug 15, 2026
82 of 83 checks passed
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces Appwrite’s local security-phrase helper with the equivalent phrase proof supplied by Utopia Auth.

  • Imports and instantiates Utopia\Auth\Proofs\Phrase in magic-URL and email-OTP token routes.
  • Removes the superseded Appwrite\Auth\Phrase implementation.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking issues identified.

Both security-phrase call sites were migrated consistently, and no remaining repository consumer of the deleted helper was found.

Important Files Changed

Filename Overview
app/controllers/api/account.php Updates both phrase-enabled account token routes to generate their email and response phrase through Utopia Auth; no actionable defect was established.
src/Appwrite/Auth/Phrase.php Removes the superseded local phrase generator after its account-controller call sites were migrated and no remaining repository references were found.

Reviews (1): Last reviewed commit: "refactor(account): use Utopia Auth Phras..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants