diff options
author | Alex Auvolat <alex@adnab.me> | 2022-01-05 16:23:09 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-05 16:28:19 +0100 |
commit | 135858d067e21e5207d275f4a56a5b721a685a07 (patch) | |
tree | 907d4aa3fd9b766e81aa0568689cb2d92a32a697 /src/api/api_server.rs | |
parent | 8395030e4891ae48ca30428318e8d435c157f74f (diff) | |
download | garage-135858d067e21e5207d275f4a56a5b721a685a07.tar.gz garage-135858d067e21e5207d275f4a56a5b721a685a07.zip |
Implement DeleteBucket
Diffstat (limited to 'src/api/api_server.rs')
-rw-r--r-- | src/api/api_server.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/api/api_server.rs b/src/api/api_server.rs index db5da8cc..41ae6857 100644 --- a/src/api/api_server.rs +++ b/src/api/api_server.rs @@ -123,6 +123,7 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon let allowed = match endpoint.authorization_type() { Authorization::Read(_) => api_key.allow_read(&bucket_id), Authorization::Write(_) => api_key.allow_write(&bucket_id), + Authorization::Owner(_) => api_key.allow_owner(&bucket_id), _ => unreachable!(), }; @@ -199,9 +200,9 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon let response = Response::builder().body(empty_body).unwrap(); Ok(response) } - Endpoint::DeleteBucket { .. } => Err(Error::Forbidden( - "Cannot delete buckets using S3 api, please talk to Garage directly".into(), - )), + Endpoint::DeleteBucket { .. } => { + handle_delete_bucket(&garage, bucket_id, bucket_name, api_key).await + } Endpoint::GetBucketLocation { .. } => handle_get_bucket_location(garage), Endpoint::GetBucketVersioning { .. } => handle_get_bucket_versioning(), Endpoint::ListObjects { |