Add UberEnvironment to allow 3Ps to target sandbox vs production#268
Open
partha-uber wants to merge 1 commit intouber:mainfrom
Open
Add UberEnvironment to allow 3Ps to target sandbox vs production#268partha-uber wants to merge 1 commit intouber:mainfrom
partha-uber wants to merge 1 commit intouber:mainfrom
Conversation
3b41ebb to
bd17c80
Compare
Adds a new UberEnvironment enum (PRODUCTION/SANDBOX) and threads it through the auth flow so 3P integrators can target sandbox-login.uber.com for testing without changing their production integration. - Add UberEnvironment enum to UriConfig with PRODUCTION and SANDBOX base URLs - Add optional environment field to AuthContext (defaults to PRODUCTION) - Thread environment into AuthService.create(), UniversalSsoLink, and SsoLinkFactory - Add unit tests covering both environments and backwards-compatibility default Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
bd17c80 to
20c7eef
Compare
lalwani
reviewed
May 6, 2026
| } | ||
|
|
||
| @Test | ||
| fun `test authenticate with SANDBOX environment succeeds`() = runTest { |
Collaborator
There was a problem hiding this comment.
This test doesn't ensure that the environment is actually sandbox
lalwani
reviewed
May 6, 2026
| private val ssoConfig: SsoConfig, | ||
| private val authContext: AuthContext, | ||
| private val appDiscovering: AppDiscovering, | ||
| private val environment: UriConfig.UberEnvironment = UriConfig.UberEnvironment.PRODUCTION, |
Collaborator
There was a problem hiding this comment.
this environment is saved separately from what was passed in via authContext. There should be just 1 source of truth
lalwani
reviewed
May 6, 2026
| import com.uber.sdk2.core.BuildConfig | ||
| import com.uber.sdk2.core.config.UriConfig.EndpointRegion.DEFAULT | ||
| import com.uber.sdk2.core.config.UriConfig.Environment.API | ||
| import com.uber.sdk2.core.config.UriConfig.Environment.AUTH |
Collaborator
There was a problem hiding this comment.
We probably don't need Environment anymore. If yes, please remove it.
lalwani
reviewed
May 6, 2026
| val authType: AuthType = AuthType.PKCE(), | ||
| val prefillInfo: PrefillInfo? = null, | ||
| val prompt: Prompt? = null, | ||
| val environment: UriConfig.UberEnvironment = UriConfig.UberEnvironment.PRODUCTION, |
Collaborator
There was a problem hiding this comment.
add documentation for this new parameter
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.
Summary
Adds support for 3P developers to configure which Uber auth environment to target when integrating with the Android SDK.
Previously the SDK hardcoded
auth.uber.comacross all auth flows (/authorize,/par,/token) with no way to redirect to sandbox for testing.Changes:
UberEnvironmentenum toUriConfigwithPRODUCTIONandSANDBOXcases, each mapping to its base URLenvironmentfield toAuthContext(defaults toPRODUCTION— fully backwards-compatible)AuthService.create(),AuthProvider,SsoLinkFactory, andUniversalSsoLinkso all three OAuth endpoints respect the configured environmentUsage:
Test Plan
assembleUri()andgetAuthHost()AuthContextdefaults to PRODUCTION and SANDBOX can be setRelated
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com