[PR #6052] [MERGED] [PM-26420] Add flight recorder logs for vault unlock method and PIN migration #36770

Closed
opened 2026-04-21 03:54:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6052
Author: @andrebispo5
Created: 10/20/2025
Status: Merged
Merged: 10/20/2025
Merged by: @andrebispo5

Base: mainHead: pm-26420/pin-migration-flight-recorder


📝 Commits (10+)

  • b2e1dd1 [PM-23290] Add pinProtectedUserKeyEnvelope to AuthDiskSource.
  • 1d56f8b [PM-23290] Replace derive pin sdk calls to new enroll pin
  • fc0be54 [PM-23290] Use new PinEnvelope to unlock if available and maintain legacy support.
  • d51913d [PM-23290] Replace derivePin with enrollPin when setting up pin.
  • b26e13b [PM-23290] Change references of pinProtectedUserKey to pinProtectedUserKeyEnvelope
  • aea176a [PM-23290] Migrate user Pin on vault unlock.
  • 14f0546 Merge branch 'main' into pm-23290/migrate-pinprotecteduserkey
  • 6db2a1c [PM-23290] Update tests
  • 32260cb [PM-23290] Add PR suggestions.
  • 5a4538f [PM-23290] Fix storePinProtectedUserKey inMemoryOnly assignment.

📊 Changes

4 files changed (+64 additions, -5 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/KdfManagerImpl.kt (+2 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt (+18 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt (+25 -3)
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/InitUserCryptoMethodExtensions.kt (+19 -0)

📄 Description

Note

Depends on PR: https://github.com/bitwarden/android/pull/6024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-25990

📔 Objective

Unlock and PIN migration improvements:

  • The functions migratePinProtectedUserKeyIfNeeded in VaultLockManagerImpl and deriveTemporaryPinProtectedUserKeyIfNecessary in VaultRepositoryImpl now accept an initUserCryptoMethod parameter, allowing them to log and handle the unlock method used.
  • Added logging statements to record the vault unlock method and the outcome of PIN-protected user key migration or derivation, improving traceability and debugging.

Utility and code organization:

  • Introduced a new extension function InitUserCryptoMethod.methodName() in InitUserCryptoMethodExtensions.kt to provide human-readable labels for each unlock method, used in logging.

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6052 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 10/20/2025 **Status:** ✅ Merged **Merged:** 10/20/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-26420/pin-migration-flight-recorder` --- ### 📝 Commits (10+) - [`b2e1dd1`](https://github.com/bitwarden/android/commit/b2e1dd126145c93c263a902cb87bbba44b963883) [PM-23290] Add pinProtectedUserKeyEnvelope to AuthDiskSource. - [`1d56f8b`](https://github.com/bitwarden/android/commit/1d56f8b0d83bce9cd641c9fa37bf330814d35ca4) [PM-23290] Replace derive pin sdk calls to new enroll pin - [`fc0be54`](https://github.com/bitwarden/android/commit/fc0be54a241072d08fab20589233bd11fff675c4) [PM-23290] Use new PinEnvelope to unlock if available and maintain legacy support. - [`d51913d`](https://github.com/bitwarden/android/commit/d51913d617c094838ac38499480b5f6b54639ad2) [PM-23290] Replace derivePin with enrollPin when setting up pin. - [`b26e13b`](https://github.com/bitwarden/android/commit/b26e13befa8472bf3a8c5488fead01a432d416db) [PM-23290] Change references of pinProtectedUserKey to pinProtectedUserKeyEnvelope - [`aea176a`](https://github.com/bitwarden/android/commit/aea176a819bd40ffefceec59a30f80cf67ba543d) [PM-23290] Migrate user Pin on vault unlock. - [`14f0546`](https://github.com/bitwarden/android/commit/14f05468c6dc187442da6bc95708a2a099103093) Merge branch 'main' into pm-23290/migrate-pinprotecteduserkey - [`6db2a1c`](https://github.com/bitwarden/android/commit/6db2a1cd5cb175ce5db48962dc0b5be777614f95) [PM-23290] Update tests - [`32260cb`](https://github.com/bitwarden/android/commit/32260cbeac9cb28591ca539a7d6d69def1d93c12) [PM-23290] Add PR suggestions. - [`5a4538f`](https://github.com/bitwarden/android/commit/5a4538f5e55c76f52f3a8f36dd549b8e0ccf3671) [PM-23290] Fix storePinProtectedUserKey inMemoryOnly assignment. ### 📊 Changes **4 files changed** (+64 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/KdfManagerImpl.kt` (+2 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt` (+18 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt` (+25 -3) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/InitUserCryptoMethodExtensions.kt` (+19 -0) </details> ### 📄 Description > [!NOTE] > Depends on PR: https://github.com/bitwarden/android/pull/6024 ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-25990 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> **Unlock and PIN migration improvements:** * The functions `migratePinProtectedUserKeyIfNeeded` in `VaultLockManagerImpl` and `deriveTemporaryPinProtectedUserKeyIfNecessary` in `VaultRepositoryImpl` now accept an `initUserCryptoMethod` parameter, allowing them to log and handle the unlock method used. * Added logging statements to record the vault unlock method and the outcome of PIN-protected user key migration or derivation, improving traceability and debugging. **Utility and code organization:** * Introduced a new extension function `InitUserCryptoMethod.methodName()` in `InitUserCryptoMethodExtensions.kt` to provide human-readable labels for each unlock method, used in logging. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-21 03:54:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#36770