Merge branch 'main' into adamve/unify_set_device_info

This commit is contained in:
Adam Velebil 2024-04-05 15:58:17 +02:00
commit 6feefba23e
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
5 changed files with 15 additions and 12 deletions

View File

@ -408,7 +408,7 @@ class FidoManager(
(credentialData.user["id"] as ByteArray).asString(),
credentialData.user["name"] as String,
publicKeyCredentialDescriptor = credentialData.credentialId,
displayName = credentialData.user["displayName"] as String,
displayName = credentialData.user["displayName"] as String?,
)
}
}.reduceOrNull { credentials, credentialList ->

View File

@ -31,7 +31,7 @@ data class FidoCredential(
@SerialName("user_name")
val userName: String,
@SerialName("display_name")
val displayName: String,
val displayName: String?,
@Transient
val publicKeyCredentialDescriptor: Map<String, Any?> = emptyMap()
)

View File

@ -53,13 +53,16 @@ data class SessionInfo(
@SerialName("min_pin_length")
val minPinLength: Int,
@SerialName("force_pin_change")
val forcePinChange: Boolean
val forcePinChange: Boolean,
@SerialName("remaining_disc_creds")
val remainingDiscoverableCredentials: Int?
) {
constructor(infoData: InfoData) : this(
Options(infoData),
infoData.aaguid,
infoData.minPinLength,
infoData.forcePinChange
infoData.forcePinChange,
infoData.remainingDiscoverableCredentials
)
override fun equals(other: Any?): Boolean {
@ -71,7 +74,10 @@ data class SessionInfo(
if (options != other.options) return false
if (!aaguid.contentEquals(other.aaguid)) return false
if (minPinLength != other.minPinLength) return false
return forcePinChange == other.forcePinChange
if (forcePinChange != other.forcePinChange) return false
if (remainingDiscoverableCredentials != other.remainingDiscoverableCredentials) return false
return true
}
override fun hashCode(): Int {
@ -79,6 +85,7 @@ data class SessionInfo(
result = 31 * result + aaguid.contentHashCode()
result = 31 * result + minPinLength
result = 31 * result + forcePinChange.hashCode()
result = 31 * result + (remainingDiscoverableCredentials ?: 0)
return result
}

View File

@ -93,12 +93,8 @@ Future<Widget> initialize() async {
]),
// this specifies the priority of sections to show when
// the connected YubiKey does not support current section
androidSectionPriority.overrideWithValue([
Section.accounts,
Section.fingerprints,
Section.passkeys,
Section.home
]),
androidSectionPriority.overrideWithValue(
[Section.accounts, Section.fingerprints, Section.passkeys]),
supportedThemesProvider.overrideWith(
(ref) => ref.watch(androidSupportedThemesProvider),
),

View File

@ -121,7 +121,7 @@ class AndroidCurrentSectionNotifier extends CurrentSectionNotifier {
AndroidCurrentSectionNotifier(
this._supportedSectionsByPriority,
this._appContextHandler,
) : super(Section.accounts);
) : super(Section.home);
@override
void setCurrentSection(Section section) {