Skip to content

fix(dependencies): update package versions#113

Open
Cleboost wants to merge 1 commit intomasterfrom
fix/oo7-upgrade-clean
Open

fix(dependencies): update package versions#113
Cleboost wants to merge 1 commit intomasterfrom
fix/oo7-upgrade-clean

Conversation

@Cleboost
Copy link
Copy Markdown
Owner

This pull request updates dependencies and improves how secrets are handled when converting them from bytes to strings. The main focus is on updating the oo7 crate and using .as_ref() for safer and more idiomatic handling of secret data.

Dependency updates:

  • Updated the oo7 dependency in Cargo.toml from version 0.3 to 0.6 to use the latest features and fixes.

Secret handling improvements:

  • Updated all instances where secrets retrieved from keyring items are converted from bytes to strings to use .as_ref() instead of referencing the variable directly. This makes the code more idiomatic and clearer when working with types that implement AsRef<[u8]>. [1] [2] [3]

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the oo7 dependency from version 0.3 to 0.6 and adapts the code to use .as_ref() for accessing secrets, as the library now returns a Secret type. Feedback was provided regarding the use of String::from_utf8_lossy, noting that it could lead to incorrect passwords if the keyring secrets contain raw binary data that is not valid UTF-8.

Comment thread src/ui/ssh_keys.rs
&& let Some(item) = items.first()
&& let Ok(pass) = item.secret().await {
final_password = Some(String::from_utf8_lossy(&pass).to_string());
final_password = Some(String::from_utf8_lossy(pass.as_ref()).to_string());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Updating to .as_ref() is required for compatibility with oo7 0.6. However, note that String::from_utf8_lossy will replace any invalid UTF-8 sequences with the replacement character (U+FFFD). While keyring secrets are typically UTF-8, if a secret contains raw binary data that isn't valid UTF-8, this conversion will result in an incorrect password being used for deployment.

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.

1 participant