Skip to content

Commit

Permalink
Improve crate dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
masongup-mdsol committed Jun 7, 2024
1 parent 35a3f58 commit d26ddf8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
33 changes: 16 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@ keywords = ["security", "authentication", "web"]
categories = ["authentication", "web-programming"]

[dependencies]
reqwest = { version = ">= 0.11.23", features = ["json"] }
url = ">= 2.5.0"
serde = { version = ">= 1.0.85", features = ["derive"] }
serde_json = ">= 1.0.0"
serde_yaml = ">= 0.8.0"
uuid = { version = ">= 0.21.0", features = ["v4"] }
dirs = ">= 2.0.0"
chrono = ">= 0.4.0"
tokio = { version = ">= 1.0.1", features = ["fs"] }
hex = ">= 0.4.0"
bytes = ">= 1.0.0"
http = ">= 1.0.0"
tower = { version = ">= 0.4.13", optional = true }
reqwest = { version = "0.12", features = ["json"] }
url = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yml = "0.0.10"
uuid = { version = "1", features = ["v4"] }
dirs = "5"
chrono = "0.4"
tokio = { version = "1", features = ["fs"] }
tower = { version = "0.4", optional = true }
axum = { version = ">= 0.7.2", optional = true }
futures-core = { version = ">= 0.3.25", optional = true }
thiserror = ">= 1.0.37"
futures-core = { version = "0.3", optional = true }
http = { version = "1", optional = true }
bytes = { version = "1", optional = true }
thiserror = "1"
mauth-core = "0.5"

[dev-dependencies]
tokio = { version = ">= 1.0.1", features = ["rt-multi-thread", "macros"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

[features]
axum-service = ["tower", "futures-core", "axum"]
axum-service = ["tower", "futures-core", "axum", "http", "bytes"]
12 changes: 6 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ impl MAuthInfo {
home.push(CONFIG_FILE);

Check warning on line 23 in src/config.rs

View workflow job for this annotation

GitHub Actions / rustfmt

Diff in /home/runner/work/mauth-client-rust/mauth-client-rust/src/config.rs
let config_data = std::fs::read_to_string(&home)?;

let config_data_value: serde_yaml::Value =
serde_yaml::from_slice(&config_data.into_bytes())?;
let config_data_value: serde_yml::Value =
serde_yml::from_slice(&config_data.into_bytes())?;
let common_section = config_data_value
.get("common")
.ok_or(ConfigReadError::InvalidFile(None))?;
let common_section_typed: ConfigFileSection =
serde_yaml::from_value(common_section.clone())?;
serde_yml::from_value(common_section.clone())?;
Ok(common_section_typed)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ pub enum ConfigReadError {
#[error("File Read Error: {0}")]
FileReadError(#[from] io::Error),
#[error("Not a valid maudit config file: {0:?}")]
InvalidFile(Option<serde_yaml::Error>),
InvalidFile(Option<serde_yml::Error>),
#[error("MAudit URI not valid: {0}")]
InvalidUri(#[from] url::ParseError),
#[error("App UUID not valid: {0}")]
Expand All @@ -124,8 +124,8 @@ impl From<mauth_core::error::Error> for ConfigReadError {
}
}

impl From<serde_yaml::Error> for ConfigReadError {
fn from(err: serde_yaml::Error) -> ConfigReadError {
impl From<serde_yml::Error> for ConfigReadError {
fn from(err: serde_yml::Error) -> ConfigReadError {
ConfigReadError::InvalidFile(Some(err))
}
}
Expand Down

0 comments on commit d26ddf8

Please sign in to comment.