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-11924] Add ssh-key item type #1037

Merged
merged 20 commits into from
Oct 21, 2024
Merged

[PM-11924] Add ssh-key item type #1037

merged 20 commits into from
Oct 21, 2024

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Sep 11, 2024

🎟️ Tracking

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

Server PR: https://bitwarden.atlassian.net/browse/PM-10394

📔 Objective

Add a new item type for ssh-keys.

⏰ 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

Copy link
Contributor

github-actions bot commented Sep 11, 2024

Logo
Checkmarx One – Scan Summary & Detailscbe63d41-a2c4-4902-8377-9f7ec59a7ba9

No New Or Fixed Issues Found

@quexten quexten changed the title Add ssh-key item type [PM-11924] Add ssh-key item type Sep 11, 2024
@quexten quexten marked this pull request as ready for review September 11, 2024 09:44
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 85.54913% with 25 lines in your changes missing coverage. Please review.

Project coverage is 58.60%. Comparing base (be75311) to head (b835c2f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-vault/src/cipher/ssh_key.rs 0.00% 15 Missing ⚠️
crates/bitwarden-exporters/src/models.rs 14.28% 6 Missing ⚠️
crates/bitwarden-vault/src/cipher/cipher.rs 94.64% 3 Missing ⚠️
crates/bitwarden-exporters/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1037      +/-   ##
==========================================
+ Coverage   58.27%   58.60%   +0.32%     
==========================================
  Files         197      198       +1     
  Lines       13614    13782     +168     
==========================================
+ Hits         7934     8077     +143     
- Misses       5680     5705      +25     

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

Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

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

Generally looks good, some minor things to tweak and add some tests.

crates/bitwarden-vault/src/cipher/cipher.rs Outdated Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/cipher.rs Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/cipher.rs Outdated Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/cipher.rs Outdated Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/ssh_key.rs Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/ssh_key.rs Outdated Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/ssh_key.rs Show resolved Hide resolved
crates/bitwarden-exporters/src/json.rs Outdated Show resolved Hide resolved
@quexten quexten requested a review from Hinton September 24, 2024 11:02
@quexten
Copy link
Contributor Author

quexten commented Oct 1, 2024

Seems the linting and ruby build failures are unrelated and also happening on other PRs.

@quexten quexten requested a review from Hinton October 1, 2024 14:48
@Hinton
Copy link
Member

Hinton commented Oct 8, 2024

Merged in the latest main which should fix most of the workflows.

Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

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

Some improvements to the comments to resolve some ambiguity

crates/bitwarden-exporters/src/lib.rs Outdated Show resolved Hide resolved
pub struct SshKey {
/// Ssh private key (ed25519/rsa) in unencrypted openssh private key format https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key
pub private_key: Option<String>,
/// Ssh public key (ed25519/rsa) according to RFC4253 https://datatracker.ietf.org/doc/html/rfc4253#section-6.6
Copy link
Member

Choose a reason for hiding this comment

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

There are multiple ways to encode public keys, are we using the OpenSSH format or RFC 4716? 4716 includes headers and are multi line, while OpenSSH is just the B64 in a single line.

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 use the single line openssh format. This is what 1Password does too, and what servers and GitHub accept as public keys pasted as authentication keys.

crates/bitwarden-exporters/src/lib.rs Outdated Show resolved Hide resolved
crates/bitwarden-vault/src/cipher/ssh_key.rs Outdated Show resolved Hide resolved
quexten and others added 4 commits October 20, 2024 16:08
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
@quexten quexten requested a review from Hinton October 21, 2024 13:17
@quexten quexten merged commit 38ecf13 into main Oct 21, 2024
98 of 99 checks passed
@quexten quexten deleted the km/pm-11924/ssh-key-item-type branch October 21, 2024 16:05
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