-
Notifications
You must be signed in to change notification settings - Fork 393
AuthFlowTester App #2821
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
base: dev
Are you sure you want to change the base?
AuthFlowTester App #2821
Conversation
Generated by 🚫 Danger |
| /** | ||
| * String extension to convert to [ScopeParser]. | ||
| */ | ||
| fun String?.toScopeParser(): ScopeParser = ScopeParser(scopeString = this) |
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.
One of only a few SDK changes. This (and Array<String>?.toScopeParameter() below) seemed like they maybe convenient for customers so I created them as public API but I could move them to the sample app if we want.
| showDevSupport?.let { | ||
| MenuItem(stringResource(sf__dev_support_title_menu_item)) { | ||
| it.invoke() | ||
| showMenu = false | ||
| } | ||
| } |
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.
The equivalent of this iOS PR.
Job Summary for GradlePull Request :: test-android |
| // UserAccount's equals() function only compares userId and orgId. | ||
| policy = neverEqualPolicy(), |
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.
It took me longer than I care to admit to figure out this is why the UI wasn't updating when the user's token was updated. 😅
| // Set current user when it changes to update UI. | ||
| DisposableEffect(Unit) { | ||
| val receiver = object : BroadcastReceiver() { | ||
| override fun onReceive(context: Context, intent: Intent) { | ||
| currentUser.value = UserAccountManager.getInstance().currentUser | ||
| } | ||
| } | ||
| val filter = IntentFilter(UserAccountManager.USER_SWITCH_INTENT_ACTION) | ||
| filter.addAction(ClientManager.ACCESS_TOKEN_REFRESH_INTENT) | ||
| filter.addAction(ClientManager.INSTANCE_URL_UPDATE_INTENT) | ||
| ContextCompat.registerReceiver(context, receiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED) | ||
| onDispose { | ||
| context.unregisterReceiver(receiver) | ||
| } | ||
| } |
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.
I liked this a bit more than the UUID refreshTrigger on iOS.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (35.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #2821 +/- ##
============================================
+ Coverage 62.10% 62.32% +0.22%
Complexity 2789 2789
============================================
Files 215 215
Lines 16993 16950 -43
Branches 2474 2423 -51
============================================
+ Hits 10553 10564 +11
+ Misses 5263 5208 -55
- Partials 1177 1178 +1
🚀 New features to boost your workflow:
|
|
The missing code coverage seems to be entirely UI code I can't reasonably get to 😞. |
This PR adds the new AuthFlowTester App, which is almost identical to its iOS counterpart except for a few details:
Redirect Uri- not stored on Android (unused on iOS)Protocol- included inDomainon AndroidIdentifierJWT- unused on iOSAuth Code- unused on iOSChallenge- unused on iOSIssued AtAPI Url- iOS uses this as the SFAP URL.Fallback (MSDK) color scheme for API < 31
Dynamic OS Provided Color Scheme Examples
This PR is almost entirely sample app code and includes a new UI test that utilizes code from our UITests repo. Additional test be added in a subsequent PR.
I have also held back on including the "Migrate to New App" feature as that feature requires new SDK code. I have that code fully functional but will hold it for a follow-up to make this PR easier to consume.