Implement teehr client updates for teehr-hub API key authentication and robust paginated fetch behavior under server-side hard row limits.
Required teehr-hub API details
- API key auth header is
x-api-key.
- Bearer auth remains supported via
Authorization: Bearer <token>.
- Pagination uses
limit and offset query parameters.
- GeoJSON collection responses include pagination links in
links[], including rel: "next" when another page is available.
- Response includes
numberReturned for current page size.
- Server may clamp requested
limit based on caller role; client must treat this as expected behavior.
- Auth errors:
401 for invalid/missing credentials on protected routes.
403 for authenticated caller lacking required permissions.
Required teehr client behavior
- Add API key auth mode:
- Accept API key in client config/session.
- Send
x-api-key on outbound requests when configured.
- Keep existing bearer-token behavior unchanged.
- Add fetch-all pagination mode:
- Prefer following
links[].rel == "next" when present.
- Fallback to
offset pagination when next link is absent.
- Preserve all filter/query params across page requests.
- Continue until no next page exists.
- Hard-limit compatibility:
- Do not stop after first page just because returned rows are less than requested
limit.
- Continue paging whenever a next page is indicated.
Required acceptance criteria
- Client can call protected teehr-hub endpoints using
x-api-key.
- Fetch-all mode retrieves complete multi-page datasets.
- Client handles server-clamped first page without truncating overall result set.
- Tests cover:
- API key auth success/failure.
- Next-link pagination.
- Offset fallback pagination.
- Clamped-first-page scenario.
Implement teehr client updates for teehr-hub API key authentication and robust paginated fetch behavior under server-side hard row limits.
Required teehr-hub API details
x-api-key.Authorization: Bearer <token>.limitandoffsetquery parameters.links[], includingrel: "next"when another page is available.numberReturnedfor current page size.limitbased on caller role; client must treat this as expected behavior.401for invalid/missing credentials on protected routes.403for authenticated caller lacking required permissions.Required teehr client behavior
x-api-keyon outbound requests when configured.links[].rel == "next"when present.offsetpagination when next link is absent.limit.Required acceptance criteria
x-api-key.