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 support for staging environments in the API client. The changes ensure that when the application is running in a staging environment, it will connect to the appropriate staging servers for both authentication and pro services. This is achieved by adding new staging URLs and logic to switch endpoints based on the environment, as well as updating relevant methods to use these staging URLs when necessary.
Environment and Endpoint Selection:
Stage()function incommon/init.goto detect if the application is running in a staging environment.stageURLandstageProServerURLfor the staging authentication and pro service endpoints inapi/user.goandapi/subscription.go. [1] [2]API Client Initialization:
NewAPIClientinapi/api.goto switch to the staging pro server and authentication server URLs if the environment is staging, with appropriate log messages. [1] [2]OAuth Flow:
OAuthLoginUrlmethod inapi/user.goto use the staging authentication server URL when in a staging environment.Imports:
commonpackage inapi/user.goto access the newStage()function.