Skip to content

Expose per-provider cache_duration option#34

Merged
turegjorup merged 2 commits into
developfrom
feature/cache-duration-option
May 11, 2026
Merged

Expose per-provider cache_duration option#34
turegjorup merged 2 commits into
developfrom
feature/cache-duration-option

Conversation

@turegjorup
Copy link
Copy Markdown
Contributor

Summary

Adds a per-provider cache_duration (seconds) option that's forwarded to the underlying library's cacheDuration constructor option. Controls the TTL of the cached OIDC discovery document and JWKS.

itkdev_openid_connect:
  openid_providers:
    admin:
      options:
        # ... existing keys ...
        cache_duration: 3600  # default 86400 (24h)

Why

Surfaced during a recent verification of the cache flow: the library already caches the discovery document and JWKS via the bundle-supplied cache.app pool (no per-request IdP calls), but the TTL was hard-coded to the library default of 24h with no way for bundle consumers to shorten it for tighter key-rotation windows or extend it for stable IdPs.

Backward compatibility

Additive only. Defaults to 86400 (matching the library default) so existing configurations behave identically. The option is forwarded only when set, and the bundle's default mirrors the library's.

Test plan

  • task test — 47 tests pass (one new + two extended existing assertions)
  • task analyze:php — phpstan max level, no errors
  • task lint — clean
  • task test:matrix — all 6 PHP × deps combinations green

🤖 Generated with Claude Code

Forwarded to the underlying library's `cacheDuration` constructor option;
controls the TTL of the cached OIDC discovery document and JWKS. Default
remains 86400 seconds (24h), matching the library default.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2d3781c) to head (1874fa3).

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #34   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        57        58    +1     
===========================================
  Files              9         9           
  Lines            268       274    +6     
===========================================
+ Hits             268       274    +6     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@turegjorup turegjorup requested a review from jekuaitk May 8, 2026 09:49
@turegjorup turegjorup self-assigned this May 8, 2026
@turegjorup turegjorup merged commit 73b94dd into develop May 11, 2026
15 checks passed
@turegjorup turegjorup deleted the feature/cache-duration-option branch May 11, 2026 07:53
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.

3 participants