Skip to content

feat(proxy): forward ranges on internal metrics and pass review accounts through - #194

Merged
Bccorb merged 1 commit into
mainfrom
feat/ranged-metrics-and-review-accounts
Oct 7, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/ranged-metrics-and-review-accounts

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Adapter side of fells-code/seamless-auth-api#364 (#132) and fells-code/seamless-auth-api#365 (#331).

Ranged internal metrics (#132)

getDashboardMetricsHandler and getSecurityAnomaliesHandler took BaseOpts with no query, so the range and paging the API now accepts on /internal/metrics/dashboard and /internal/security/anomalies would never have reached it. The adapter would have answered 200 for the default window, which is exactly the silent failure the query-forwarding tests exist for. Both handlers now take WithQuery, and Express, Fastify and Next.js pass the request's query.

Tests:

  • Both routes are added to the Express and Fastify query-forwarding tables.
  • Next.js has no such table, so a small test in its parity file asserts every query parameter reaches the upstream URL. I checked that it fails (2 failures) with the core and Next.js changes reverted, and passes with them.

Review accounts (#331)

GET /admin/review-accounts is passed through on the caller's access identity, with its days query. It returns whether review accounts are enabled, the configured addresses, whether a valid code is set (never the code itself) and recent sign-in counts. It is in the Express router, the Fastify and Next.js proxy tables, and the ensureCookies map, with query-forwarding rows and parity cases.

Checks

pnpm build and pnpm test (core 322, express 195, nextjs 131, fastify 118, all passing). The changed files are Prettier-clean.

Note: once @seamless-auth/types 0.28.0 publishes, check:types-current will ask for a bump here as well. Nothing in this PR needs the new types, so the bump can ride along with it or follow it.

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.

1 participant