refactor: move bucket operations contract (#3507)

This commit is contained in:
安正超
2026-06-17 09:10:38 +08:00
committed by GitHub
parent 5b36ef5556
commit ed55857bca
37 changed files with 130 additions and 107 deletions
+1 -2
View File
@@ -22,11 +22,10 @@ use hyper::{Method, StatusCode};
use matchit::Params;
use rustfs_credentials::get_global_action_cred;
use rustfs_ecstore::bucket::versioning_sys::BucketVersioningSys;
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_policy::policy::BucketPolicy;
use rustfs_policy::policy::default::DEFAULT_POLICIES;
use rustfs_policy::policy::{Args, action::Action, action::S3Action};
use rustfs_storage_api::{BucketOptions, StorageAdminApi};
use rustfs_storage_api::{BucketOperations, BucketOptions, StorageAdminApi};
use s3s::header::CONTENT_TYPE;
use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, s3_error};
use serde::Serialize;
+1 -2
View File
@@ -38,13 +38,12 @@ use rustfs_ecstore::{
target::BucketTargets,
},
error::StorageError,
store_api::BucketOperations,
};
use rustfs_policy::policy::{
BucketPolicy,
action::{Action, AdminAction},
};
use rustfs_storage_api::{BucketOptions, MakeBucketOptions};
use rustfs_storage_api::{BucketOperations, BucketOptions, MakeBucketOptions};
use rustfs_utils::path::{SLASH_SEPARATOR, path_join_buf};
use s3s::{
Body, S3Request, S3Response, S3Result,
@@ -33,10 +33,10 @@ use rustfs_config::MAX_ADMIN_REQUEST_BODY_SIZE;
use rustfs_credentials::get_global_action_cred;
use rustfs_ecstore::{
global::get_global_region,
store_api::{BucketOperations, ListOperations, ObjectIO, ObjectOperations, ObjectOptions},
store_api::{ListOperations, ObjectIO, ObjectOperations, ObjectOptions},
};
use rustfs_policy::policy::action::{Action, S3Action};
use rustfs_storage_api::bucket::BucketOptions;
use rustfs_storage_api::{BucketOperations, bucket::BucketOptions};
use rustfs_trusted_proxies::{ClientInfo, ValidationMode};
use rustfs_utils::{base64_decode_url_safe_no_pad, base64_encode_url_safe_no_pad};
use s3s::{Body, S3Request, S3Response, S3Result, dto::StreamingBlob, header::CONTENT_TYPE, s3_error};
+1 -2
View File
@@ -28,10 +28,9 @@ use rustfs_ecstore::{
error::StorageError,
notification_sys::get_global_notification_sys,
rebalance::{DiskStat, RebalSaveOpt, RebalanceCleanupWarnings, RebalanceMeta},
store_api::BucketOperations,
};
use rustfs_policy::policy::action::{Action, AdminAction};
use rustfs_storage_api::{BucketOptions, StorageAdminApi};
use rustfs_storage_api::{BucketOperations, BucketOptions, StorageAdminApi};
use s3s::{
Body, S3Request, S3Response, S3Result,
header::{CONTENT_LENGTH, CONTENT_TYPE},
+1 -2
View File
@@ -34,9 +34,8 @@ use rustfs_ecstore::bucket::replication::GLOBAL_REPLICATION_STATS;
use rustfs_ecstore::bucket::target::BucketTarget;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::global::global_rustfs_port;
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_policy::policy::action::{Action, AdminAction};
use rustfs_storage_api::BucketOptions;
use rustfs_storage_api::{BucketOperations, BucketOptions};
use s3s::header::CONTENT_TYPE;
use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, s3_error};
use std::collections::HashMap;
@@ -50,7 +50,6 @@ use rustfs_ecstore::bucket::versioning::VersioningApi;
use rustfs_ecstore::config::com::{delete_config, read_config, save_config};
use rustfs_ecstore::error::Error as StorageError;
use rustfs_ecstore::global::{get_global_deployment_id, get_global_endpoints_opt, get_global_region, global_rustfs_port};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_iam::error::is_err_no_such_service_account;
use rustfs_iam::store::{MappedPolicy, UserType};
use rustfs_iam::sys::{
@@ -71,7 +70,7 @@ use rustfs_policy::policy::{
};
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
use rustfs_signer::sign_v4;
use rustfs_storage_api::{BucketOptions, DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp};
use rustfs_storage_api::{BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp};
use rustfs_tls_runtime::{GlobalPublishedOutboundTlsState, load_global_outbound_tls_generation, load_global_outbound_tls_state};
use rustfs_utils::http::get_source_scheme;
use rustls_pki_types::pem::PemObject;
+1 -2
View File
@@ -62,14 +62,13 @@ use rustfs_ecstore::global::GLOBAL_BOOT_TIME;
use rustfs_ecstore::global::{get_global_bucket_monitor, get_global_deployment_id, get_global_region};
use rustfs_ecstore::notification_sys::get_global_notification_sys;
use rustfs_ecstore::rpc::PeerRestClient;
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_filemeta::{ReplicationStatusType, ReplicationType};
use rustfs_madmin::utils::parse_duration;
use rustfs_notify::{Event as NotificationEvent, notification_system};
use rustfs_policy::policy::action::{Action, S3Action};
use rustfs_s3_types::EventName;
use rustfs_signer::pre_sign_v4;
use rustfs_storage_api::BucketOptions;
use rustfs_storage_api::{BucketOperations, BucketOptions};
use rustfs_utils::http::{
SUFFIX_SOURCE_DELETEMARKER, SUFFIX_SOURCE_MTIME, SUFFIX_SOURCE_REPLICATION_CHECK, SUFFIX_SOURCE_REPLICATION_REQUEST,
SUFFIX_SOURCE_VERSION_ID, get_source_scheme, insert_header,
+2 -2
View File
@@ -57,14 +57,14 @@ use rustfs_ecstore::client::object_api_utils::to_s3s_etag;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::notification_sys::get_global_notification_sys;
use rustfs_ecstore::store::ECStore;
use rustfs_ecstore::store_api::{BucketOperations, ListObjectVersionsInfo, ListObjectsV2Info, ListOperations, ObjectInfo};
use rustfs_ecstore::store_api::{ListObjectVersionsInfo, ListObjectsV2Info, ListOperations, ObjectInfo};
use rustfs_madmin::{SITE_REPL_API_VERSION, SRBucketMeta};
use rustfs_policy::policy::{
action::{Action, S3Action},
{BucketPolicy, BucketPolicyArgs, Effect, Validator},
};
use rustfs_s3_ops::S3Operation;
use rustfs_storage_api::{BucketOptions, DeleteBucketOptions, MakeBucketOptions};
use rustfs_storage_api::{BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
use rustfs_targets::{
EventName,
arn::{ARN, TargetIDError},
+2 -2
View File
@@ -18,10 +18,10 @@ use rustfs_ecstore::{
disk::endpoint::Endpoint,
endpoints::{EndpointServerPools, Endpoints, PoolEndpoints},
store::ECStore,
store_api::{BucketOperations, HealOperations, ObjectIO, ObjectOptions, PutObjReader},
store_api::{HealOperations, ObjectIO, ObjectOptions, PutObjReader},
};
use rustfs_object_capacity::capacity_manager::{HybridStrategyConfig, create_isolated_manager};
use rustfs_storage_api::{BucketOptions, MakeBucketOptions};
use rustfs_storage_api::{BucketOperations, BucketOptions, MakeBucketOptions};
use serial_test::serial;
use std::{
collections::HashSet,
@@ -29,14 +29,14 @@ use rustfs_ecstore::{
endpoints::{EndpointServerPools, Endpoints, PoolEndpoints},
global::GLOBAL_TierConfigMgr,
store::ECStore,
store_api::{BucketOperations, ListOperations, MultipartOperations, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader},
store_api::{ListOperations, MultipartOperations, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader},
tier::{
tier_config::{TierConfig, TierType},
warm_backend::{WarmBackend, WarmBackendGetOpts},
},
};
use rustfs_object_capacity::capacity_manager::{HybridStrategyConfig, create_isolated_manager};
use rustfs_storage_api::{BucketOptions, MakeBucketOptions};
use rustfs_storage_api::{BucketOperations, BucketOptions, MakeBucketOptions};
use rustfs_utils::http::{SUFFIX_FORCE_DELETE, insert_header};
use s3s::{S3Request, dto::*};
use serial_test::serial;
+1 -2
View File
@@ -66,11 +66,10 @@ use rustfs_ecstore::{
set_global_endpoints,
store::ECStore,
store::init_local_disks,
store_api::BucketOperations,
update_erasure_type,
};
use rustfs_obs::{init_obs, set_global_guard};
use rustfs_storage_api::BucketOptions;
use rustfs_storage_api::{BucketOperations, BucketOptions};
use rustfs_utils::net::parse_and_resolve_address;
use rustls::crypto::aws_lc_rs::default_provider;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
+1 -2
View File
@@ -38,7 +38,6 @@ use rustfs_ecstore::{
global::shutdown_background_services,
notification_sys::new_global_notification_sys,
store::ECStore,
store_api::BucketOperations,
};
use rustfs_heal::{
create_ahm_services_cancel_token, heal::storage::ECStoreHealStorage, init_heal_manager, shutdown_ahm_services,
@@ -46,7 +45,7 @@ use rustfs_heal::{
use rustfs_iam::init_oidc_sys;
use rustfs_obs::init_metrics_runtime;
use rustfs_scanner::init_data_scanner;
use rustfs_storage_api::BucketOptions;
use rustfs_storage_api::{BucketOperations, BucketOptions};
use rustfs_utils::get_env_bool_with_aliases;
use std::{
future::Future,
+1 -1
View File
@@ -24,13 +24,13 @@ use rustfs_ecstore::bucket::policy_sys::PolicySys;
use rustfs_ecstore::error::{StorageError, is_err_bucket_not_found};
use rustfs_ecstore::resolve_object_store_handle;
use rustfs_ecstore::store::ECStore;
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_iam::error::Error as IamError;
use rustfs_policy::policy::action::{Action, AdminAction, S3Action};
use rustfs_policy::policy::{
Args, BucketPolicy, BucketPolicyArgs, bucket_policy_needs_existing_object_tag_for_args,
bucket_policy_uses_existing_object_tag_conditions,
};
use rustfs_storage_api::BucketOperations;
use rustfs_trusted_proxies::ClientInfo;
use rustfs_utils::http::AMZ_OBJECT_LOCK_BYPASS_GOVERNANCE;
use s3s::access::{S3Access, S3AccessContext};
+2 -2
View File
@@ -40,11 +40,11 @@ use rustfs_ecstore::{
versioning_sys::BucketVersioningSys,
},
error::{StorageError, is_err_bucket_not_found, is_err_object_not_found, is_err_version_not_found},
store_api::{BucketOperations, ObjectLockRetentionOptions, ObjectOperations, ObjectOptions},
store_api::{ObjectLockRetentionOptions, ObjectOperations, ObjectOptions},
};
use rustfs_io_metrics::record_s3_op;
use rustfs_s3_ops::S3Operation;
use rustfs_storage_api::BucketOptions;
use rustfs_storage_api::{BucketOperations, BucketOptions};
use rustfs_targets::EventName;
use rustfs_utils::http::headers::{
AMZ_OBJECT_LOCK_LEGAL_HOLD_LOWER, AMZ_OBJECT_LOCK_MODE_LOWER, AMZ_OBJECT_LOCK_RETAIN_UNTIL_DATE_LOWER,
+2 -2
View File
@@ -25,8 +25,8 @@ use rustfs_ecstore::bucket::object_lock::objectlock_sys;
use rustfs_ecstore::bucket::replication::ReplicationConfigurationExt;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::resolve_object_store_handle;
use rustfs_ecstore::store_api::{BucketOperations, ObjectInfo, ObjectToDelete};
use rustfs_storage_api::BucketOptions;
use rustfs_ecstore::store_api::{ObjectInfo, ObjectToDelete};
use rustfs_storage_api::{BucketOperations, BucketOptions};
use rustfs_targets::EventName;
use rustfs_targets::arn::{TargetID, TargetIDError};
use rustfs_utils::http::{