Skip to content
Merged
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
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

### Upcoming release
### libunftp 0.21.0

- Upgrade dependencies
- Upgraded dependencies
- Compiling against Rust 1.85.0
- Bumped codebase to Edition 2024
- [#531](https://github.com/bolcom/libunftp/pull/531) Implement EPSV FTP command
- [#533](https://github.com/bolcom/libunftp/pull/533) BREAKING: Make passive port range inclusive
- [#519](https://github.com/bolcom/libunftp/pull/519) Create new `ring` feature to use `ring` over `aws-lc-rs`
- [#536](https://github.com/bolcom/libunftp/pull/536) Implement MLST command
- Add `ftps_manual` method to ServerBuilder, hiding it behind a `experimental` feature.

### libunftp 0.20.3

Expand Down
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libunftp"
version = "0.20.3" # remember to update html_root_url
version = "0.21.0" # remember to update html_root_url
authors = [
"Agoston Horvath <ahorvath@bol.com>",
"Dávid Kosztka <dkosztka@bol.com>",
Expand All @@ -17,7 +17,7 @@ license = "Apache-2.0"
readme = "README.md"
keywords = ["ftp", "ftps"]
categories = ["network-programming"]
edition = "2021"
edition = "2024"

[workspace]

Expand Down Expand Up @@ -47,27 +47,27 @@ async-trait = "0.1.88"
bitflags = "2.9.0"
bytes = "1.10.1"
chrono = { version = "0.4.40", default-features = false, features = ["clock", "std"] }
derive_more = { version = "1.0.0", features = ["display"] }
derive_more = { version = "2.0.1", features = ["display"] }
futures-util = { version = "0.3.31", default-features = false, features = ["alloc", "sink"] }
getrandom = "0.2.15"
getrandom = "0.3.2"
lazy_static = "1.5.0"
md-5 = "0.10.6"
moka = { version = "0.12.10", default-features = false, features = ["sync"] }
nix = { version = "0.29.0", default-features = false, features = ["fs"] }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
proxy-protocol = "0.5.0"
rustls = { version = "0.23.25", default-features = false }
rustls = { version = "0.23.26", default-features = false }
rustls-pemfile = "2.2.0"
slog = { version = "2.7.0", features = ["max_level_trace", "release_max_level_info"] }
slog-stdlog = "4.1.1"
thiserror = "2.0.12"
tokio = { version = "1.44.2", features = ["macros", "rt", "net", "process", "sync", "io-util", "time"] }
tokio-rustls = "0.26.2"
tokio-util = { version = "0.7.14", features = ["codec"] }
tokio-util = { version = "0.7.15", features = ["codec"] }
tracing = { version = "0.1.41", default-features = false }
tracing-attributes = "0.1.28"
uuid = { version = "1.16.0", features = ["v4"] }
x509-parser = "0.16.0"
x509-parser = "0.17.0"
dashmap = "6.1.0"
libc = "0.2"

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ To use a specific provider, enable the corresponding feature in your `Cargo.toml

```toml
[dependencies]
libunftp = { version = "0.20.3", features = ["ring"] } # Use ring
libunftp = { version = "0.21.0", features = ["ring"] } # Use ring
# or
libunftp = { version = "0.20.3", features = ["aws_lc_rs"] } # Use aws-lc-rs (default)
libunftp = { version = "0.21.0", features = ["aws_lc_rs"] } # Use aws-lc-rs (default)
```

The default provider is `aws-lc-rs` for backward compatibility. Choose the provider that best fits your needs:
Expand All @@ -77,7 +77,7 @@ The default provider is `aws-lc-rs` for backward compatibility. Choose the provi

## Prerequisites

You'll need [Rust](https://rust-lang.org) 1.41 or higher to build libunftp.
You'll need [Rust](https://rust-lang.org) 1.85.0 or higher to build libunftp.

## Getting started

Expand All @@ -93,7 +93,7 @@ add. Here we choose the [file system back-end](https://crates.io/crates/unftp-sb

```toml
[dependencies]
libunftp = "0.20.3"
libunftp = "0.21.0"
unftp-sbe-fs = "0.2"
tokio = { version = "1", features = ["full"] }
```
Expand Down
4 changes: 2 additions & 2 deletions crates/unftp-auth-jsonfile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
"Hannes de Jager <hdejager@bol.com>",
"Rob klein Gunnewiek <rkleingunnewiek@bol.com>",
]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
keywords = ["libunftp", "unftp", "ftp", "ftps", "json"]
categories = ["network-programming"]
Expand All @@ -23,7 +23,7 @@ base64 = "0.22.1"
bytes = "1.10.1"
ipnet = "2.11.0"
iprange = "0.6.7"
libunftp = { version = "0.20.3", path = "../../" }
libunftp = { version = "0.21.0", path = "../../" }
ring = "0.17.14"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
Expand Down
12 changes: 4 additions & 8 deletions crates/unftp-auth-jsonfile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ use iprange::IpRange;
use libunftp::auth::{AuthenticationError, Authenticator, DefaultUser};
use ring::{
digest::SHA256_OUTPUT_LEN,
pbkdf2::{verify, PBKDF2_HMAC_SHA256},
pbkdf2::{PBKDF2_HMAC_SHA256, verify},
};
use serde::Deserialize;
use std::io::prelude::*;
use std::{collections::HashMap, fs, num::NonZeroU32, path::Path, time::Duration};
use tokio::time::sleep;
use valid::{constraint::Length, Validate};
use valid::{Validate, constraint::Length};

#[derive(Deserialize, Clone, Debug)]
struct ClientCertCredential {
Expand Down Expand Up @@ -318,11 +318,7 @@ impl JsonFileAuthenticator {
match actual_password {
Password::PlainPassword { password } => {
if let Some(pwd) = password {
if pwd == given_password {
Ok(())
} else {
Err(())
}
if pwd == given_password { Ok(()) } else { Err(()) }
} else {
Err(())
}
Expand Down Expand Up @@ -382,7 +378,7 @@ impl Authenticator<DefaultUser> for JsonFileAuthenticator {
};

let pass_check_result = match &creds.password {
Some(ref given_password) => {
Some(given_password) => {
if Self::check_password(given_password, &actual_creds.password).is_ok() {
Some(Ok(DefaultUser {}))
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/unftp-auth-pam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Koen Wilde <koen@chillheid.nl>",
"Rob klein Gunnewiek <rkleingunnewiek@bol.com>",
]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
keywords = ["libunftp", "unftp", "ftp", "ftps", "pam"]
categories = ["network-programming"]
Expand All @@ -20,7 +20,7 @@ readme = "README.md"

[dependencies]
async-trait = "0.1.88"
libunftp = { version = "0.20.3", path = "../../" }
libunftp = { version = "0.21.0", path = "../../" }
tracing = { version = "0.1.41", default-features = false }
tracing-attributes = "0.1.28"

Expand Down
4 changes: 2 additions & 2 deletions crates/unftp-auth-rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
"Hannes de Jager <hdejager@bol.com>",
"Rob klein Gunnewiek <rkleingunnewiek@bol.com>",
]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
keywords = ["libunftp", "ftp", "ftps", "auth", "rest"]
categories = ["network-programming"]
Expand All @@ -23,7 +23,7 @@ http-body-util = "0.1.3"
hyper = { version = "1.6.0", features = ["client", "http1"] }
hyper-rustls = "0.27.5"
hyper-util = "0.1.11"
libunftp = { version = "0.20.3", path = "../../" }
libunftp = { version = "0.21.0", path = "../../" }
percent-encoding = "2.3.1"
regex = "1.11.1"
serde = { version = "1.0.219", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/unftp-auth-rest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use async_trait::async_trait;
use http_body_util::BodyExt;
use hyper::{http::uri::InvalidUri, Method, Request};
use hyper::{Method, Request, http::uri::InvalidUri};
use hyper_util::client::legacy::Client;
use hyper_util::rt::TokioExecutor;
use libunftp::auth::{AuthenticationError, Authenticator, Credentials, DefaultUser};
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
use regex::Regex;
use serde_json::{json, Value};
use serde_json::{Value, json};

/// A [libunftp](https://crates.io/crates/libunftp) `Authenticator`
/// implementation that authenticates by consuming a JSON REST API.
Expand Down
8 changes: 4 additions & 4 deletions crates/unftp-sbe-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Koen Wilde <koen@chillheid.nl>",
"Rob klein Gunnewiek <rkleingunnewiek@bol.com>",
]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
keywords = ["libunftp", "unftp", "ftp", "ftps", "filesystem"]
categories = ["network-programming"]
Expand All @@ -29,7 +29,7 @@ cfg-if = "1.0"
cap-std = "3.4"
futures = { version = "0.3.31", default-features = false, features = ["std"] }
lazy_static = "1.5.0"
libunftp = { version = "0.20.3", path = "../../", default-features = false }
libunftp = { version = "0.21.0", path = "../../", default-features = false }
path_abs = "0.5.1"
tokio = { version = "1.44.2", features = ["rt", "net", "sync", "io-util", "time", "fs"] }
tokio-stream = "0.1.17"
Expand All @@ -45,15 +45,15 @@ nix = { version = "0.29.0", default-features = false, features = ["user"] }
pretty_assertions = "1.4.1"
pretty_env_logger = "0.5.0"
regex = "1.11.1"
rstest = "0.24.0"
rstest = "0.25.0"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
slog-async = "2.8.0"
slog-term = "2.9.1"
tempfile = "3.19.1"
tokio = { version = "1.44.2", features = ["macros", "rt-multi-thread"] }
tracing-subscriber = "0.3.19"
getrandom = "0.2.15"
getrandom = "0.3.2"

[target.'cfg(target_os = "freebsd")'.dev-dependencies]
capsicum = { version = "0.4.4", features = ["casper"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/unftp-sbe-fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add the libunftp and tokio crates to your project's dependencies in `Cargo.toml`

```toml
[dependencies]
libunftp = "0.20.3"
libunftp = "0.21.0"
unftp-sbe-fs = "0.2.6"
tokio = { version = "1", features = ["full"] }
```
Expand Down
10 changes: 3 additions & 7 deletions crates/unftp-sbe-fs/examples/cap-ftpd-worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ mod auth {

fn check_password(given_password: &str, actual_password: &Option<String>) -> Result<(), ()> {
if let Some(pwd) = actual_password {
if pwd == given_password {
Ok(())
} else {
Err(())
}
if pwd == given_password { Ok(()) } else { Err(()) }
} else {
Err(())
}
Expand All @@ -123,7 +119,7 @@ mod auth {
async fn authenticate(&self, username: &str, creds: &libunftp::auth::Credentials) -> Result<User, AuthenticationError> {
let res = if let Some(actual_creds) = self.credentials_map.get(username) {
let pass_check_result = match &creds.password {
Some(ref given_password) => {
Some(given_password) => {
if Self::check_password(given_password, &actual_creds.password).is_ok() {
Some(Ok(User::new(username, &actual_creds.home)))
} else {
Expand Down Expand Up @@ -201,7 +197,7 @@ cfg_if! {

for _ in 1..BIND_RETRIES {
let mut data = [0u8; 2];
getrandom::getrandom(&mut data).expect("Error generating random port");
getrandom::fill(&mut data).expect("Error generating random port");
let r16 = u16::from_ne_bytes(data);
let p = passive_ports.start + r16 % (passive_ports.end - passive_ports.start);
let socket = TcpSocket::new_v4()?;
Expand Down
8 changes: 4 additions & 4 deletions crates/unftp-sbe-fs/tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(missing_docs)]

use async_ftp::{types::Result, FtpStream};
use libunftp::{auth::DefaultUser, options::FtpsRequired, ServerBuilder};
use async_ftp::{FtpStream, types::Result};
use libunftp::{ServerBuilder, auth::DefaultUser, options::FtpsRequired};
use pretty_assertions::assert_eq;
use rstest::{fixture, rstest};
use std::fmt::Debug;
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn get(#[future] harness: Harness) {

// Write some random data to our file
let mut data = vec![0; 1024];
getrandom::getrandom(&mut data).expect("Error generating random bytes");
getrandom::fill(&mut data).expect("Error generating random bytes");
f.write_all(&data).unwrap();

// Retrieve the remote file
Expand Down Expand Up @@ -252,7 +252,7 @@ mod list {
#[tokio::test]
async fn format(#[future] harness: Harness) {
use regex::Regex;
use std::os::unix::fs::{fchown, MetadataExt, OpenOptionsExt};
use std::os::unix::fs::{MetadataExt, OpenOptionsExt, fchown};

// Create a filename in the ftp root that we will look for in the `LIST` output
let path = harness.root.join("test.txt");
Expand Down
10 changes: 5 additions & 5 deletions crates/unftp-sbe-gcs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
"Hannes de Jager <hdejager@bol.com>",
"Rob klein Gunnewiek <rkleingunnewiek@bol.com>",
]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
keywords = ["libunftp", "unftp", "ftp", "ftps", "gcs"]
categories = ["network-programming"]
Expand All @@ -27,22 +27,22 @@ http-body-util = "0.1.3"
hyper = { version = "1.6.0", features = ["client", "http1"] }
hyper-rustls = "0.27.5"
hyper-util = "0.1.11"
libunftp = { version = "0.20.3", path = "../../" }
libunftp = { version = "0.21.0", path = "../../" }
mime = "0.3.17"
percent-encoding = "2.3.1"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
time = "0.3.41"
tokio = { version = "1.44.2", features = ["rt", "net", "sync", "io-util", "time", "fs"] }
tokio-stream = "0.1.17"
tokio-util = { version = "0.7.14", features = ["codec", "compat"] }
tokio-util = { version = "0.7.15", features = ["codec", "compat"] }
tracing = { version = "0.1.41", default-features = false }
tracing-attributes = "0.1.28"
yup-oauth2 = { version = "11.0.0", default-features = false, features = ["hyper-rustls", "service-account", "aws-lc-rs"]}
yup-oauth2 = { version = "12.1.0", default-features = false, features = ["hyper-rustls", "service-account", "aws-lc-rs"] }

[dev-dependencies]
async_ftp = "6.0.0"
clap = { version = "4.5.35", features = ["env"] }
clap = { version = "4.5.37", features = ["env"] }
lazy_static = "1.5.0"
more-asserts = "0.3.1"
path_abs = "0.5.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/unftp-sbe-gcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add the needed dependencies to Cargo.toml:

```toml
[dependencies]
libunftp = "0.20.3"
libunftp = "0.21.0"
unftp-sbe-gcs = "0.2.7"
tokio = { version = "1", features = ["full"] }
```
Expand Down
2 changes: 1 addition & 1 deletion crates/unftp-sbe-gcs/src/ext.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::options::AuthMethod;
use crate::CloudStorage;
use crate::options::AuthMethod;
use libunftp::auth::DefaultUser;
use libunftp::{Server, ServerBuilder};
use std::path::PathBuf;
Expand Down
Loading
Loading