oauth2-proxy/pkg
Kinfemichael Desse 03e0191821 feat: make session refresh timeouts user configurable
Make the session refresh lock duration, obtain timeout, and retry period
configurable via command-line flags, config file, or environment variables.

Previously, these values were hardcoded constants:
- sessionRefreshLockDuration = 2s
- sessionRefreshObtainTimeout = 5s
- sessionRefreshRetryPeriod = 10ms

This change removes the hardcoded constants and adds three new configuration
options to the Cookie configuration:
- `--session-refresh-lock-duration` (default: 2s)
- `--session-refresh-obtain-timeout` (default: 5s)
- `--session-refresh-retry-period` (default: 10ms)

The new options allow users to tune session refresh behavior for their
specific deployment requirements, such as:
- High-latency networks requiring longer timeouts
- High-throughput systems needing faster retry intervals
- Provider-specific refresh operation durations

Changes:
- Added SessionRefreshLockDuration, SessionRefreshObtainTimeout, and
  SessionRefreshRetryPeriod fields to Cookie struct
- Updated StoredSessionLoaderOptions to accept these as parameters
- Modified storedSessionLoader to use configurable values instead of constants
- Updated all tests to provide default values
- Maintains full backward compatibility with original default values

Resolves TODO comments in pkg/middleware/stored_session.go

Signed-off-by: Kinfemichael Desse <kinfemichael.desse@real-digital.de>
2026-06-09 20:11:50 +02:00
..
apis feat: make session refresh timeouts user configurable 2026-06-09 20:11:50 +02:00
app Merge commit from fork 2026-04-13 18:22:56 +02:00
authentication chore(goconsts): use proper constants for http methods 2026-06-08 12:54:58 +02:00
cookies Merge commit from fork 2026-04-13 18:22:56 +02:00
encryption fix alpha config 2025-11-16 22:38:40 +01:00
header revert: secrets as []byte instead of string 2025-11-16 22:38:42 +01:00
ip Merge commit from fork 2026-04-13 18:22:56 +02:00
logger Request ID Logging (#1087) 2021-03-21 18:20:57 +00:00
middleware feat: make session refresh timeouts user configurable 2026-06-09 20:11:50 +02:00
providers feat: add support for specifying allowed OIDC JWT signing algorithms (#2753) (#2851) 2026-03-18 22:24:27 +08:00
proxyhttp feat: add support for setting a unix binding's socket file mode (#3376) 2026-03-19 00:08:50 +08:00
requests chore(goconsts): use proper constants for http methods 2026-06-08 12:54:58 +02:00
sessions feat: add same site option for csrf cookies (#3347) 2026-03-18 23:14:36 +08:00
upstream chore(deps): bump Go to 1.26 and migrate upstream reverse proxies to Rewrite 2026-06-08 14:12:56 +02:00
util feat: allow arbitrary claims from the IDToken and IdentityProvider UserInfo endpoint to be added to the session state (#2685) 2026-03-14 12:04:33 +08:00
validation chore(deps): bump Go to 1.26 and migrate upstream reverse proxies to Rewrite 2026-06-08 14:12:56 +02:00
version feat: Replace default Go user-agent with oauth2-proxy and version (#2570) 2024-07-14 21:09:17 +01:00
watcher Fix Linting Errors (#1835) 2022-10-21 11:57:51 +01:00