-
Notifications
You must be signed in to change notification settings - Fork 3
SDKS-4759 - Implement end-to-end instrumented tests for the MFA authentication migration module. #167
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
Merged
SDKS-4759 - Implement end-to-end instrumented tests for the MFA authentication migration module. #167
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2026 Ping Identity Corporation. All rights reserved. | ||
| ~ | ||
| ~ This software may be modified and distributed under the terms | ||
| ~ of the MIT license. See the LICENSE file for details. | ||
| --> | ||
|
|
||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| <application | ||
| android:allowBackup="false" | ||
| android:label="Test" | ||
| android:supportsRtl="true" | ||
| android:usesCleartextTraffic="true"> | ||
|
|
||
| </application> | ||
|
|
||
| </manifest> | ||
1,088 changes: 1,088 additions & 0 deletions
1,088
mfa/auth-migration/src/androidTest/kotlin/com/pingidentity/auth/migration/MigrationTest.kt
Large diffs are not rendered by default.
Oops, something went wrong.
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
60 changes: 60 additions & 0 deletions
60
...migration/src/main/kotlin/com/pingidentity/auth/migration/DefaultStorageClientProvider.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Copyright (c) 2026 Ping Identity Corporation. All rights reserved. | ||
| * | ||
| * This software may be modified and distributed under the terms | ||
| * of the MIT license. See the LICENSE file for details. | ||
| */ | ||
|
|
||
| package com.pingidentity.auth.migration | ||
|
|
||
| import android.content.Context | ||
| import org.forgerock.android.auth.DefaultStorageClient | ||
| import org.forgerock.android.auth.StorageClient | ||
|
|
||
| /** SharedPreferences file name for storing account data from the ForgeRock Authenticator. */ | ||
| private const val AUTH_DATA_ACCOUNT = "org.forgerock.android.authenticator.DATA.ACCOUNT" | ||
|
|
||
| /** SharedPreferences file name for storing mechanism data from the ForgeRock Authenticator. */ | ||
| private const val AUTH_DATA_MECHANISM = "org.forgerock.android.authenticator.DATA.MECHANISM" | ||
|
|
||
| /** SharedPreferences file name for storing push notification data from the ForgeRock Authenticator. */ | ||
| private const val AUTH_DATA_NOTIFICATIONS = "org.forgerock.android.authenticator.DATA.NOTIFICATIONS" | ||
|
|
||
| /** SharedPreferences file name for storing the device token from the ForgeRock Authenticator. */ | ||
| private const val AUTH_DATA_DEVICE_TOKEN = "org.forgerock.android.authenticator.DATA.DEVICE_TOKEN" | ||
|
|
||
| /** | ||
| * A [StorageClientProvider] that reads data from the default [DefaultStorageClient] used by the | ||
| * ForgeRock Authenticator SDK. | ||
| * | ||
| * This provider is intended for migration scenarios where authenticator data needs to be | ||
| * transferred from the legacy ForgeRock Authenticator storage into the unified SDK storage. | ||
| * | ||
| * @param context The Android [Context] used to access shared preferences. | ||
| * @param storageClient The [StorageClient] to read legacy authenticator data from. | ||
| * Defaults to a new [DefaultStorageClient] instance. | ||
| */ | ||
| class DefaultStorageClientProvider( | ||
|
witrisna marked this conversation as resolved.
|
||
| context: Context, | ||
| storageClient: StorageClient = DefaultStorageClient(context), | ||
| ) : StorageClientProvider(context, storageClient) { | ||
|
|
||
| /** | ||
| * Cleans up all legacy ForgeRock Authenticator SharedPreferences files after migration. | ||
| * | ||
| * This override deletes the SharedPreferences files directly (rather than clearing individual | ||
| * entries) to improve performance during cleanup. | ||
| * | ||
| * @param context The Android [Context] used to delete shared preferences. | ||
| * @param backup A callback invoked before deletion, allowing the caller to back up data prior | ||
| * to removal. | ||
| */ | ||
| override suspend fun cleanUp(context: Context, backup: (context: Context) -> Unit) { | ||
|
|
||
| backup(context) | ||
| context.deleteSharedPreferences(AUTH_DATA_ACCOUNT) | ||
| context.deleteSharedPreferences(AUTH_DATA_MECHANISM) | ||
| context.deleteSharedPreferences(AUTH_DATA_NOTIFICATIONS) | ||
| context.deleteSharedPreferences(AUTH_DATA_DEVICE_TOKEN) | ||
| } | ||
| } | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.