Skip to content

Implement pagination for access control GET methods #113

Closed

Description

@kushagra189

Pagination is required while excessing permission rule data objects.

Activity

  1. added
    priority: low
    status flag: discuss
    status: blocked
    workload: days
    on Jan 29, 2022
  2. self-assigned this
    on Jan 29, 2022
  3. moved this to Todo access control in FOCA releaseon Dec 2, 2023
  4. added this to the v1.0.0 milestone on Dec 2, 2023
  5. uniqueg commented on Oct 18, 2026

    @uniqueg
    Member

    Refined proposal

    GET /permissions currently accepts only limit and returns a bare list sorted by $natural. For v0.14.0, we would implement page-based pagination as per the GA4GH API pagination guide. The guide recommends page-based pagination for random seeking and flexible client queries, and token-based pagination for streaming large result sets; permission rule sets are small to medium-sized and typically browsed by admins, so page-based is the better fit (and maps directly to MongoDB skip/limit and count_documents).

    • Query parameters page_size (default 100, maximum 1000) and page (starting at 0, default 0).
    • Response object as in the guide:
      {
        "results": [...],
        "pagination": {"page": 0, "page_size": 100, "total": 16, "total_pages": 1}
      }
    • Stable order by _id (insertion order), not $natural.
    • 400 for a page beyond the available results (except page 0 of an empty result set) and for a page_size above the maximum, as recommended by the guide.
    • The limit parameter is removed.
    • Consistency between pages is not guaranteed if rules change in between; this is documented, as required by the guide.

    Acceptance criteria

    • Spec updated (page_size, page, response schema with results and pagination); limit removed.
    • Tests: iterating all pages returns every rule exactly once; total/total_pages are correct; out-of-range page and too large page_size yield 400; empty result set yields page 0 with total 0.
    • Docs and permissions API examples updated, including the note on consistency.

    Breaking changes
    The list endpoint returns an object instead of a list, and limit is gone. Admin scripts and UIs that call GET /permissions must read results and request further pages.

    Planned PR
    4 (refactor(access-control): tidy permissions API).

  6. moved this from Todo access control to Done in FOCA releaseon Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowstatus flag: discussstatus: blockedworkload: days

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions