Skip to content

routes: query and list endpoints for attestations and usage #56

Description

@joelpeace48-cell

Problem

There is no read API. Once attestations are being written there is no way to
retrieve them, so the dashboard, the exports, and any integrator verification
flow all have nothing to call.

What to do

  • GET /v1/attestations with filters: payer, model, policy, date range, status.
  • GET /v1/attestations/:id returning the record plus its verification
    material — transaction hash, ledger sequence, contract address.
  • GET /v1/usage with the same filter vocabulary plus aggregation
    (group_by=model|payer|day).
  • Cursor pagination, not offset — offset pagination over a continuously
    growing table skips and repeats rows as new data arrives.
  • Authorization scoped to the caller: a payer sees only their own records.
  • Cap page size and total result windows.

Acceptance criteria

  • List and detail endpoints with consistent filter vocabulary
  • Cursor pagination with a documented, stable sort
  • Row-level authorization enforced and tested
  • Page size and window caps

Notes

Row-level authorization is the one to test hardest. A filter parameter that can
be widened to another tenant's data is the classic multi-tenant leak.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third Campaignarea:routesHTTP surface (src/routes)difficulty:mediumFamiliar patterns; touches a few files or conceptspriority:highNeeded for the next milestonetype:featNew capability

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions