s3-presign
Minimal library to get an S3 presign URL.
Usage
use ;
let credentials = new;
let bucket = "my-bucket";
let region = "us-east-1";
let mut presigner = new;
// presigner.endpoint(endpoint);
let url = self.presigner.url_for_s3_url.unwrap;
let signed_url = self.sign_s3_request;
let signed_url = self.sign_s3_request;
let signed_url = self.sign_s3_request;
S3-compatible APIs
If you want to use the presigner with a different service that exposes an S3-compatible API (like Cloudflare R2),
you can do so by specifying a root when creating the Presigner/Bucket.
let root = "xxxxx.eu.r2.cloudflarestorage.com";
let bucketObj = mew_with_root;
let mut preBucket = from_bucket;
preBucket.use_path_style; // Cloudflare R2 only works with Path-Style!!!
let mut presigner = new_with_root;
⚠️ Cloudflare R2
The R2s S3-API requires path style! Therefore, you can not use the global convenience function. Instead you need to create a
Presignerand callPresigner::use_path_style(&self)on it.