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

erlef / oidcc / 321
91%

Build:
DEFAULT BRANCH: main
Ran 03 Jun 2026 10:04PM UTC
Jobs 1
Files 17
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

03 Jun 2026 10:02PM UTC coverage: 91.319% (+0.2%) from 91.147%
321

push

github

web-flow
Cache hardening and jwks plus json (#521)

* Harden Cache-Control parser

Three independent improvements to `oidcc_http_util:cache_deadline/2`:

* Pattern-match `[<<"max-age">>, Value | _]` directly instead of using a
  fold accumulator overloaded as both the running result and a "seen
  max-age" flag. The previous shape was prone to subtle bugs (e.g. the
  one fixed in #371) because the accumulator had two different
  meanings depending on which clause matched first.

* Lowercase the Cache-Control value before tokenising so RFC 7234 §5.2
  case-insensitive directive names (`Max-Age`, `MAX-AGE`, …) are all
  recognised, not just `max-age`.

* Clamp the resulting expiry to `[1, 16#FFFFFFFF]` ms (~49.7 days), the
  range accepted by `timer:send_after/2,3` and `erlang:send_after/3,4`.
  An over-eager provider that advertises e.g. `max-age=99999999999`
  would otherwise hand a value the caller cannot pass to the timer
  module, triggering badarg.

Falls back to the caller's default expiry on every degenerate input
(missing value, zero, non-numeric, non-integer overflow tail) — same
overall contract as before, just no longer dependent on the fold's
internal state machine being correct.

* Switch worker to erlang:send_after; survive bad expiry

Two related changes to `oidcc_provider_configuration_worker`:

1. Replace `timer:send_after/2` with `erlang:send_after/3` (and
   `timer:cancel/1` with `erlang:cancel_timer/1`). The BIF avoids the
   `timer_server` gen_server round-trip, returns a plain `reference()`,
   and is the recommended primitive for short-lived per-process timers.
   The `configuration_refresh_timer` / `jwks_refresh_timer` state field
   types follow.

2. Introduce `safe_send_after/2`, a validating wrapper. Out-of-range
   Expiry values surface as `{error, {invalid_expiry, _}}` and flow
   through the existing `handle_backoff_retry/3` path instead of
   crashing the gen_server with a `{badmatch, {error, badarg}}`. The
   guard never fires tod... (continued)

24 of 25 new or added lines in 2 files covered. (96.0%)

1094 of 1198 relevant lines covered (91.32%)

61.12 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
91.67
1.87% src/oidcc_http_util.erl
Jobs
ID Job ID Ran Files Coverage
1 321.1 03 Jun 2026 10:04PM UTC 17
91.32
GitHub Action Run
Source Files on build 321
  • Tree
  • List 17
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2a87b274 on github
  • Prev Build on main (#319)
  • Next Build on main (#322)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc