#amazon-s3 #s3 #aws #minio

rusty-s3

Simple pure Rust AWS S3 Client following a Sans-IO approach

14 unstable releases (5 breaking)

0.5.0 Oct 8, 2023
0.4.1 Jan 20, 2023
0.3.3 Jan 8, 2023
0.3.2 Aug 30, 2022
0.1.1 Dec 31, 2020

#75 in Cryptography

Download history 1421/week @ 2023-12-11 1333/week @ 2023-12-18 967/week @ 2023-12-25 863/week @ 2024-01-01 1242/week @ 2024-01-08 1240/week @ 2024-01-15 1038/week @ 2024-01-22 996/week @ 2024-01-29 1110/week @ 2024-02-05 1119/week @ 2024-02-12 1274/week @ 2024-02-19 1207/week @ 2024-02-26 1578/week @ 2024-03-04 1195/week @ 2024-03-11 1025/week @ 2024-03-18 1045/week @ 2024-03-25

4,981 downloads per month
Used in 11 crates (7 directly)

BSD-2-Clause

145KB
3.5K SLoC

rusty-s3

crates.io Documentation dependency status Rustc Version 1.67+ CI codecov

Simple pure Rust AWS S3 Client following a Sans-IO approach, with a modern and rusty take onto s3's APIs.

Request signing and response parsing capabilities are provided for the most common S3 actions, using AWS Signature Version 4.

Minio compatibility tested on every commit by GitHub Actions.

Examples

use std::env;
use std::time::Duration;
use rusty_s3::{Bucket, Credentials, S3Action, UrlStyle};

// setting up a bucket
let endpoint = "https://s3.dualstack.eu-west-1.amazonaws.com".parse().expect("endpoint is a valid Url");
let path_style = UrlStyle::VirtualHost;
let name = "rusty-s3";
let region = "eu-west-1";
let bucket = Bucket::new(endpoint, path_style, name, region).expect("Url has a valid scheme and host");

// setting up the credentials
let key = env::var("AWS_ACCESS_KEY_ID").expect("AWS_ACCESS_KEY_ID is set and a valid String");
let secret = env::var("AWS_SECRET_ACCESS_KEY").expect("AWS_ACCESS_KEY_ID is set and a valid String");
let credentials = Credentials::new(key, secret);

// signing a request
let presigned_url_duration = Duration::from_secs(60 * 60);
let action = bucket.get_object(Some(&credentials), "duck.jpg");
println!("GET {}", action.sign(presigned_url_duration));

More examples can be found in the examples directory on GitHub.

Supported S3 actions

Dependencies

~2.5–4MB
~98K SLoC