Skip to content

feat: keyset pagination on /api/admin/audit (#514)#579

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
gidadoabdullateef5:task/audit-cursor
Jun 29, 2026
Merged

feat: keyset pagination on /api/admin/audit (#514)#579
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
gidadoabdullateef5:task/audit-cursor

Conversation

@gidadoabdullateef5

@gidadoabdullateef5 gidadoabdullateef5 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #514


Summary

Implements stable keyset pagination for the admin audit log listing endpoint as specified in #514.

  • Adds GET /api/admin/audit with opaque pagination tokens encoding (timestamp, id)
  • Results are ordered newest first (created_at DESC, id DESC) for forensic review
  • Supports optional filters: event, tenant_id, actor, from, to
  • Returns standardized { data, meta } envelope with meta.hasMore and meta.nextCursor
  • Emits a LIST_AUDIT_LOGS audit event with correlation ID propagation
  • Documents the endpoint in docs/admin-audit-endpoint.md

API changes

Method Path Description
GET /api/admin/audit List persisted audit log entries (admin-only)

Query params: limit (1–100, default 20), cursor, event, tenant_id, actor, from, to

Response meta:

{
  "limit": 20,
  "hasMore": true,
  "nextCursor": "<opaque base64 token>"
}

Add admin audit log listing with stable pagination over (created_at, id), repository layer, route tests, and API documentation.

Closes CalloraOrg#514
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@gidadoabdullateef5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

- Remove leftover merge conflict markers in usageEventsRepository.pg.ts

- Fix WebhookEventType union syntax in webhook.types.ts

- Restore missing CursorPayload imports and readDb query calls

- Add USAGE_AGGREGATE_NOT_FOUND to error code catalog
- Fix merge conflict markers and syntax errors blocking ESLint
- Align test fixtures with schema fields (plan_overrides, deleted_at)
- Add missing dependency, config fields, and error codes for typecheck
- Repair broken imports and repository interface implementations
@greatest0fallt1me greatest0fallt1me merged commit beee8c9 into CalloraOrg:main Jun 29, 2026
1 check 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 cursor pagination on /api/admin/audit

2 participants