aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_router.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-01-05 16:23:09 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-05 16:28:19 +0100
commit135858d067e21e5207d275f4a56a5b721a685a07 (patch)
tree907d4aa3fd9b766e81aa0568689cb2d92a32a697 /src/api/s3_router.rs
parent8395030e4891ae48ca30428318e8d435c157f74f (diff)
downloadgarage-135858d067e21e5207d275f4a56a5b721a685a07.tar.gz
garage-135858d067e21e5207d275f4a56a5b721a685a07.zip
Implement DeleteBucket
Diffstat (limited to 'src/api/s3_router.rs')
-rw-r--r--src/api/s3_router.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/api/s3_router.rs b/src/api/s3_router.rs
index 4ce1d238..f32aed30 100644
--- a/src/api/s3_router.rs
+++ b/src/api/s3_router.rs
@@ -789,7 +789,6 @@ impl Endpoint {
GetBucketRequestPayment,
GetBucketTagging,
GetBucketVersioning,
- GetBucketWebsite,
GetObject,
GetObjectAcl,
GetObjectLegalHold,
@@ -813,8 +812,22 @@ impl Endpoint {
]
}
.is_some();
+ let owner = s3_match! {
+ @extract
+ self,
+ bucket,
+ [
+ DeleteBucket,
+ GetBucketWebsite,
+ PutBucketWebsite,
+ DeleteBucketWebsite,
+ ]
+ }
+ .is_some();
if readonly {
Authorization::Read(bucket)
+ } else if owner {
+ Authorization::Owner(bucket)
} else {
Authorization::Write(bucket)
}
@@ -830,6 +843,8 @@ pub enum Authorization<'a> {
Read(&'a str),
/// Having Write permission on bucket .0 is required
Write(&'a str),
+ /// Having Owner permission on bucket .0 is required
+ Owner(&'a str),
}
/// This macro is used to generate part of the code in this module. It must be called only one, and