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

feat(suite): change copy for Device authentication ghost modal #16737

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

Lemonexe
Copy link
Contributor

@Lemonexe Lemonexe commented Jan 30, 2025

Description

Followup to #16599 - make subtitle copies consistent for FW revcheck, FW hashcheck-mismatch, and now also device authenticity. Or "authentication", as I just learned is the official term 🧐

Screenshots:

Device authentication failure during onboarding
image

Device authentication failure prompted by button in Settings > Device
image

Summary by CodeRabbit

  • New Features

    • Added a new error message for device authentication failure.
    • Enhanced security check failure modal with additional context about device authentication issues.
  • Documentation

    • Added localized message for device authentication failure scenario.

The changes improve user awareness and provide clearer information when a device authentication check fails.

@Lemonexe Lemonexe added the no-project This label is used to specify that PR doesn't need to be added to a project label Jan 30, 2025
Copy link

coderabbitai bot commented Jan 30, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

error Error: http://10.0.0.28:4873/@trezor%2feslint: no such package available
at params.callback [as _callback] (/opt/yarn-v1.22.22/lib/cli.js:66685:18)
at self.callback (/opt/yarn-v1.22.22/lib/cli.js:141415:22)
at Request.emit (node:events:519:28)
at Request. (/opt/yarn-v1.22.22/lib/cli.js:142387:10)
at Request.emit (node:events:519:28)
at IncomingMessage. (/opt/yarn-v1.22.22/lib/cli.js:142309:12)
at Object.onceWrapper (node:events:633:28)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1698:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Walkthrough

This pull request enhances the device authentication failure handling in the Trezor Suite application. The changes involve adding a new localized message for device authentication failures and updating the SecurityCheckFail component across multiple files to include an additional text prop. This modification provides more contextual information when a device authentication check fails, improving user communication regarding potential device security issues.

Changes

File Change Summary
packages/suite/src/support/messages.ts Added new localization message TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT with default message 'Your device authentication check failed.'
packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx Updated SecurityCheckFail component call to include new text prop
packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx Modified SecurityCheckFail component to accept new text prop

Possibly related PRs

Suggested reviewers

  • komret
  • peter-sanderson

Poem

🐰 A Rabbit's Security Tale 🔒

When devices fail their trusty test,
A message springs forth with zeal and zest.
"Authentication check did not pass!"
Our warning rings out with digital class,
Keeping Trezor's security first-rate,
Ensuring users navigate with fate.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e10610 and 0368e47.

📒 Files selected for processing (3)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx (1 hunks)
  • packages/suite/src/support/messages.ts (1 hunks)
  • packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx
  • packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx
  • packages/suite/src/support/messages.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: build-web
  • GitHub Check: build-web

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Lemonexe Lemonexe marked this pull request as ready for review January 30, 2025 17:11
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx (1)

116-119: LGTM! Consider extracting the translation key as a constant.

The text prop addition maintains consistency with AuthenticateDeviceFailModal.tsx. Consider extracting "TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT" as a constant since it's used in multiple components.

+const DEVICE_AUTHENTICITY_FAIL_MESSAGE = 'TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT';
+
 export const DeviceAuthenticity = ({ goToNext }: DeviceAuthenticityProps) => {
     // ...
     if (isCheckFailed) {
         return (
             <StyledCard>
                 <SecurityCheckFail
                     supportUrl={TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL}
-                    text="TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT"
+                    text={DEVICE_AUTHENTICITY_FAIL_MESSAGE}
                 />
             </StyledCard>
         );
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70e6c68 and 7e10610.

📒 Files selected for processing (3)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx (1 hunks)
  • packages/suite/src/support/messages.ts (1 hunks)
  • packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: e2e-test-suite-web (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: e2e-test-suite-web (@group=other, trezor-user-env-unix)
  • GitHub Check: e2e-test-suite-web (@group=metadata, trezor-user-env-unix)
  • GitHub Check: e2e-test-suite-web (@group=settings, trezor-user-env-unix)
  • GitHub Check: e2e-test-suite-web (@group=device-management, trezor-user-env-unix)
  • GitHub Check: e2e-test-suite-web (@group=suite, trezor-user-env-unix)
  • GitHub Check: e2e-test-suite-web (@group_wallet, trezor-user-env-unix bitcoin-regtest, 1)
  • GitHub Check: e2e-test-suite-web (@group_other, trezor-user-env-unix, 1)
  • GitHub Check: e2e-test-suite-web (@group_passphrase, trezor-user-env-unix, 1)
  • GitHub Check: e2e-test-suite-web (@group_device-management, trezor-user-env-unix, 1)
  • GitHub Check: e2e-test-suite-web (@group_suite, trezor-user-env-unix, 1)
  • GitHub Check: Linting and formatting
  • GitHub Check: Type Checking
  • GitHub Check: Unit Tests
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (2)
packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx (1)

14-17: LGTM! Verify translation key exists.

The addition of the text prop with the translation key aligns with the PR objectives for consistent device authentication messaging.

Let's verify the translation key exists:

✅ Verification successful

Translation key verified and properly implemented

The key TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT exists in the messages file with appropriate default text and is consistently used across device authentication components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the translation key in messages files
rg "TR_DEVICE_COMPROMISED_DEVICE_AUTHENTICITY_TEXT" -A 2

Length of output: 1170

packages/suite/src/support/messages.ts (1)

6881-6884: LGTM! Critical security message added for device authentication failures.

The new message is clear, concise and appropriately communicates the security issue to users without causing unnecessary panic.

@Lemonexe Lemonexe force-pushed the device-authenticity-ghost-modal-copy branch from 7e10610 to 0368e47 Compare January 30, 2025 17:28
@Lemonexe Lemonexe merged commit c53ad7a into develop Feb 4, 2025
32 checks passed
@Lemonexe Lemonexe deleted the device-authenticity-ghost-modal-copy branch February 4, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-project This label is used to specify that PR doesn't need to be added to a project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants