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-16221] uniffi bindings for ssh agent and keygen #89

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

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Dec 19, 2024

🎟️ Tracking

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

📔 Objective

Adds bindings so we can add keygen and import to the mobile clients.

⏰ 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

@quexten
Copy link
Contributor Author

quexten commented Dec 19, 2024

Question for whoever reviews: On both the wasm bindings and here, I put the ssh methods on the global "namespace" directly, since things like cryptoclient seemed to be for holding state. They can also act as namespaces though. Should they be moved under something like "sshclient"?

@quexten quexten force-pushed the km/pm_16221/uniffi-ssh-bindings branch from 4a77d22 to 750db94 Compare December 19, 2024 13:20
Copy link
Contributor

github-actions bot commented Dec 19, 2024

Logo
Checkmarx One – Scan Summary & Details5882b6e7-22bd-4ec4-855b-2e867146d1ab

No New Or Fixed Issues Found

@quexten quexten force-pushed the km/pm_16221/uniffi-ssh-bindings branch from 51db1f3 to 4d4c67a Compare December 19, 2024 13:22
crates/bitwarden-uniffi/src/error.rs Fixed Show fixed Hide fixed
crates/bitwarden-uniffi/src/error.rs Fixed Show fixed Hide fixed
crates/bitwarden-uniffi/src/error.rs Fixed Show fixed Hide fixed
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.

Project coverage is 65.17%. Comparing base (4ef0c74) to head (60aef1c).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-uniffi/src/tool/ssh.rs 0.00% 17 Missing ⚠️
crates/bitwarden-uniffi/src/lib.rs 0.00% 3 Missing ⚠️
crates/bitwarden-ssh/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   64.75%   65.17%   +0.41%     
==========================================
  Files         190      181       -9     
  Lines       13979    13854     -125     
==========================================
- Hits         9052     9029      -23     
+ Misses       4927     4825     -102     

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

@quexten quexten marked this pull request as ready for review December 19, 2024 14:09
Comment on lines 92 to 107
pub fn generate_ssh_key(
&self,
key_algorithm: bitwarden_ssh::generator::KeyAlgorithm,
) -> Result<bitwarden_ssh::SshKey> {
bitwarden_ssh::generator::generate_sshkey(key_algorithm)
.map_err(|e| error::BitwardenError::E(error::Error::SshGeneration(e)))
}

pub fn import_ssh_key(
&self,
imported_key: String,
password: Option<String>,
) -> Result<bitwarden_ssh::SshKey> {
bitwarden_ssh::import::import_key(imported_key, password)
.map_err(|e| error::BitwardenError::E(error::Error::SshImport(e)))
}
Copy link
Member

Choose a reason for hiding this comment

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

issue: Please make a client for these, we don't want them in the root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated and moved to a client, should we do the same for wasm in a follow-up pr?

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