fix: Passkey workflow

This commit is contained in:
J-Jamet
2025-09-17 20:02:55 +02:00
parent 1e7e464e65
commit 0aecc21f43
4 changed files with 592 additions and 419 deletions

View File

@@ -44,12 +44,19 @@ data class AppOrigin(
this.webOrigins.add(webOrigin)
}
/**
* Determine whether at least one signature is present in the Android origins
*/
fun containsAndroidOriginSignature(): Boolean {
return androidOrigins.any { !it.fingerprint.isNullOrEmpty() }
}
/**
* Verify the app origin by comparing it to the list of android origins,
* return the first verified origin or throw an exception if none is found
*/
fun checkAppOrigin(compare: AppOrigin): String {
if (compare.androidOrigins.isNotEmpty()) {
if (compare.containsAndroidOriginSignature().not()) {
throw SignatureNotFoundException(this, "Android origin not found")
}
return androidOrigins.firstOrNull { androidOrigin ->