Skip to content
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

BIT-2076: Take minimum password length into account with slider #534

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

KatherineInCode
Copy link
Contributor

🎟️ Tracking

BIT-2076 - Generator Minimum Length Pop Up Error Behavior

🚧 Type of change

  • 🐛 Bug fix

📔 Objective

In the event that a user did not have an enterprise policy enforcing a minimum password limit but had their own constraints that meant a higher minimum password length, it was possible to move the password generator length slider in such a way that it would try to generate a password under the minimum password length, causing an error.

This fix obviates that problem by making the slider take into account the user's chosen minimum password length.

Another fix discussed was to include a Task.checkCancellation() before generating the password, but doing that had other effects on the tests that might be harder to work around.

📋 Code changes

  • GeneratorState+PasswordState.swift: Move the calculation of minimum length based on constraints into a calculated property
  • GeneratorState.swift: Factor in the minimum length based on constraints when determining if the length slider should move

⏰ 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

1 Warning
⚠️ Ignoring duplicate libraries: '-lbitwarden_uniffi'

Bitwarden code coverage

Total coverage: 86.36%

File Coverage
BitwardenShared/UI/Tools/Generator/Generator/GeneratorState+PasswordState.swift 100.00%
BitwardenShared/UI/Tools/Generator/Generator/GeneratorState.swift 99.70%

Powered by Slather

Generated by 🚫 Danger

@bitwarden-bot
Copy link

bitwarden-bot commented Mar 18, 2024

Logo
Checkmarx One – Scan Summary & Details51fb8fb4-b4ed-404a-887b-50b43d75e6da

No New Or Fixed Issues Found

Copy link
Collaborator

@matt-livefront matt-livefront left a comment

Choose a reason for hiding this comment

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

Looks good!

@KatherineInCode KatherineInCode merged commit 92cc69b into main Mar 19, 2024
6 checks passed
@KatherineInCode KatherineInCode deleted the kbertelsen/BIT-2076-generator-slider-error branch March 19, 2024 15:19
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.

3 participants