v0.1.39
v0.1.39
Token Buffer Period Adjustment
Issue: The token lifetime was shorter than the buffer period set for token refresh, causing the client to never consider the token valid and to enter a loop of continuous token refresh attempts.
Solution: Implemented a maximum consecutive token refresh attempt limit. If this limit is exceeded, an error is thrown with a message indicating that the token lifetime is likely too short compared to the configured buffer period.
Details:
Added a check in the CheckAndRefreshAuthToken method to count consecutive refresh attempts and throw an error after a specified limit.
Enhanced the error message to clearly indicate the mismatch between the access token lifetime and the buffer period configured for token refresh.
- Support for String-Based Duration in JSON Config
Issue: JSON configuration did not support string-based duration values, causing unmarshalling errors when durations were specified as strings.
Solution: Added support for parsing duration strings in JSON configuration files.
Details:
Created a custom type JSONDuration to handle durations specified as strings in JSON.
Implemented UnmarshalJSON and MarshalJSON methods for JSONDuration to parse and format duration strings.
Updated the TimeoutConfig struct to use JSONDuration instead of time.Duration.
Modified the client configuration loading logic to handle the new JSONDuration type.
Ensured all instances where durations are used (e.g., token refresh buffer period, total retry duration, custom timeout) are updated to use JSONDuration and its methods.
What's Changed
- Cookies fixed hopefully by @thejoeker12 in #192
- fix by @thejoeker12 in #193
- Bug fix: by @ShocOne in #198
Full Changelog: v0.1.38...v0.1.39