-
Notifications
You must be signed in to change notification settings - Fork 87
Build a secure opaque cursor pagination codec for GuildPass APIs #351
Copy link
Copy link
Open
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortAdvanced difficulty tasks requiring significant domain knowledge and implementation effortapiAPI routes, request handling, response contracts, and service integration workAPI routes, request handling, response contracts, and service integration workbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalitysecuritySecurity-related fix, hardening, audit, or vulnerability remediationSecurity-related fix, hardening, audit, or vulnerability remediation
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortAdvanced difficulty tasks requiring significant domain knowledge and implementation effortapiAPI routes, request handling, response contracts, and service integration workAPI routes, request handling, response contracts, and service integration workbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalitysecuritySecurity-related fix, hardening, audit, or vulnerability remediationSecurity-related fix, hardening, audit, or vulnerability remediation
Difficulty: Advanced
Type: Feature
Recommended labels (if available in this repo): api, backend, security, advanced
Background
GuildPass Core will expose list endpoints for communities, memberships, events and other resources. Cursor pagination is preferable to leaking implementation-specific database offsets or exposing internal pagination state directly to clients.
This issue introduces a standalone cursor encoding and decoding primitive that API modules can reuse later.
Problem
There is currently no standard GuildPass representation for opaque pagination cursors.
Plain base64 encoding alone is not tamper resistant, and accepting arbitrary decoded client state could allow malformed or manipulated pagination inputs to reach application services.
Expected Outcome
Implement a reusable cursor codec that serialises a small typed cursor payload into an opaque token and validates it when decoding.
The implementation must be storage-independent and route-independent.
Suggested Implementation
Use a compact payload with fields such as:
The codec should:
Do not connect the codec to Prisma queries as part of this task.
Acceptance Criteria
pnpm typecheckpasses.pnpm buildpasses.pnpm testpasses.Likely Affected Files/Directories
Independence Requirement
This issue must be implemented as a standalone API primitive and must not depend on pagination endpoints, Prisma models or another campaign contribution.