Skip to content

feat: add ETag/304 caching to /api/auth endpoints - #552

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Theonlyayodeji:task/auth-etag
Jul 26, 2026
Merged

feat: add ETag/304 caching to /api/auth endpoints#552
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Theonlyayodeji:task/auth-etag

Conversation

@Theonlyayodeji

Copy link
Copy Markdown

Description

Adds ETag-based HTTP caching (RFC 7232) to three POST endpoints in /api/auth:

  • \POST /api/auth/challenge\
  • \POST /api/auth/verify\
  • \POST /api/auth/refresh\

Each endpoint now calls \conditionalGet()\ on its response payload before sending. If the client supplies an \If-None-Match\ header matching the current ETag, a 304 Not Modified (empty body) is returned.

Also fixes pre-existing broken imports in \src/routes/predictions/cancel.ts, \src/index.ts, and \src/routes/admin/audit.ts\ that prevented the test suite from loading.

Closes #358

Add conditionalGet to POST /refresh, /challenge, and /verify
to support HTTP 304 Not Modified responses via strong ETags.
Fix pre-existing broken imports (cancel.ts, index.ts, audit.ts).
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged via direct push to main (admin)

@greatest0fallt1me
greatest0fallt1me merged commit 30b5d8d into Predictify-org:main Jul 26, 2026
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 ETag/304 caching on auth (buffer #22)

3 participants