Compare commits

...

2 Commits

Author SHA1 Message Date
Patrick Honkonen
0ee3e2e249 🍒 [PM-31446] fix:Append assetlinks.json path to DAL URLs (#6449) 2026-01-30 18:55:48 +00:00
David Perez
58f4983790 🍒 PM-31363: Fix crash caused by a duplicate ID (#6430) 2026-01-28 19:01:47 +00:00
4 changed files with 21 additions and 11 deletions

View File

@@ -50,6 +50,8 @@ import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import timber.log.Timber
private const val DAL_ROUTE = ".well-known/assetlinks.json"
/**
* Primary implementation of [BitwardenCredentialManager].
*/
@@ -123,7 +125,7 @@ class BitwardenCredentialManagerImpl(
.getSignatureFingerprintAsHexString()
.orEmpty(),
host = hostUrl,
assetLinkUrl = hostUrl,
assetLinkUrl = hostUrl.toDigitalAssetLinkUrl(),
),
)
}
@@ -316,7 +318,7 @@ class BitwardenCredentialManagerImpl(
packageName = callingAppInfo.packageName,
sha256CertFingerprint = signatureFingerprint,
host = host,
assetLinkUrl = host,
assetLinkUrl = host.toDigitalAssetLinkUrl(),
),
)
@@ -428,6 +430,13 @@ class BitwardenCredentialManagerImpl(
?.relyingParty
?.id
?.prefixHttpsIfNecessaryOrNull()
private fun String.toDigitalAssetLinkUrl(): String =
when {
this.endsWith(DAL_ROUTE) -> this
this.endsWith("/") -> "$this$DAL_ROUTE"
else -> "$this/$DAL_ROUTE"
}
}
private const val MAX_AUTHENTICATION_ATTEMPTS = 5

View File

@@ -160,7 +160,7 @@ fun VaultItemListingContent(
itemsIndexed(
items = state.displayCollectionList,
key = { _, collection -> collection.id },
key = { _, collection -> "collection_${collection.id}" },
) { index, collection ->
BitwardenGroupItem(
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_collections),
@@ -195,7 +195,7 @@ fun VaultItemListingContent(
itemsIndexed(
items = state.displayFolderList,
key = { _, folder -> folder.id },
key = { _, folder -> "folder_${folder.id}" },
) { index, folder ->
BitwardenGroupItem(
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_folder),
@@ -229,7 +229,7 @@ fun VaultItemListingContent(
}
itemsIndexed(
items = state.displayItemList,
key = { _, item -> item.id },
key = { _, item -> "item_${item.id}" },
) { index, it ->
BitwardenListItem(
startIcon = it.iconData,

View File

@@ -142,7 +142,7 @@ fun VaultContent(
itemsIndexed(
items = state.favoriteItems,
key = { _, favorite -> favorite.id },
key = { _, favorite -> "favorite_${favorite.id}" },
) { index, favoriteItem ->
VaultEntryListItem(
startIcon = favoriteItem.startIcon,
@@ -307,7 +307,7 @@ fun VaultContent(
itemsIndexed(
items = state.folderItems,
key = { _, folder -> folder.id ?: "no_folder_group" },
key = { _, folder -> "folder_${folder.id}" },
) { index, folder ->
BitwardenGroupItem(
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_folder),
@@ -344,7 +344,7 @@ fun VaultContent(
}
itemsIndexed(
items = state.noFolderItems,
key = { _, noFolderItem -> noFolderItem.id },
key = { _, noFolderItem -> "no_folder_${noFolderItem.id}" },
) { index, noFolderItem ->
VaultEntryListItem(
startIcon = noFolderItem.startIcon,
@@ -400,7 +400,7 @@ fun VaultContent(
itemsIndexed(
items = state.collectionItems,
key = { _, collection -> collection.id },
key = { _, collection -> "collection_${collection.id}" },
) { index, collection ->
BitwardenGroupItem(
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_collections),

View File

@@ -681,7 +681,8 @@ class BitwardenCredentialManagerTest {
DEFAULT_PACKAGE_NAME,
DEFAULT_CERT_FINGERPRINT,
"https://${mockAssertionOptions.relyingPartyId!!}",
"https://${mockAssertionOptions.relyingPartyId}",
@Suppress("MaxLineLength")
"https://${mockAssertionOptions.relyingPartyId}/.well-known/assetlinks.json",
),
),
requestCaptureSlot.captured.origin,
@@ -1499,7 +1500,7 @@ private val DEFAULT_ANDROID_ORIGIN = Origin.Android(
packageName = DEFAULT_PACKAGE_NAME,
sha256CertFingerprint = DEFAULT_CERT_FINGERPRINT,
host = "https://$DEFAULT_HOST",
assetLinkUrl = "https://$DEFAULT_HOST",
assetLinkUrl = "https://$DEFAULT_HOST/.well-known/assetlinks.json",
),
)
private val DEFAULT_WEB_ORIGIN = Origin.Web("bitwarden.com")