[PR #5955] [PM-23278] Upgrade user KDF settings to minimums #6181

Closed
opened 2025-11-27 00:20:39 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/5955

State: closed
Merged: Yes


Note

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

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-23278
https://bitwarden.atlassian.net/browse/PM-23577

📔 Objective

This pull request introduces functionality to ensure user KDF (Key Derivation Function) settings meet minimum security requirements. It adds logic to check if an account's KDF configuration is outdated and, if so, updates it automatically after password unlock, provided the relevant feature flag is enabled. The changes also include necessary model, service, and dependency updates to support this workflow.

KDF Minimums Enforcement and Update Workflow

  • Added new methods to AuthRepository and AuthRepositoryImpl to check if a user's KDF settings are below the minimum and to update them if needed, including integration with a feature flag (ForceUpdateKdfSettings). [1] [2]
  • Automatically triggers KDF update after password unlock if the user's settings are outdated and the feature flag is enabled.

Model and SDK Support

  • Introduced UpdateKdfMinimumsResult sealed class to model the result of updating KDF settings.
  • Added makeUpdateKdf method to VaultSdkSource and its implementation to generate updated KDF data using the SDK. [1] [2]
  • Added extension function toKdfRequestModel to convert SDK KDF objects to network request models.

Dependency Injection and Feature Flag Integration

  • Updated DI module (AuthRepositoryModule) to provide FeatureFlagManager to AuthRepositoryImpl. [1] [2] [3]

📸 Screenshots

https://github.com/user-attachments/assets/fadacc0a-2c75-49fa-9172-b5e04fe76979

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
**Original Pull Request:** https://github.com/bitwarden/android/pull/5955 **State:** closed **Merged:** Yes --- > [!NOTE] > Depends on PR: https://github.com/bitwarden/android/pull/5944 ## 🎟️ 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-23278 https://bitwarden.atlassian.net/browse/PM-23577 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> This pull request introduces functionality to ensure user KDF (Key Derivation Function) settings meet minimum security requirements. It adds logic to check if an account's KDF configuration is outdated and, if so, updates it automatically after password unlock, provided the relevant feature flag is enabled. The changes also include necessary model, service, and dependency updates to support this workflow. **KDF Minimums Enforcement and Update Workflow** * Added new methods to `AuthRepository` and `AuthRepositoryImpl` to check if a user's KDF settings are below the minimum and to update them if needed, including integration with a feature flag (`ForceUpdateKdfSettings`). [[1]](diffhunk://#diff-244d60798bc7c42ddc79023019fbb5a176aee94e424a594ff0c5cb597278031dR355-R364) [[2]](diffhunk://#diff-ae5f127fe7d307dcd51856e300d493864975cc1e63f8c1b9192e62fd8890bb75R1246-R1347) * Automatically triggers KDF update after password unlock if the user's settings are outdated and the feature flag is enabled. **Model and SDK Support** * Introduced `UpdateKdfMinimumsResult` sealed class to model the result of updating KDF settings. * Added `makeUpdateKdf` method to `VaultSdkSource` and its implementation to generate updated KDF data using the SDK. [[1]](diffhunk://#diff-bc38f23e72696d977701f709d191ce920aaa5e04543c04eaae5171b3d5c5d505R495-R503) [[2]](diffhunk://#diff-39f0a2dfbe9a72ed11b2695853b67ccec43d5030d22763a2f1b2db638a16116aR10) * Added extension function `toKdfRequestModel` to convert SDK KDF objects to network request models. **Dependency Injection and Feature Flag Integration** * Updated DI module (`AuthRepositoryModule`) to provide `FeatureFlagManager` to `AuthRepositoryImpl`. [[1]](diffhunk://#diff-07bf629e29ffd49d7c2493930e79ad1bf5f434c11a10e750ac5aba381668bc95R21) [[2]](diffhunk://#diff-07bf629e29ffd49d7c2493930e79ad1bf5f434c11a10e750ac5aba381668bc95R71) [[3]](diffhunk://#diff-07bf629e29ffd49d7c2493930e79ad1bf5f434c11a10e750ac5aba381668bc95R96) ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> https://github.com/user-attachments/assets/fadacc0a-2c75-49fa-9172-b5e04fe76979 ## ⏰ 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
GiteaMirror added the pull-request label 2025-11-27 00:20:39 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#6181