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> |
||
|---|---|---|
| .. | ||
| ip | ||
| middleware | ||
| options | ||
| sessions | ||