• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-flutter / 38226711363
92%

Build:
DEFAULT BRANCH: main
Ran 12 Oct 2026 08:58AM UTC
Jobs 11
Files 175
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Oct 2026 08:56AM UTC coverage: 91.532% (+0.02%) from 91.512%
38226711363

push

github

web-flow
fix(auth): expire the cached JWKS in getClaims after its TTL (#1946)

### Problem

`getClaims()` passes its own in-memory JWKS cache to `_fetchJwk` as the
"supplied" key set, and that lookup returns before the TTL check runs.
Once a `kid` is in the cache it is served for the lifetime of the
client: `AuthConstants.jwksTtl` (10 minutes) is never consulted for a
key that is already cached, so a signing key that has been rotated out
and revoked keeps verifying tokens locally until the process restarts or
a token with an unknown `kid` happens to replace the cache.

auth-js only short-circuits on the caller-supplied `options.jwks`, which
this SDK does not have, and refreshes its cache after 10 minutes. The
capability spec for `auth.session.get_claims` states the JWK Set is
cached in the client for ten minutes, matching the `Cache-Control:
public, max-age=600` the endpoint serves.

This came in with #1300, which replaced the `_jwks!` force-unwrap at the
call site with `_jwks ?? JWKSet(keys: [])`, so the cache started
arriving through the supplied-set parameter.

### Fix

`_fetchJwk` now reads the cache through the TTL check only, and the
supplied-set parameter is gone since nothing else ever passed one. An
`@internal`, `@visibleForTesting` `jwksCachedAt` accessor lets the tests
age the cache directly, so no new dependency is needed.

No public API change.

### Tests

Two tests in `get_claims_mock_test.dart`:

- within the TTL a second `getClaims()` reuses the cache: one JWKS
request, no `/user` call.
- after the TTL the JWKS is refetched; the rotated set no longer carries
the token's `kid`, so verification falls back to `/user`, which answers
401 and surfaces as `AuthApiException`. On `main` this test fails: the
stale key verifies the token locally, with no second JWKS request and no
`/user` call.

Ran the 481 `supabase_auth` unit tests that do not need a server, `dart
analyze --fatal-infos` and `dart format --set-exit-if-changed`. The
integration suite was ... (continued)

6 of 6 new or added lines in 1 file covered. (100.0%)

9501 of 10380 relevant lines covered (91.53%)

5.19 hits per line

Jobs
ID Job ID Ran Files Coverage
3 postgrest - 38226711363.3 12 Oct 2026 09:01AM UTC 30
92.97
GitHub Action Run
4 supabase_functions - 38226711363.4 12 Oct 2026 08:58AM UTC 4
93.28
GitHub Action Run
5 supabase_storage - 38226711363.5 12 Oct 2026 09:04AM UTC 9
98.47
GitHub Action Run
6 iceberg - 38226711363.6 12 Oct 2026 08:58AM UTC 6
69.17
GitHub Action Run
7 supabase_typegen - 38226711363.7 12 Oct 2026 09:00AM UTC 24
96.19
GitHub Action Run
8 supabase_flutter - 38226711363.8 12 Oct 2026 08:58AM UTC 15
80.58
GitHub Action Run
9 supabase_realtime - 38226711363.9 12 Oct 2026 09:00AM UTC 14
91.11
GitHub Action Run
10 supabase - 38226711363.10 12 Oct 2026 09:01AM UTC 17
95.05
GitHub Action Run
11 supabase_auth - 38226711363.11 12 Oct 2026 09:02AM UTC 32
92.25
GitHub Action Run
2 supabase_common - 37944513512.2 09 Oct 2026 02:32PM UTC 23
88.14
GitHub Action Run
11 yet_another_json_isolate - 37623283614.11 07 Oct 2026 12:48PM UTC 1
98.44
GitHub Action Run
Source Files on build 38226711363
  • Tree
  • List 175
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #38226711363
  • e180f412 on github
  • Prev Build on main (#38223427918)
  • Next Build on main (#38230159408)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc