#s3 #aws #web #http #presigned-post-object

bin+lib presigned-post-rs

Presigned post object operation for aws s3 api

1 unstable release

new 0.1.0 Dec 17, 2024

#172 in #s3

MIT license

17KB
370 lines

Presigned post object operation

Simple presigned post for aws s3 api.

Usage:

use time::OffsetDateTime;
use presigned_post_rs::PresignedPostData;
use presigned_post_rs::mediatype;

fn main() {
    let presigned_post = PresignedPostData::builder(
        "access_key",
        "key_id",
        "https://storage.yandexcloud.net",
        "ru-central1",
        "test-data",
        "image.png",
    )
    .with_mime(mediatype::media_type!(IMAGE / PNG))
    .with_date(OffsetDateTime::UNIX_EPOCH)
    .with_expiration(time::Duration::minutes(10))
    .with_content_length_range(0, 5 * 1_000_000)
    .build()
    .expect("Failed to build presigned post");
}

Dependencies

~2.3–3.5MB
~69K SLoC