Skip to content

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Aug 1, 2025

🎟️ Tracking

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

📔 Objective

Adds support for importing ssh keys using CXF.

⏰ 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

@Hinton Hinton requested a review from a team as a code owner August 1, 2025 08:27
@Hinton Hinton requested review from justindbaur and quexten August 1, 2025 08:27
Copy link
Contributor

github-actions bot commented Aug 1, 2025

Logo
Checkmarx One – Scan Summary & Details4a9b66d0-7e70-431b-8f73-8e1574b15f8f

Great job! No new security vulnerabilities introduced in this pull request

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 96.96970% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.71%. Comparing base (04fad91) to head (02b19b0).
⚠️ Report is 1 commits behind head on cxf/sample.

Files with missing lines Patch % Lines
crates/bitwarden-exporters/src/cxf/import.rs 76.92% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           cxf/sample     #375      +/-   ##
==============================================
+ Coverage       75.63%   75.71%   +0.08%     
==============================================
  Files             256      257       +1     
  Lines           23120    23214      +94     
==============================================
+ Hits            17486    17577      +91     
- Misses           5634     5637       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

quexten
quexten previously approved these changes Aug 1, 2025
Copy link
Contributor

@quexten quexten left a comment

Choose a reason for hiding this comment

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

After the removal of expect this looks good to me. One note, but it's not actionable here.

Hinton added 2 commits August 12, 2025 17:47
…xf/ssh

# Conflicts:
#	crates/bitwarden-exporters/src/cxf/import.rs
#	crates/bitwarden-exporters/src/cxf/mod.rs
@Hinton Hinton changed the base branch from main to cxf/sample August 15, 2025 12:25
@Hinton Hinton requested a review from abergs August 15, 2025 12:25
Copy link

Ok((ssh_key, fields)) => add_item(CipherType::SshKey(Box::new(ssh_key)), fields),
Err(_) => {
// Include information about the failed items, or import as note?
}
Copy link
Member

@abergs abergs Aug 15, 2025

Choose a reason for hiding this comment

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

Yeah we need to figure out a strategy to handle errors in a more structured, actionable way

Copy link
Member

Choose a reason for hiding this comment

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

We don't need to change the approach in this PR, but I do think we should opt for the "don't loose any data" approach and save it to a note, if we can encode the value in a meaningful way.

pub fn import_pkcs8_der(encoded_key: &[u8]) -> Result<SshKeyView, SshKeyImportError> {
import_der_key(encoded_key)
}

Copy link
Member

Choose a reason for hiding this comment

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

question: Should these import_pkcs8_derand import_der_key live in ssh.rs ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we support importing keys outside cxf so we can't move it into the exporters crate.

Copy link
Member

@abergs abergs left a comment

Choose a reason for hiding this comment

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

Just smaller notes. Is there any update we can/should do to the cxf_sample tests?

@Hinton Hinton merged commit 97cdad2 into cxf/sample Aug 15, 2025
50 checks passed
@Hinton Hinton deleted the cxf/ssh branch August 15, 2025 13:16
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