Crates.io | axum-signed-urls |
lib.rs | axum-signed-urls |
version | 0.1.1 |
source | src |
created_at | 2023-02-09 03:49:11.988699 |
updated_at | 2023-02-09 04:00:52.316511 |
description | Signed URL middleware for Axum, via Extractors |
homepage | |
repository | https://github.com/m1guelpf/axum-signed-urls |
max_upload_size | |
id | 780468 |
size | 35,692 |
axum-signed-urls
Signed URL middleware for Axum, using extractors.
use axum::{routing::get, Router};
use axum_signed_urls::{SignedUrl, build};
// This route will only be accessible if the URL is signed
async fn handler(_: SignedUrl) -> String {
// This is how you create a signed URL
build("/path", vec![("foo", "bar")].into_iter().collect()).unwrap()
}
The most often issue with this extractor is using it after one consuming body e.g.
[axum::extract::Json
].
To fix this rearrange extractors in your handler definition moving body consumption to the
end, see details.
This project is licensed under the MIT License - see the LICENSE file for details.