mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 11:06:17 +00:00
Add OpenStack Swift API Support (#2066)
Co-authored-by: houseme <housemecn@gmail.com> Co-authored-by: Copilot <noreply@github.com>
This commit is contained in:
@@ -155,6 +155,33 @@ pub fn is_operation_supported(protocol: super::session::Protocol, action: &S3Act
|
||||
S3Action::ListBuckets => true, // LIST at root level
|
||||
S3Action::HeadBucket => true, // Can check if directory exists
|
||||
},
|
||||
super::session::Protocol::Swift => match action {
|
||||
// Swift supports most S3 operations via translation
|
||||
S3Action::CreateBucket => true, // PUT container
|
||||
S3Action::DeleteBucket => true, // DELETE container
|
||||
S3Action::GetObject => true, // GET object
|
||||
S3Action::PutObject => true, // PUT object
|
||||
S3Action::DeleteObject => true, // DELETE object
|
||||
S3Action::HeadObject => true, // HEAD object
|
||||
S3Action::CopyObject => true, // COPY method
|
||||
S3Action::ListBucket => true, // GET container
|
||||
S3Action::ListBuckets => true, // GET account
|
||||
S3Action::HeadBucket => true, // HEAD container
|
||||
|
||||
// Multipart not directly supported by Swift API (uses different approach)
|
||||
S3Action::CreateMultipartUpload => false,
|
||||
S3Action::UploadPart => false,
|
||||
S3Action::CompleteMultipartUpload => false,
|
||||
S3Action::AbortMultipartUpload => false,
|
||||
S3Action::ListMultipartUploads => false,
|
||||
S3Action::ListParts => false,
|
||||
|
||||
// ACL operations not supported by Swift API (uses different model)
|
||||
S3Action::GetBucketAcl => false,
|
||||
S3Action::PutBucketAcl => false,
|
||||
S3Action::GetObjectAcl => false,
|
||||
S3Action::PutObjectAcl => false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ use std::sync::Arc;
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Protocol {
|
||||
Ftps,
|
||||
Swift,
|
||||
}
|
||||
|
||||
/// Protocol principal representing an authenticated user
|
||||
|
||||
Reference in New Issue
Block a user