aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/api_server.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2024-02-22 12:05:19 +0000
committerAlex <alex@adnab.me>2024-02-22 12:05:19 +0000
commit74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6 (patch)
treef7747f950672246c1ecc079e50222a07d23bc635 /src/api/s3/api_server.rs
parent7e212e20e02b9cdced52ce23111214c6285a095a (diff)
parentcff702a951cb5bb193c7a891ababfd1d962ae9ed (diff)
downloadgarage-74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6.tar.gz
garage-74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6.zip
Merge pull request 'Add node-global lock for bucket/key operations (fix #723)' (#728) from lock-createbucket into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/728
Diffstat (limited to 'src/api/s3/api_server.rs')
-rw-r--r--src/api/s3/api_server.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/api/s3/api_server.rs b/src/api/s3/api_server.rs
index 7fac6261..08405923 100644
--- a/src/api/s3/api_server.rs
+++ b/src/api/s3/api_server.rs
@@ -148,7 +148,14 @@ impl ApiHandler for S3ApiServer {
// Special code path for CreateBucket API endpoint
if let Endpoint::CreateBucket {} = endpoint {
- return handle_create_bucket(&garage, req, content_sha256, api_key, bucket_name).await;
+ return handle_create_bucket(
+ &garage,
+ req,
+ content_sha256,
+ &api_key.key_id,
+ bucket_name,
+ )
+ .await;
}
let bucket_id = garage
@@ -261,7 +268,7 @@ impl ApiHandler for S3ApiServer {
Ok(response)
}
Endpoint::DeleteBucket {} => {
- handle_delete_bucket(&garage, bucket_id, bucket_name, api_key).await
+ handle_delete_bucket(&garage, bucket_id, bucket_name, &api_key.key_id).await
}
Endpoint::GetBucketLocation {} => handle_get_bucket_location(garage),
Endpoint::GetBucketVersioning {} => handle_get_bucket_versioning(),