From f94e1a3e127a820b0fa160e142692bd1e2b6fbf4 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Wed, 30 Oct 2024 16:45:31 +0300 Subject: [PATCH] [#505] docs: Add example of uploading file using presigned URL Signed-off-by: Marina Biryukova --- docs/authmate.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/authmate.md b/docs/authmate.md index 5c947ee..2cee910 100644 --- a/docs/authmate.md +++ b/docs/authmate.md @@ -349,6 +349,25 @@ $ frostfs-s3-authmate generate-presigned-url --endpoint http://localhost:8084 \ } ``` +### Upload file with presigned URL + +1. Generate presigned URL to upload object `obj` to bucket `presigned` + + ```shell + $ frostfs-s3-authmate generate-presigned-url --endpoint http://localhost:8084 \ + --method put --bucket presigned --object obj --lifetime 30s + + { + "URL": "http://localhost:8084/presigned/obj?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=CYfbvKwSC9VNvttj5snyEZ5Ttr2VaBabpw7mRuEzNXyw09ewUERj6MGDKfyckfg5VZ39GfXbwLwz62UPVeRxhJDet%2F20241029%2Fdefault%2Fs3%2Faws4_request&X-Amz-Date=20241029T145726Z&X-Amz-Expires=30&X-Amz-SignedHeaders=host&X-Amz-Signature=2bb13b3e6448968219ad95147debe49e37bce5ce3ed1344c4015f43cb444a956" + } + ``` + +2. Upload file using `curl` + + ```shell + curl --upload-file /path/to/file 'http://localhost:8084/presigned/obj?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=CYfbvKwSC9VNvttj5snyEZ5Ttr2VaBabpw7mRuEzNXyw09ewUERj6MGDKfyckfg5VZ39GfXbwLwz62UPVeRxhJDet%2F20241029%2Fdefault%2Fs3%2Faws4_request&X-Amz-Date=20241029T145726Z&X-Amz-Expires=30&X-Amz-SignedHeaders=host&X-Amz-Signature=2bb13b3e6448968219ad95147debe49e37bce5ce3ed1344c4015f43cb444a956' + ``` + ### AWS CLI You can also can get the presigned URL (only for GET) using aws cli v2: