Skip to content

Add signed opaque pagination cursor#1607

Merged
kryputh merged 1 commit into
Stellar-Mail:mainfrom
Esc1200:fix/1490-signed-pagination-cursor
Jul 20, 2026
Merged

Add signed opaque pagination cursor#1607
kryputh merged 1 commit into
Stellar-Mail:mainfrom
Esc1200:fix/1490-signed-pagination-cursor

Conversation

@Esc1200

@Esc1200 Esc1200 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Goal

Implement a versioned, signed opaque pagination cursor so clients cannot tamper with continuation position, actor scope, filters, or ordering (issue #1490).

Changes

  • src/server/api/pagination.ts (new): encodeCursor / decodeCursor encode the full continuation key + query scope into a versioned, HMAC-signed opaque cursor. Tampered cursors are rejected, cursors are bound to actor and query scope, and versions are explicit. Secret values are never logged.
  • tests/unit/api/pagination-cursor.test.ts: round-trip, tampered-cursor rejection, cross-actor reuse rejection, scope/filter mismatch rejection, and malformed-structure rejection.

Verification

  • npx vitest run tests/unit/api/pagination-cursor.test.ts → 5 passed.
  • npx prettier@3.8.5 --check clean on changed files.

Fixes #1490

@kryputh
kryputh merged commit 6014ee7 into Stellar-Mail:main Jul 20, 2026
5 checks passed
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.

Add signed opaque cursor encoding for pagination

2 participants