Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request introduces a new feature for automatic authentication token refresh in the Switcher client, along with supporting infrastructure and minor code improvements. The main focus is on enabling the client to automatically refresh its API token before expiration, improving reliability for long-running applications. Additionally, there are some refactorings to executor management and test code cleanup.
New Feature: Automatic Token Refresh
Added support for the
switcher.autorefreshtokenproperty, allowing the client to automatically refresh the API token before expiration. This includes updates to the configuration, builder, and property handling (README.md,SwitcherConfig.java,ContextBuilder.java,SwitcherPropertiesImpl.java,ContextKey.java). [1] [2] [3] [4] [5] [6]Implemented a scheduled executor service and logic in
ClientRemoteServiceto handle token refresh, including scheduling, cancellation, and error handling. The service schedules a token refresh shortly before expiry if auto-refresh is enabled (ClientRemoteService.java,SwitcherContextBase.java,WorkerName.java). [1] [2] [3] [4] [5] [6] [7] [8] [9]Executor Service and Refactoring
SwitcherContextBaseand related files. [1] [2] [3] [4] [5]Configuration and Documentation
Updated the
README.mdto document the newswitcher.autorefreshtokenproperty and fixed a minor formatting issue in the configuration table. [1] [2]Bumped the project version to
1.10.0-SNAPSHOTinpom.xml.Testing and Minor Fixes
Simplified test setup and teardown methods by calling helper methods directly, improving readability in several test classes. [1] [2] [3] [4] [5]
Added a getter for the
expfield inAuthResponseto support the token refresh logic.Other Improvements