Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate UberRides and UberAuth configurations #310

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

mohssenfathi
Copy link
Contributor

Description

Previously, UberRides used a Configuration class that contained a lot of global state / static properties. This is not ideal for keeping state scroll multiple frameworks (or a single framework for that matter). With the exception of the sandbox property, these were all made non-static.
This PR consolidates the ConfigurationProvider from UberAuth and the Configuration from UberRides and moves dependencies to UberCore so both can use it.

⚠️ Breaking Change ⚠️: In the Info.plist, the UberAuth configuration has been renamed to Uber.
Ex. Configuration values in the plist will need to change from UberAuth/ClientID -> Uber/ClientID

Changes

Dependencies moved to UberCore

UberApp was made public and moved to UberCore.

Required config values will assert

Any required configuration values will now throw a precondition failure in ConfigurationProvider. This was done to make them non-optional. If they are not found in the Info.plist, the SDK will crash at runtime.

DefaultConfigurationProvider -> ConfigurationProvider

Renamed this class to ConfigurationProvider to match the er/ing pattern.

Updated Configuration references

Any references to the legacy Configuration class have been updated to use the equivalent ConfigurationProvider property.
In some cases, this is no longer a static property, so an instance of ConfigurationProvider was added to the calling class.

Testing

Existing unit tests pass

@mohssenfathi mohssenfathi marked this pull request as ready for review August 8, 2024 21:38
@@ -67,7 +67,9 @@ public extension TokenManaging {

public final class TokenManager: TokenManaging {

public static let defaultAccessTokenIdentifier = "UberAccessTokenKey"
public static let defaultAccessTokenIdentifier: String = "UberAccessTokenKey"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: specifying type here is likley unnecessary

@mohssenfathi mohssenfathi merged commit bb61e42 into uber:2.x Aug 12, 2024
4 checks passed
@mohssenfathi mohssenfathi deleted the configuration-provider branch August 12, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants