Skip to content

[PM-12391] Respect PIN unlock setting during FIDO user verification #4483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

SaintPatrck
Copy link
Contributor

🎟️ Tracking

PM-12391

📔 Objective

Check the isUnlockWithPinEnabled setting instead of checking the vaultUnlockType of the active account to determine if a PIN prompt should be shown.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Logo
Checkmarx One – Scan Summary & Details45cb27ec-5afa-4e91-9d3a-42588e8ab8b6

No New Or Fixed Issues Found

@SaintPatrck SaintPatrck force-pushed the PM-12391/pin-creation-prompt-during-fido2-uv branch from 7d39dfa to 857fff3 Compare December 18, 2024 15:20
Check the `isUnlockWithPinEnabled` setting instead of checking the `vaultUnlockType` of the active account to determine if a PIN prompt should be shown.
@SaintPatrck SaintPatrck force-pushed the PM-12391/pin-creation-prompt-during-fido2-uv branch from 857fff3 to db7fa73 Compare December 19, 2024 18:48
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (3329dfa) to head (db7fa73).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4483   +/-   ##
=======================================
  Coverage   88.91%   88.91%           
=======================================
  Files         455      455           
  Lines       39558    39558           
  Branches     5605     5605           
=======================================
  Hits        35173    35173           
  Misses       2428     2428           
  Partials     1957     1957           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dseverns-livefront dseverns-livefront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for this fix and seems to be inline with how we are checking this elsewhere. I am wondering if we should update this in AuthRepositoryImpl

// from 
private fun getVaultUnlockType(
        userId: String,
    ): VaultUnlockType =
        when {
            authDiskSource.getPinProtectedUserKey(userId = userId) != null -> {
                VaultUnlockType.PIN
            }

            else -> {
                VaultUnlockType.MASTER_PASSWORD
            }
        }

// to 
private fun getVaultUnlockType(
        userId: String,
    ): VaultUnlockType =
        when {
            authDiskSource.getEncryptedPin(userId = userId) != null -> {
                VaultUnlockType.PIN
            }


            else -> {
                VaultUnlockType.MASTER_PASSWORD
            }
        }

since that seems to be the delta on why that value was not working when getting from the user state vs the settings repository. I am not sure if there is a specific reason for this difference though so may be safer to not touch it for this change.

@SaintPatrck
Copy link
Contributor Author

I like that suggestion. Like you say, we'll need to make sure it doesn't have any negative downstream effects. I'll create a ticket to revisit this for a broader improvement later and we can go forward with this fix in the interim.

@SaintPatrck SaintPatrck added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit d9c0911 Dec 20, 2024
8 checks passed
@SaintPatrck SaintPatrck deleted the PM-12391/pin-creation-prompt-during-fido2-uv branch December 20, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants