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-17531] Add dialog for client certificate import #4622

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

SaintPatrck
Copy link
Contributor

@SaintPatrck SaintPatrck commented Jan 24, 2025

🎟️ Tracking

PM-17531
Relates to #4486

📔 Objective

This commit introduces a new dialog for importing client certificates. The dialog prompts the user to enter the certificate password and alias.

📸 Screenshots

image

⏰ 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 Jan 24, 2025

Logo
Checkmarx One – Scan Summary & Details1b2a9f3b-d760-4389-ad56-a936b47ea9bf

Great job, no security vulnerabilities found in this Pull Request

value = password,
onValueChange = { password = it },
modifier = Modifier
.testTag("AlertClientCertificatePasswordInputField")
Copy link
Collaborator

Choose a reason for hiding this comment

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

For both the this and the BitwardenTextField above, we need to use the textFieldTestTag and passwordFieldTestTag instead of the modifier directly. You may need to rebase, for the password one as it is new

label = stringResource(R.string.alias),
value = alias,
onValueChange = { alias = it },
modifier = Modifier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we put the modifier at the bottom?

@Composable
fun BitwardenClientCertificateDialog(
onConfirmClick: (alias: String, password: String) -> Unit,
onDismissRequest: () -> Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a modifier parameter with default here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've not done that in other dialogs that use AlertDialog, that I can see. Is that something we need to start enforcing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔

Maybe dialogs are the exception. Carry on without I guess 😄

@SaintPatrck SaintPatrck force-pushed the PM-17531/tls-import-dialogs branch from afdb921 to 2dc773d Compare January 24, 2025 18:32
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.39%. Comparing base (3a6db38) to head (aad081d).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4622   +/-   ##
=======================================
  Coverage   88.39%   88.39%           
=======================================
  Files         603      603           
  Lines       40905    40905           
  Branches     5755     5755           
=======================================
  Hits        36160    36160           
  Misses       2742     2742           
  Partials     2003     2003           

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

value = alias,
onValueChange = { alias = it },
autoFocus = true,
cardStyle = CardStyle.Top(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this divider should have padding set to 0, since the content is a text field.

value = password,
onValueChange = { password = it },
cardStyle = CardStyle.Bottom,
textFieldTestTag = "AlertClientCertificatePasswordInputField",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

modifier = Modifier.testTag("AlertContentText"),
)

Spacer(modifier = Modifier.height(8.dp))
Copy link
Collaborator

@david-livefront david-livefront Jan 24, 2025

Choose a reason for hiding this comment

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

I believe the spacing between text and a card is 24dp, might be 16dp but I'm pretty sure it was 24dp

This commit introduces a new dialog for importing client certificates. The dialog prompts the user to enter the certificate password and alias.
@SaintPatrck SaintPatrck force-pushed the PM-17531/tls-import-dialogs branch from 2dc773d to aad081d Compare January 24, 2025 20:46
@SaintPatrck SaintPatrck enabled auto-merge January 24, 2025 20:51
@SaintPatrck SaintPatrck added this pull request to the merge queue Jan 24, 2025
Merged via the queue into main with commit 92b9240 Jan 24, 2025
9 checks passed
@SaintPatrck SaintPatrck deleted the PM-17531/tls-import-dialogs branch January 24, 2025 21:32
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