-
Notifications
You must be signed in to change notification settings - Fork 127
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
Token Storage + UI #298
Token Storage + UI #298
Conversation
examples/UberSDK/UberSDKTests/UberCore/KeychainUtilityTests.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments
} | ||
|
||
private func login() { | ||
let defaultContext = AuthContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: could be moved to a constant at class level.
) | ||
) | ||
let context = dataSource?.authContext(self) ?? defaultContext | ||
UberAuth.login(context: context) { [weak self] result in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: weak self likely not needed, since UberAuth is being referred statically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Will fix in the next PR.
Description
This PR does two main things:
Changes
Supported platforms v13 -> v15
Bumped the minimum supported platform version to 15 to support the UIButton APIs. Platform adoption should be at a high enough level to support this. Also, this is in line with the 1P Uber app's min OS version.
AccessToken
A new AccessToken struct has be created to accompany the new Auth stack. The old one has been marked as DEPRECATED, but the logic should be similar.
Deprecated Classes
Legacy AccessToken and TokenManager have been marked as deprecated and call sites have been updated. There will be a later PR that migrates these call sites to the new classes.
Saving AccessToken
AuthorizationCodeAuthProvider now contains logic to save the AccessToken to the keychain after successfully exchanging authorization code for access token.
TokenManager + KeychainUtility
These are similar to the existing ones, with some improvements to the API. They now accept any objects conforming to the Codable protocol instead of NSCoding. Other logic should remain the same.
UberButton + LoginButton
The existing UberButton and LoginButton classes have been replaced with updated APIs that are now available. The UI and logic remains the same. Some resources including colors and images have been added to the bundle to support the new buttons.
Testing
Unit Tests
Unit tests have been added for new logic around token storage.
Manual Testing
The UberButton/LoginButton has been added to the sample app for manual testing purposes.