Skip to content

added support for list membership in client - #14495

Merged
Meldiron merged 8 commits into
appwrite:mainfrom
imtia33:feat/client-list-membership-support
Oct 18, 2026
Merged

Meldiron merged 8 commits into
appwrite:mainfrom
imtia33:feat/client-list-membership-support

Conversation

@imtia33

@imtia33 imtia33 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new account.listMemberships() endpoint (GET /v1/account/memberships) to the Account module.

Motivation

While users.listMemberships(userId) exists for Server/Admin SDKs with administrative access (users.read), client-side applications (Web, Mobile, Desktop) and SSR sessions acting on behalf of an authenticated user lacked an endpoint to answer:

This PR enables currently authenticated users (via session or JWT) to retrieve their own team memberships directly.

Changes:

  • Endpoint: Added GET /v1/account/memberships in src/Appwrite/Platform/Modules/Account/Http/Account/Memberships/XList.php.
    • Supports standard query parameters: queries, search, and total.
    • Enriches membership objects with teamName, userName, and userEmail matching the Response::MODEL_MEMBERSHIP_LIST model.
    • Scoped to account with [AuthType::SESSION, AuthType::JWT] auth types.
  • Service Registration: Registered account.listMemberships in src/Appwrite/Platform/Modules/Account/Services/Http.php.
  • SDK Parameters: Updated app/config/sdks/parameters.lock.json for client and server platforms.
  • Docs: Added endpoint description in docs/references/account/list-memberships.md.
  • E2E Tests: Added comprehensive test coverage in tests/e2e/Services/Account/AccountCustomClientTest.php.

Test Plan

  1. E2E Tests:
    Verified happy path and failure cases (401 unauthenticated, 400 invalid query attributes, 400 invalid cursor, total toggle, and search) with:

    docker compose exec appwrite vendor/bin/phpunit --filter=testListAccountMemberships tests/e2e/Services/Account/AccountCustomClientTest.php

    Result: OK (1 test, 36 assertions)

  2. SDK Parameters Lock Unit Test:
    Verified that method parameters and parameter order align with SDK generation standards:

    docker compose exec appwrite vendor/bin/phpunit tests/unit/SDK/ParametersTest.php

    Result: OK (2 tests, 10072 assertions)

  3. Regression Sanity Check:
    Verified that the existing server-side users.listMemberships endpoint continues to work without disruption:

    docker compose exec appwrite vendor/bin/phpunit --filter=testListUserMemberships tests/e2e/Services/Users

    Result: OK (1 test, 26 assertions)

Related PRs and Issues

  • N/A

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@ghost

ghost commented Oct 14, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The new inventory entry records the route added by this PR and does not introduce a defect.

Adds GET /v1/account/memberships so authenticated users can retrieve their own team memberships, with filtering, pagination, totals, and enriched membership fields. The route is registered in the Account service, SDK parameter metadata and API documentation are updated, and E2E tests cover the new endpoint. The security route inventory now includes the endpoint as well.

Latest changes: The latest commit adds GET /v1/account/memberships to the security test route inventory.

Verdict New comments Fixed Still open
💬 Commented 0 0 0

Note

@imtia33 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

📂 Walkthrough · 7
File Change
AGENTS.md Adds guidance for list endpoint query parameters and SDK descriptions.
app/config/sdks/parameters.lock.json Locks the SDK parameter metadata for account membership listing.
src/Appwrite/Platform/Modules/Account/Http/Account/Memberships/XList.php Implements the authenticated account membership listing endpoint.
src/Appwrite/Platform/Modules/Account/Services/Http.php Registers the membership list action with the Account HTTP service.
tests/e2e/Security/baseline.json Adds the new endpoint to the security route inventory.
tests/e2e/Services/Account/AccountCustomClientTest.php Adds E2E coverage for membership listing, query handling, and authentication failures.
docs/references/account/list-memberships.md Documents the account membership listing endpoint.

Reviewed the commits since 6c7592c · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · See the inline comments. Summary

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

Query::groupByType() returns a ParsedQuery object since the
utopia-php/database 8 upgrade, so array access on it fatals.
Also sort the new import for Pint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Meldiron
Meldiron merged commit 0c72004 into appwrite:main Oct 18, 2026
63 checks passed
@ChiragAgg5k ChiragAgg5k mentioned this pull request Oct 21, 2026
6 tasks
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