diff --git a/Cargo.lock b/Cargo.lock index e05f38f..a89bca6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-config" @@ -107,7 +107,7 @@ dependencies = [ "http", "hyper", "ring", - "time 0.3.17", + "time", "tokio", "tower", "tracing", @@ -239,7 +239,7 @@ dependencies = [ "percent-encoding", "regex", "sha2 0.10.6", - "time 0.3.17", + "time", "tracing", ] @@ -345,7 +345,7 @@ dependencies = [ "itoa", "num-integer", "ryu", - "time 0.3.17", + "time", ] [[package]] @@ -490,12 +490,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", - "js-sys", "num-integer", "num-traits", "serde", - "time 0.1.45", - "wasm-bindgen", "winapi", ] @@ -508,15 +505,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "claim" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81099d6bb72e1df6d50bb2347224b666a670912bb7f06dbe867a4a070ab3ce8" -dependencies = [ - "autocfg", -] - [[package]] name = "clap" version = "4.1.8" @@ -591,7 +579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", - "time 0.3.17", + "time", "version_check", ] @@ -607,7 +595,7 @@ dependencies = [ "publicsuffix", "serde", "serde_json", - "time 0.3.17", + "time", "url", ] @@ -655,7 +643,6 @@ dependencies = [ "aws-smithy-types", "base64", "chrono", - "claim", "clap", "confy", "console", @@ -1063,7 +1050,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1477,7 +1464,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.45.0", ] @@ -2428,17 +2415,6 @@ dependencies = [ "syn", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.17" @@ -2483,22 +2459,22 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.19.2" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ + "autocfg", "bytes", "libc", "memchr", "mio", "num_cpus", - "once_cell", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -2776,12 +2752,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 3437bc0..b721d0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,13 +51,16 @@ dirs = "4" url = "2.3.1" sha2 = "0.10.6" anyhow = "1.0" -chrono = { version = "0.4.23", features = ["serde"] } +chrono = { version = "0.4.23", default-features = false, features = [ + "clock", + "std", + "serde", +] } itertools = "0.10.5" confy = "0.5.1" -tokio = { version = "1", features = ["full"] } +tokio = { version = "1.26.0", features = ["full"] } console = "0.15.5" select = "0.6" [dev-dependencies] tempfile = "3" -claim = "0.5.0" diff --git a/src/config.rs b/src/config.rs index ba5c6c2..c1f438c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -97,14 +97,13 @@ fn find_duplicate(vec: &[AppProfile], profile: &AppProfile) -> bool { mod test { use super::*; use crate::providers::ProviderType; - use claim::{assert_err, assert_ok}; #[test] fn serializes_valid_config_for_location() -> Result<()> { let crowbar_config = CrowbarConfig::with_location(Some("tests/fixtures/valid_config.toml".to_string())); let result = crowbar_config.read(); - assert_ok!(&result); + assert!(&result.is_ok()); let config = result?.profiles; assert_eq!(config.len(), 1); @@ -116,7 +115,7 @@ mod test { fn serializes_empty_config_for_location_into_empty_vec() -> Result<()> { let crowbar_config = CrowbarConfig::with_location(Some("/tmp/some/location".to_string())); let result = crowbar_config.read(); - assert_ok!(&result); + assert!(&result.is_ok()); let config = result?.profiles; assert_eq!(config.len(), 0); @@ -152,7 +151,7 @@ mod test { let result = config.add_profile(&profile_a()); - assert_err!(result); + assert!(result.is_err()); Ok(()) } @@ -180,7 +179,7 @@ mod test { }; let profile = profile_a(); - assert_err!(config.delete_profile(&profile.name)); + assert!(config.delete_profile(&profile.name).is_err()); Ok(()) } diff --git a/src/providers/okta/response.rs b/src/providers/okta/response.rs index d540538..93e55d9 100644 --- a/src/providers/okta/response.rs +++ b/src/providers/okta/response.rs @@ -118,7 +118,6 @@ pub struct UserProfile { mod test { use super::*; use anyhow::Result; - use claim::assert_ok; use std::fs; #[test] @@ -181,7 +180,7 @@ mod test { "tests/fixtures/okta/login_response_unimplemented_factors.json", )?); - assert_ok!(response); + assert!(response.is_ok()); Ok(()) } } diff --git a/src/saml.rs b/src/saml.rs index 7d7935b..abf38a0 100644 --- a/src/saml.rs +++ b/src/saml.rs @@ -23,7 +23,7 @@ impl FromStr for Response { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - let decoded_saml = String::from_utf8(b64.decode(&s)?)?; + let decoded_saml = String::from_utf8(b64.decode(s)?)?; trace!("SAML: {}", s); @@ -91,7 +91,6 @@ pub fn extract_saml_assertion(text: &str) -> Result { #[cfg(test)] mod tests { use super::*; - use claim::assert_ok; use std::fs; #[test] @@ -149,7 +148,7 @@ mod tests { let html: String = fs::read_to_string("tests/fixtures/jumpcloud/html_saml_response.html")?; let saml_response = extract_saml_assertion(&html); - assert_ok!(saml_response); + assert!(saml_response.is_ok()); Ok(()) }