Skip to content

Allow CLI OAuth login on Appwrite subdomains#1663

Merged
ChiragAgg5k merged 2 commits into
mainfrom
fix/cli-oauth-appwrite-domains
Jul 11, 2026
Merged

Allow CLI OAuth login on Appwrite subdomains#1663
ChiragAgg5k merged 2 commits into
mainfrom
fix/cli-oauth-appwrite-domains

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

  • allow the OAuth login feature flag for any *.appwrite.io endpoint
  • keep bare and lookalike domains excluded
  • add CLI authentication coverage for the new endpoint pattern

Test plan

  • Regenerate the CLI SDK
  • Run CLI TypeScript type checks
  • Run Twig linting
  • Verify positive and negative endpoint matching assertions

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Widens the CLI OAuth login gate from an explicit allow-list of known Appwrite hostnames to any *.appwrite.io subdomain by replacing isCloudHostname + the now-deleted isCloudEnvironmentHostname with a single hostname.endsWith(".appwrite.io") check.

  • The predicate correctly excludes the bare appwrite.io domain (no leading dot) and unrelated or lookalike hostnames; since Appwrite controls the entire appwrite.io zone, any matching subdomain is a legitimate Appwrite endpoint.
  • Tests are expanded to cover the new positive case (new.appwrite.io), the bare-domain false case, a different-name false case, and an embedded-label lookalike false case (real.appwrite.io.attacker.com).

Confidence Score: 5/5

Safe to merge — the predicate is correct, test coverage is solid, and the only functional broadening is intentional.

The change is small and well-bounded. The endsWith('.appwrite.io') predicate subsumes all previously-allowed hostnames and adds forward-compatibility for new Appwrite subdomains; Appwrite controls the entire zone so no third party can satisfy the check. The new test assertions explicitly verify both the intended positive match and the three key negative cases (bare domain, unrelated domain, and the mid-hostname lookalike).

No files require special attention.

Important Files Changed

Filename Overview
templates/cli/lib/utils.ts Replaces the two-function allow-list (isCloudHostname + isCloudEnvironmentHostname) with a single endsWith('.appwrite.io') predicate, correctly excluding the bare domain and lookalike hosts
tests/e2e/languages/cli/test.js Adds four new assertion cases for isCloudLoginEndpoint: new subdomain (true), bare domain (false), different-name domain (false), and subdomain-lookalike with appwrite.io embedded mid-hostname (false)

Reviews (2): Last reviewed commit: "(test): cover nested Appwrite hostname l..." | Re-trigger Greptile

Comment thread tests/e2e/languages/cli/test.js
Co-authored-by: Cursor <cursoragent@cursor.com>
@ChiragAgg5k ChiragAgg5k merged commit c3b10ce into main Jul 11, 2026
58 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/cli-oauth-appwrite-domains branch July 11, 2026 03:09
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.

1 participant