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

Update dependencies #55

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ default = []
macos-specify-keychain = []

[target.'cfg(target_os = "macos")'.dependencies]
security-framework = "0.4.2"
security-framework = "2.0.0"

[target.'cfg(target_os = "linux")'.dependencies]
secret-service = "1.1.1"
secret-service = "2.0.1"

[target.'cfg(target_os = "windows")'.dependencies]
byteorder = "1.2.1"
winapi = { version = "0.3", features = ["wincred", "minwindef"] }

[dev-dependencies]
clap = "2.0.5"
rpassword = "2.0.0"
rpassword = "5.0.1"

[target.'cfg(target_os = "macos")'.dev-dependencies]
keychain-services = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(target_os = "linux")]
use secret_service::SsError;
use secret_service::Error as SsError;
#[cfg(target_os = "macos")]
use security_framework::base::Error as SfError;
use std::error;
Expand Down
6 changes: 3 additions & 3 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<'a> Keyring<'a> {
let label = &format!("Password for {} on {}", self.username, self.service)[..];
collection.create_item(
label,
attrs,
attrs.into_iter().collect(),
password.as_bytes(),
true, // replace
"text/plain",
Expand All @@ -43,7 +43,7 @@ impl<'a> Keyring<'a> {
if collection.is_locked()? {
collection.unlock()?;
}
let search = collection.search_items(self.attributes.clone())?;
let search = collection.search_items(self.attributes.iter().cloned().collect())?;
let item = search.get(0).ok_or(KeyringError::NoPasswordFound)?;
let secret_bytes = item.get_secret()?;
let secret = String::from_utf8(secret_bytes)?;
Expand All @@ -56,7 +56,7 @@ impl<'a> Keyring<'a> {
if collection.is_locked()? {
collection.unlock()?;
}
let search = collection.search_items(self.attributes.clone())?;
let search = collection.search_items(self.attributes.iter().cloned().collect())?;
let item = search.get(0).ok_or(KeyringError::NoPasswordFound)?;
Ok(item.delete()?)
}
Expand Down