Skip to content

Commit

Permalink
Updated dependencies to fix potential security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzheiber committed Mar 5, 2023
1 parent 042c092 commit 6c310c0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 56 deletions.
56 changes: 13 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 4 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -152,7 +151,7 @@ mod test {

let result = config.add_profile(&profile_a());

assert_err!(result);
assert!(result.is_err());
Ok(())
}

Expand Down Expand Up @@ -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(())
}
Expand Down
3 changes: 1 addition & 2 deletions src/providers/okta/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ pub struct UserProfile {
mod test {
use super::*;
use anyhow::Result;
use claim::assert_ok;
use std::fs;

#[test]
Expand Down Expand Up @@ -181,7 +180,7 @@ mod test {
"tests/fixtures/okta/login_response_unimplemented_factors.json",
)?);

assert_ok!(response);
assert!(response.is_ok());
Ok(())
}
}
5 changes: 2 additions & 3 deletions src/saml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl FromStr for Response {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self> {
let decoded_saml = String::from_utf8(b64.decode(&s)?)?;
let decoded_saml = String::from_utf8(b64.decode(s)?)?;

trace!("SAML: {}", s);

Expand Down Expand Up @@ -91,7 +91,6 @@ pub fn extract_saml_assertion(text: &str) -> Result<Response> {
#[cfg(test)]
mod tests {
use super::*;
use claim::assert_ok;
use std::fs;

#[test]
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 6c310c0

Please sign in to comment.