diff --git a/CHANGELOG.md b/CHANGELOG.md index b71972b8..246d8918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +### libunftp 0.19.0 + +_tag: libunftp-0.19.0_ + +- [#471](https://github.com/bolcom/libunftp/pull/471) Added unFTP documentation link to help command output +- Include libunftp version in help command output +- [#470](https://github.com/bolcom/libunftp/pull/470) Fixed issue with modified datetime formatting for `Fileinfo` where old + dates didn't render correctly. +- [#482](https://github.com/bolcom/libunftp/pull/482) Fixed RUSTSEC-2023-0052 +- Compile against Rust 1.72.0 +- BREAKING: Upgrade to latest bitflags dependency. Bitflags are exposed in the API + for the TlsFlags option. +- Improved tests +- Upgraded dependencies + ### unftp-sbe-gcs v0.2.3 - [#449](https://github.com/bolcom/libunftp/pull/449) GCS Backend has had a cleanup (deduplication, modularization) diff --git a/Cargo.toml b/Cargo.toml index 2717ae9f..63f99582 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libunftp" -version = "0.18.9" # remember to update html_root_url +version = "0.19.0" # remember to update html_root_url authors = [ "Agoston Horvath ", "Dávid Kosztka ", @@ -30,34 +30,34 @@ members = [ ] [dependencies] -async-trait = "0.1.68" -bitflags = "1.3.2" -bytes = "1.4.0" -chrono = { version = "0.4.26", default-features = false, features = ["clock", "std"] } +async-trait = "0.1.73" +bitflags = "2.4.0" +bytes = "1.5.0" +chrono = { version = "0.4.31", default-features = false, features = ["clock", "std"] } derive_more = { version = "0.99.17", features = ["display"] } futures-util = { version = "0.3.28", default-features = false, features = ["alloc", "sink"] } -getrandom = "0.2.9" +getrandom = "0.2.10" lazy_static = "1.4.0" md-5 = "0.10.5" -moka = { version = "0.9.7", default-features = false, features = ["sync"] } +moka = { version = "0.11.3", default-features = false, features = ["sync"] } prometheus = { version = "0.13.3", default-features = false } proxy-protocol = "0.5.0" -rustls = "0.21.6" -rustls-pemfile = "1.0.2" +rustls = "0.21.7" +rustls-pemfile = "1.0.3" slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] } slog-stdlog = "4.1.1" -thiserror = "1.0.40" -tokio = { version = "1.28.2", features = ["macros", "rt", "net", "sync", "io-util", "time"] } +thiserror = "1.0.48" +tokio = { version = "1.32.0", features = ["macros", "rt", "net", "sync", "io-util", "time"] } tokio-rustls = "0.24.1" tokio-util = { version = "0.7.8", features = ["codec"] } tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" -uuid = { version = "1.3.3", features = ["v4"] } +tracing-attributes = "0.1.26" +uuid = { version = "1.4.1", features = ["v4"] } x509-parser = "0.14.0" -dashmap = "5.4.0" +dashmap = "5.5.3" libc = "0.2" [dev-dependencies] -pretty_assertions = "1.3.0" -tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } +pretty_assertions = "1.4.0" +tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } unftp-sbe-fs = { path = "../libunftp/crates/unftp-sbe-fs"} diff --git a/README.md b/README.md index 25b7fe78..838ef520 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ add. Here we choose the [file system back-end](https://crates.io/crates/unftp-sb ```toml [dependencies] -libunftp = "0.18.9" +libunftp = "0.19.0" unftp-sbe-fs = "0.2" tokio = { version = "1", features = ["full"] } ``` diff --git a/crates/unftp-auth-jsonfile/Cargo.toml b/crates/unftp-auth-jsonfile/Cargo.toml index 3391b172..5f3d0f99 100644 --- a/crates/unftp-auth-jsonfile/Cargo.toml +++ b/crates/unftp-auth-jsonfile/Cargo.toml @@ -18,22 +18,22 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-auth-j readme = "README.md" [dependencies] -async-trait = "0.1.68" -base64 = "0.13.1" -bytes = "1.4.0" -ipnet = "2.7.2" +async-trait = "0.1.73" +base64 = "0.21.4" +bytes = "1.5.0" +ipnet = "2.8.0" iprange = "0.6.7" -libunftp = { version="0.18.9", path="../../"} +libunftp = { version="0.19.0", path="../../"} ring = "0.16.20" -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.96" -tokio = { version = "1.28.2", features = ["rt", "time"] } +serde = { version = "1.0.188", features = ["derive"] } +serde_json = "1.0.107" +tokio = { version = "1.32.0", features = ["rt", "time"] } tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" +tracing-attributes = "0.1.26" valid = "0.3.1" -flate2 = "1.0.26" +flate2 = "1.0.27" [dev-dependencies] -pretty_env_logger = "0.4.0" -tokio = { version = "1.28.2", features = ["macros"] } +pretty_env_logger = "0.5.0" +tokio = { version = "1.32.0", features = ["macros"] } unftp-sbe-fs = { version="0.2.2", path="../unftp-sbe-fs"} diff --git a/crates/unftp-auth-jsonfile/src/lib.rs b/crates/unftp-auth-jsonfile/src/lib.rs index fc0e3a81..84a7d64f 100644 --- a/crates/unftp-auth-jsonfile/src/lib.rs +++ b/crates/unftp-auth-jsonfile/src/lib.rs @@ -145,6 +145,7 @@ //! use async_trait::async_trait; +use base64::Engine; use bytes::Bytes; use flate2::read::GzDecoder; use ipnet::Ipv4Net; @@ -229,7 +230,7 @@ impl JsonFileAuthenticator { let mut b = Vec::new(); f.read_to_end(&mut b)?; b.retain(|&x| x != b'\n' && x != b'\r'); - gzdata = base64::decode(b)?; + gzdata = base64::engine::general_purpose::STANDARD.decode(b)?; } else { f.read_to_end(&mut gzdata)?; } @@ -279,11 +280,12 @@ impl JsonFileAuthenticator { username.clone(), UserCreds { password: Password::Pbkdf2Password { - pbkdf2_salt: base64::decode(pbkdf2_salt) + pbkdf2_salt: base64::engine::general_purpose::STANDARD + .decode(pbkdf2_salt) .map_err(|_| "Could not base64 decode the salt")? .try_into() .map_err(|_| "Could not convert String to Bytes")?, - pbkdf2_key: base64::decode(pbkdf2_key) + pbkdf2_key: base64::engine::general_purpose::STANDARD.decode(pbkdf2_key) .map_err(|_| "Could not decode base64")? .validate("pbkdf2_key", &Length::Max(SHA256_OUTPUT_LEN)) .result() diff --git a/crates/unftp-auth-pam/Cargo.toml b/crates/unftp-auth-pam/Cargo.toml index ed320885..257ec212 100644 --- a/crates/unftp-auth-pam/Cargo.toml +++ b/crates/unftp-auth-pam/Cargo.toml @@ -19,13 +19,13 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-auth-p readme = "README.md" [dependencies] -async-trait = "0.1.68" -libunftp = { version="0.18.9", path="../../"} +async-trait = "0.1.73" +libunftp = { version="0.19.0", path="../../"} tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" +tracing-attributes = "0.1.26" [target.'cfg(target_family = "unix")'.dependencies] pam-auth = { package = "pam", version = "0.7.0" } [dev-dependencies] -tokio = { version = "1.28.2", features = ["macros"] } +tokio = { version = "1.32.0", features = ["macros"] } diff --git a/crates/unftp-auth-rest/Cargo.toml b/crates/unftp-auth-rest/Cargo.toml index 24abce66..fcd24e09 100644 --- a/crates/unftp-auth-rest/Cargo.toml +++ b/crates/unftp-auth-rest/Cargo.toml @@ -18,20 +18,20 @@ repository = "https://github.com/bolcom/libunftp/tree/hannes/crates/unftp-auth-r readme = "README.md" [dependencies] -async-trait = "0.1.68" -hyper = { version = "0.14.26", features = ["client", "runtime", "stream", "http1"] } +async-trait = "0.1.73" +hyper = { version = "0.14.27", features = ["client", "runtime", "stream", "http1"] } hyper-rustls = "0.24.1" -libunftp = { version="0.18.9", path="../../"} -percent-encoding = "2.2.0" -regex = "1.8.3" -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.96" -tokio = { version = "1.28.2", features = ["rt", "net", "sync", "io-util", "time"] } +libunftp = { version="0.19.0", path="../../"} +percent-encoding = "2.3.0" +regex = "1.9.5" +serde = { version = "1.0.188", features = ["derive"] } +serde_json = "1.0.107" +tokio = { version = "1.32.0", features = ["rt", "net", "sync", "io-util", "time"] } tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" +tracing-attributes = "0.1.26" [dev-dependencies] -pretty_env_logger = "0.4.0" -tokio = { version = "1.28.2", features = ["macros"] } +pretty_env_logger = "0.5.0" +tokio = { version = "1.32.0", features = ["macros"] } unftp-sbe-fs = { version="0.2.2", path="../unftp-sbe-fs"} diff --git a/crates/unftp-sbe-fs/Cargo.toml b/crates/unftp-sbe-fs/Cargo.toml index eebb0691..31334f1c 100644 --- a/crates/unftp-sbe-fs/Cargo.toml +++ b/crates/unftp-sbe-fs/Cargo.toml @@ -19,25 +19,25 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-sbe-fs readme = "README.md" [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.73" cfg-if = "1.0" futures = { version = "0.3.28", default-features = false, features = ["std"] } -libunftp = { version="0.18.9", path="../../"} +libunftp = { version="0.19.0", path="../../"} path_abs = "0.5.1" -tokio = { version = "1.28.2", features = ["rt", "net", "sync", "io-util", "time", "fs"] } +tokio = { version = "1.32.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } tokio-stream = "0.1.14" tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" +tracing-attributes = "0.1.26" [dev-dependencies] async_ftp = "6.0.0" more-asserts = "0.3.1" -pretty_assertions = "1.3.0" -pretty_env_logger = "0.4.0" -rstest = "0.18.1" -slog-async = "2.7.0" +pretty_assertions = "1.4.0" +pretty_env_logger = "0.5.0" +rstest = "0.18.2" +slog-async = "2.8.0" slog-term = "2.9.0" -tempfile = "3.5.0" -tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } +tempfile = "3.8.0" +tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } tracing-subscriber = "0.3.17" -getrandom = "0.2.9" +getrandom = "0.2.10" diff --git a/crates/unftp-sbe-fs/README.md b/crates/unftp-sbe-fs/README.md index 48eed1bb..eb38bbba 100644 --- a/crates/unftp-sbe-fs/README.md +++ b/crates/unftp-sbe-fs/README.md @@ -21,7 +21,7 @@ Add the libunftp and tokio crates to your project's dependencies in `Cargo.toml` ```toml [dependencies] -libunftp = "0.18.9" +libunftp = "0.19.0" unftp-sbe-fs = "0.2.2" tokio = { version = "1", features = ["full"] } ``` diff --git a/crates/unftp-sbe-gcs/Cargo.toml b/crates/unftp-sbe-gcs/Cargo.toml index befd6d30..aaeb9d46 100644 --- a/crates/unftp-sbe-gcs/Cargo.toml +++ b/crates/unftp-sbe-gcs/Cargo.toml @@ -18,24 +18,24 @@ repository = "https://github.com/bolcom/libunftp/tree/master/crates/unftp-sbe-gc readme = "README.md" [dependencies] -async-trait = "0.1.68" -base64 = "0.13.1" -bytes = "1.4.0" -chrono = { version = "0.4.26", default-features = false, features = ["std", "serde"] } +async-trait = "0.1.73" +base64 = "0.21.4" +bytes = "1.5.0" +chrono = { version = "0.4.31", default-features = false, features = ["std", "serde"] } futures = { version = "0.3.28", default-features = false, features = ["std"] } -hyper = { version = "0.14.26", features = ["client", "runtime", "stream", "http1"] } +hyper = { version = "0.14.27", features = ["client", "runtime", "stream", "http1"] } hyper-rustls = "0.24.1" -libunftp = { version="0.18.9", path="../../"} +libunftp = { version="0.19.0", path="../../"} mime = "0.3.17" -percent-encoding = "2.2.0" -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.96" -time = "0.3.21" -tokio = { version = "1.28.2", features = ["rt", "net", "sync", "io-util", "time", "fs"] } +percent-encoding = "2.3.0" +serde = { version = "1.0.188", features = ["derive"] } +serde_json = "1.0.107" +time = "0.3.28" +tokio = { version = "1.32.0", features = ["rt", "net", "sync", "io-util", "time", "fs"] } tokio-stream = "0.1.14" tokio-util = { version = "0.7.8", features = ["codec", "compat"] } tracing = { version = "0.1.37", default-features = false } -tracing-attributes = "0.1.24" +tracing-attributes = "0.1.26" yup-oauth2 = "8.3.0" [dev-dependencies] @@ -44,12 +44,12 @@ clap = { version = "3.2.25", features = ["env"] } lazy_static = "1.4.0" more-asserts = "0.3.1" path_abs = "0.5.1" -pretty_assertions = "1.3.0" -pretty_env_logger = "0.4.0" +pretty_assertions = "1.4.0" +pretty_env_logger = "0.5.0" slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] } -slog-async = "2.7.0" +slog-async = "2.8.0" slog-stdlog = "4.1.1" slog-term = "2.9.0" -tempfile = "3.5.0" -tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } +tempfile = "3.8.0" +tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } tracing-subscriber = "0.3.17" diff --git a/crates/unftp-sbe-gcs/README.md b/crates/unftp-sbe-gcs/README.md index 578c73b3..19fe7171 100644 --- a/crates/unftp-sbe-gcs/README.md +++ b/crates/unftp-sbe-gcs/README.md @@ -14,7 +14,7 @@ Add the needed dependencies to Cargo.toml: ```toml [dependencies] - libunftp = "0.18.9" + libunftp = "0.19.0" unftp-sbe-gcs = "0.2.3" tokio = { version = "1", features = ["full"] } ``` diff --git a/crates/unftp-sbe-gcs/src/lib.rs b/crates/unftp-sbe-gcs/src/lib.rs index a66dadd7..b0eaf740 100644 --- a/crates/unftp-sbe-gcs/src/lib.rs +++ b/crates/unftp-sbe-gcs/src/lib.rs @@ -12,7 +12,7 @@ //! //! ```toml //! [dependencies] -//! libunftp = "0.18.9" +//! libunftp = "0.19.0" //! unftp-sbe-gcs = "0.2.3" //! tokio = { version = "1", features = ["full"] } //! ``` diff --git a/crates/unftp-sbe-gcs/src/response_body.rs b/crates/unftp-sbe-gcs/src/response_body.rs index 4dbf1ead..20e13e1f 100644 --- a/crates/unftp-sbe-gcs/src/response_body.rs +++ b/crates/unftp-sbe-gcs/src/response_body.rs @@ -1,4 +1,5 @@ use super::ObjectMetadata; +use base64::Engine; use chrono::prelude::*; use libunftp::storage::{Error, ErrorKind, Fileinfo}; use serde::{de, Deserialize}; @@ -128,7 +129,9 @@ impl Item { } pub(crate) fn to_md5(&self) -> Result { - let md5 = base64::decode(&self.md5_hash).map_err(|e| Error::new(ErrorKind::LocalError, e))?; + let md5 = base64::engine::general_purpose::STANDARD + .decode(&self.md5_hash) + .map_err(|e| Error::new(ErrorKind::LocalError, e))?; Ok(md5.iter().map(|b| format!("{:02x}", b)).collect()) } } diff --git a/src/lib.rs b/src/lib.rs index 548985e2..29cb9148 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ #![deny(clippy::all)] #![deny(missing_docs)] #![forbid(unsafe_code)] -#![doc(html_root_url = "https://docs.rs/libunftp/0.18.9")] +#![doc(html_root_url = "https://docs.rs/libunftp/0.19.0")] //! libunftp is an extensible, async, cloud orientated FTP(S) server library. //! @@ -20,7 +20,7 @@ //! //! ```toml //! [dependencies] -//! libunftp = "0.18.9" +//! libunftp = "0.19.0" //! unftp-sbe-fs = "0.2.0" //! tokio = { version = "1", features = ["full"] } //! ``` diff --git a/src/server/ftpserver/options.rs b/src/server/ftpserver/options.rs index 3253a725..a541add3 100644 --- a/src/server/ftpserver/options.rs +++ b/src/server/ftpserver/options.rs @@ -96,6 +96,7 @@ impl Display for FtpsRequired { bitflags! { /// Used to configure TLS options employed for FTPS + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TlsFlags: u32 { /// Enables TLS version 1.2 const V1_2 = 0b00000001; @@ -106,7 +107,7 @@ bitflags! { /// Enables TLS session resumption via means tickets ([rfc5077](https://tools.ietf.org/html/rfc5077)) const RESUMPTION_TICKETS = 0b00010000; /// Enables the latest safe TLS versions i.e. 1.2 and 1.3 - const LATEST_VERSIONS = Self::V1_2.bits | Self::V1_3.bits; + const LATEST_VERSIONS = Self::V1_2.bits() | Self::V1_3.bits(); } }