-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ebf0ff
commit c690693
Showing
32 changed files
with
1,225 additions
and
197 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -36,6 +36,7 @@ android { | |
|
||
buildFeatures { | ||
viewBinding true | ||
buildConfig true | ||
} | ||
|
||
} | ||
|
This file contains 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
83 changes: 0 additions & 83 deletions
83
forgerock-auth/src/main/java/org/forgerock/android/auth/callback/CallbackFactory.java
This file was deleted.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
forgerock-auth/src/main/java/org/forgerock/android/auth/callback/CallbackFactory.kt
This file contains 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,83 @@ | ||
/* | ||
* Copyright (c) 2019 - 2023 ForgeRock. All rights reserved. | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
package org.forgerock.android.auth.callback | ||
|
||
import org.forgerock.android.auth.Logger.Companion.error | ||
|
||
/** | ||
* Factory to manage supported [Callback] | ||
*/ | ||
class CallbackFactory private constructor() { | ||
internal val callbacks: MutableMap<String, Class<out Callback>> = HashMap() | ||
|
||
init { | ||
register(ChoiceCallback::class.java) | ||
register(NameCallback::class.java) | ||
register(PasswordCallback::class.java) | ||
register(StringAttributeInputCallback::class.java) | ||
register(NumberAttributeInputCallback::class.java) | ||
register(BooleanAttributeInputCallback::class.java) | ||
register(ValidatedPasswordCallback::class.java) | ||
register(ValidatedUsernameCallback::class.java) | ||
register(KbaCreateCallback::class.java) | ||
register(TermsAndConditionsCallback::class.java) | ||
register(PollingWaitCallback::class.java) | ||
register(ConfirmationCallback::class.java) | ||
register(TextOutputCallback::class.java) | ||
register(SuspendedTextOutputCallback::class.java) | ||
register(ReCaptchaCallback::class.java) | ||
register(ConsentMappingCallback::class.java) | ||
register(HiddenValueCallback::class.java) | ||
register(DeviceProfileCallback::class.java) | ||
register(MetadataCallback::class.java) | ||
register(WebAuthnRegistrationCallback::class.java) | ||
register(WebAuthnAuthenticationCallback::class.java) | ||
register(SelectIdPCallback::class.java) | ||
register(IdPCallback::class.java) | ||
register(DeviceBindingCallback::class.java) | ||
register(DeviceSigningVerifierCallback::class.java) | ||
register(AppIntegrityCallback::class.java) | ||
} | ||
|
||
/** | ||
* Register new Callback Class | ||
* | ||
* @param callback The callback Class | ||
*/ | ||
fun register(callback: Class<out Callback>) { | ||
try { | ||
callbacks[getType(callback)] = callback | ||
} catch (e: Exception) { | ||
error(TAG, e, e.message) | ||
} | ||
} | ||
|
||
@Throws(InstantiationException::class, IllegalAccessException::class) | ||
fun getType(callback: Class<out Callback>): String { | ||
return callback.getDeclaredConstructor().newInstance().type | ||
} | ||
|
||
fun getCallbacks(): Map<String, Class<out Callback>> { | ||
return callbacks | ||
} | ||
|
||
companion object { | ||
private val TAG = CallbackFactory::class.java.simpleName | ||
|
||
private val INSTANCE = CallbackFactory() | ||
|
||
/** | ||
* Returns a cached instance [CallbackFactory] | ||
* | ||
* @return instance of [CallbackFactory] | ||
*/ | ||
@JvmStatic fun getInstance(): CallbackFactory { | ||
return INSTANCE | ||
} | ||
|
||
} | ||
} |
This file contains 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 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 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Aug 16 10:44:41 PDT 2021 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
This file contains 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 @@ | ||
/build |
This file contains 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,54 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.android") | ||
} | ||
|
||
android { | ||
namespace = "org.forgerock.android.protect" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 23 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
|
||
testOptions.unitTests.isIncludeAndroidResources = true | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
dependencies { | ||
api(project(":forgerock-auth")) | ||
implementation("com.pingidentity.signals:android-sdk:5.1.2") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2") | ||
|
||
testImplementation("org.robolectric:robolectric:4.9.2") | ||
testImplementation("junit:junit:4.13.2") | ||
testImplementation("androidx.test:core:1.5.0") | ||
testImplementation("androidx.test.ext:junit:1.1.5") | ||
testImplementation("androidx.test:runner:1.5.2") | ||
|
||
//Mockk | ||
testImplementation("io.mockk:mockk:1.13.9") | ||
|
||
androidTestImplementation("androidx.test.ext:junit:1.1.5") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") | ||
} |
Empty file.
This file contains 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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
ping-protect/src/androidTest/java/org/forgerock/android/auth/ExampleInstrumentedTest.kt
This file contains 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,24 @@ | ||
package org.forgerock.android.auth | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("org.forgerock.android.auth.test", appContext.packageName) | ||
} | ||
} |
This file contains 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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright (c) 2023 ForgeRock. 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> | ||
<provider | ||
android:name="org.forgerock.android.auth.PingOneProvider" | ||
android:enabled="true" | ||
android:exported="false" | ||
android:authorities="${applicationId}.PingOneProvider" /> | ||
</application> | ||
</manifest> |
Oops, something went wrong.