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

[PM-8216] Add warning to people who don't have two-factor authentication turned on #1208

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

KatherineInCode
Copy link
Contributor

@KatherineInCode KatherineInCode commented Dec 13, 2024

🎟️ Tracking

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

📔 Objective

This is still a work in progress; I have it set up as a draft to help me track things as I tie up the remaining problems and do some additional refactoring. Some of these changes will be pulled into other PRs for simplicity.

📸 Screenshots

⏰ 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

@KatherineInCode KatherineInCode changed the title Pm 8216/tfa warning [PM-8216] Add warning to people who don't have two-factor authentication turned on Dec 13, 2024
Copy link
Contributor

github-actions bot commented Dec 13, 2024

Logo
Checkmarx One – Scan Summary & Detailsb69c64c9-f56e-4955-b251-7a21b15976dc

No New Or Fixed Issues Found

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 98.97698% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.59%. Comparing base (05dd571) to head (cdf4477).

Files with missing lines Patch % Lines
...ctorNotice/SetUpTwoFactor/SetUpTwoFactorView.swift 93.65% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1208      +/-   ##
==========================================
+ Coverage   89.51%   89.59%   +0.08%     
==========================================
  Files         699      709      +10     
  Lines       44556    44947     +391     
==========================================
+ Hits        39884    40271     +387     
- Misses       4672     4676       +4     

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

@KatherineInCode KatherineInCode marked this pull request as ready for review December 19, 2024 20:38
.buttonStyle(.secondary())
}

Spacer()
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 Is this Spacer() necessary? It seems like this could be for pushing up the content, but the content in the scroll view should already be at the top? Or if it's just padding, I think the scroll view modifier also adds bottom padding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the time I had it in there, I needed it to get things pinned to the top, but I also changed around how this view was constructed since then. I'll double-check.

.buttonStyle(.primary())
}
.dynamicTypeSize(...DynamicTypeSize.xxxLarge)
.padding(.horizontal, 16)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 I think this might be adding double horizontal padding, since the scrollView() modifier also adds horizontal padding. scrollView() also adds the background color.

Comment on lines +19 to +20
/// The delegate for this coordinator, used to notify when the user logs out.
private weak var delegate: VaultCoordinatorDelegate?
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 Is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, copy-paste artifact :(

/// the two-factor notice, and displaying it if so.
///
protocol TwoFactorNoticeHelper {
///
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Missing docs?

Text(LocalizedStringKey(Localizations.doYouHaveReliableAccessToYourEmail("person\u{2060}@example.com")))
.styleGuide(.body)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)
.accessibilityHidden(true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Why hide this from accessibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 I'm not sure where that came from. Probably a copy-paste thing? But yeah, I don't think it should be hidden

send: EmailAccessAction.canAccessEmailChanged
))
.toggleStyle(.bitwarden)
.accessibilityIdentifier("ItemFavoriteToggle")
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Is this the right accessibility identifier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hah, probably not. Thanks copy-paste!

Comment on lines +45 to +49
func test_remindMeLater_tap() throws {
let button = try subject.inspect().find(button: Localizations.remindMeLater)
try button.tap()

waitFor(!processor.effects.isEmpty)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎨 This could use find(asyncButton:) to avoid waiting.

"NothingAvailableToAutofill" = "Nothing available to autofill";
"FailedToGenerateVerificationCode" = "Failed to generate verification code";
"FailedToAutofillItem" = "Failed to autofill item %1$@";
"ExportingFailed" = "Exporting failed";
"YouMayNeedToEnableDevicePasscodeOrBiometrics" = "You may need to enable device passcode or biometrics.";
"TurnOnTwoStepLoginConfirmation" = "You can turn on two-step login on the bitwarden.com web vault. Do you want to visit the website now?";
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Should bitwarden.com here be replaced with the user's web vault URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 I was going off of the fact that the change email confirmation just says bitwarden.com. That's a good question, though.

Comment on lines +55 to +57
case .changeAccountEmailTapped:
coordinator.showAlert(.changeEmailAlert {
self.state.url = self.services.environmentService.changeEmailURL
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ If I navigate to the web to turn on two-factor and then come back to the app, will I still be on this screen? How do you dismiss the view in that case? Or does enabling two-factor log you out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a discussion about this on the Android ticket, but the end result is right now the user will need to kill and re-run the app to pick up on the change.

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