bitwarden / ios

Bitwarden mobile app for iOS.
https://bitwarden.com
GNU General Public License v3.0
140 stars 12 forks source link

[PM-10542] Handle TOTP codes with empty or whitespace-only keys #835

Closed KatherineInCode closed 4 weeks ago

KatherineInCode commented 4 weeks ago

๐ŸŽŸ๏ธ Tracking

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

๐Ÿ“” Objective

When a TOTP was removed from a login entry that had one, the app was saving the TOTP as an empty string rather than nil; as well, if asked to generate a code for an empty string, it would assume it a valid key and generate it. This change adjusts this so that empty and whitespace-only strings coalesce into nil values. Some tests around this are also added.

โฐ Reminders before review

๐Ÿฆฎ Reviewer guidelines

github-actions[bot] commented 4 weeks ago

Logo Checkmarx One โ€“ Scan Summary & Details โ€“ a29157e9-5a23-496f-8bc2-237c90cc6532

No New Or Fixed Issues Found

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.50%. Comparing base (450808c) to head (c067fd7). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #835 +/- ## ======================================= Coverage 88.50% 88.50% ======================================= Files 599 599 Lines 30214 30214 ======================================= Hits 26742 26742 Misses 3472 3472 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.