refactor(storage-api): remove legacy bucket DTO re-export (#3364)

This commit is contained in:
安正超
2026-06-11 21:24:56 +08:00
committed by GitHub
parent 0a987d870b
commit 7146c893cb
35 changed files with 114 additions and 132 deletions
Generated
+1
View File
@@ -9773,6 +9773,7 @@ dependencies = [
"rustfs-keystone",
"rustfs-policy",
"rustfs-rio",
"rustfs-storage-api",
"rustfs-tls-runtime",
"rustfs-utils",
"rustls",
+2
View File
@@ -57,6 +57,8 @@ mod readers;
mod traits;
mod types;
pub(crate) use rustfs_storage_api::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
pub use readers::*;
pub use traits::*;
pub use types::*;
-3
View File
@@ -1,8 +1,5 @@
use super::*;
// RUSTFS_COMPAT_TODO(API-003): keep old ecstore::store_api bucket DTO import paths while storage API consumers migrate. Remove after all consumers import these DTOs from rustfs_storage_api.
pub use rustfs_storage_api::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp};
#[derive(Debug, Default, Clone)]
pub struct HTTPPreconditions {
pub if_match: Option<String>,
@@ -12,31 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rustfs_ecstore::store_api::{
BucketInfo as EcstoreBucketInfo, BucketOptions as EcstoreBucketOptions, MakeBucketOptions as EcstoreMakeBucketOptions,
};
use rustfs_ecstore::{disk::DiskStore, error::Error, store::ECStore};
use rustfs_storage_api::{
BucketInfo as ApiBucketInfo, BucketOptions as ApiBucketOptions, MakeBucketOptions as ApiMakeBucketOptions, StorageAdminApi,
};
#[test]
fn old_store_api_bucket_dto_path_reexports_storage_api_types() {
let ecstore_bucket: EcstoreBucketInfo = ApiBucketInfo {
name: "photos".to_owned(),
versioning: true,
..Default::default()
};
let api_bucket: ApiBucketInfo = ecstore_bucket;
let ecstore_make: EcstoreMakeBucketOptions = ApiMakeBucketOptions::default();
let api_options: ApiBucketOptions = EcstoreBucketOptions::default();
assert_eq!(api_bucket.name, "photos");
assert!(api_bucket.versioning);
assert!(!ecstore_make.lock_enabled);
assert!(!api_options.no_metadata);
}
use rustfs_storage_api::StorageAdminApi;
fn storage_admin_api_type_name<T>() -> &'static str
where
+2 -2
View File
@@ -420,13 +420,13 @@ mod tests {
async fn format_disk(&self, _endpoint: &rustfs_ecstore::disk::endpoint::Endpoint) -> crate::Result<()> {
Ok(())
}
async fn get_bucket_info(&self, _bucket: &str) -> crate::Result<Option<rustfs_ecstore::store_api::BucketInfo>> {
async fn get_bucket_info(&self, _bucket: &str) -> crate::Result<Option<rustfs_storage_api::BucketInfo>> {
Ok(None)
}
async fn heal_bucket_metadata(&self, _bucket: &str) -> crate::Result<()> {
Ok(())
}
async fn list_buckets(&self) -> crate::Result<Vec<rustfs_ecstore::store_api::BucketInfo>> {
async fn list_buckets(&self) -> crate::Result<Vec<rustfs_storage_api::BucketInfo>> {
Ok(vec![])
}
async fn object_exists(&self, _bucket: &str, _object: &str) -> crate::Result<bool> {
+2 -4
View File
@@ -1353,11 +1353,9 @@ mod tests {
use crate::heal::storage::HealStorageAPI;
use crate::heal::task::{HealOptions, HealPriority, HealRequest, HealType};
use rustfs_common::heal_channel::HealOpts;
use rustfs_ecstore::{
disk::{DiskStore, endpoint::Endpoint},
store_api::BucketInfo,
};
use rustfs_ecstore::disk::{DiskStore, endpoint::Endpoint};
use rustfs_madmin::heal_commands::HealResultItem;
use rustfs_storage_api::BucketInfo;
struct MockStorage;
+2 -2
View File
@@ -19,10 +19,10 @@ use rustfs_ecstore::{
disk::{DiskStore, endpoint::Endpoint},
error::StorageError,
store::ECStore,
store_api::{BucketInfo, BucketOperations, HealOperations, ListOperations, ObjectIO, ObjectOperations, ObjectOptions},
store_api::{BucketOperations, HealOperations, ListOperations, ObjectIO, ObjectOperations, ObjectOptions},
};
use rustfs_madmin::heal_commands::HealResultItem;
use rustfs_storage_api::{DiskSetSelector, StorageAdminApi};
use rustfs_storage_api::{BucketInfo, DiskSetSelector, StorageAdminApi};
use std::sync::Arc;
use tracing::{debug, error, info, warn};
+2 -1
View File
@@ -1282,9 +1282,10 @@ mod tests {
use rustfs_ecstore::{
data_usage::DATA_USAGE_CACHE_NAME,
disk::{BUCKET_META_PREFIX, DiskStore, RUSTFS_META_BUCKET, endpoint::Endpoint},
store_api::{BucketInfo, ObjectInfo},
store_api::ObjectInfo,
};
use rustfs_madmin::heal_commands::HealResultItem;
use rustfs_storage_api::BucketInfo;
use std::sync::Mutex;
#[derive(Default)]
+4 -4
View File
@@ -201,13 +201,13 @@ fn test_heal_task_status_atomic_update() {
async fn format_disk(&self, _endpoint: &rustfs_ecstore::disk::endpoint::Endpoint) -> rustfs_heal::Result<()> {
Ok(())
}
async fn get_bucket_info(&self, _bucket: &str) -> rustfs_heal::Result<Option<rustfs_ecstore::store_api::BucketInfo>> {
async fn get_bucket_info(&self, _bucket: &str) -> rustfs_heal::Result<Option<rustfs_storage_api::BucketInfo>> {
Ok(None)
}
async fn heal_bucket_metadata(&self, _bucket: &str) -> rustfs_heal::Result<()> {
Ok(())
}
async fn list_buckets(&self) -> rustfs_heal::Result<Vec<rustfs_ecstore::store_api::BucketInfo>> {
async fn list_buckets(&self) -> rustfs_heal::Result<Vec<rustfs_storage_api::BucketInfo>> {
Ok(vec![])
}
async fn object_exists(&self, _bucket: &str, _object: &str) -> rustfs_heal::Result<bool> {
@@ -334,7 +334,7 @@ async fn test_heal_task_transient_object_exists_skip_avoids_recreate() {
Ok(())
}
async fn get_bucket_info(&self, _bucket: &str) -> rustfs_heal::Result<Option<rustfs_ecstore::store_api::BucketInfo>> {
async fn get_bucket_info(&self, _bucket: &str) -> rustfs_heal::Result<Option<rustfs_storage_api::BucketInfo>> {
Ok(None)
}
@@ -342,7 +342,7 @@ async fn test_heal_task_transient_object_exists_skip_avoids_recreate() {
Ok(())
}
async fn list_buckets(&self) -> rustfs_heal::Result<Vec<rustfs_ecstore::store_api::BucketInfo>> {
async fn list_buckets(&self) -> rustfs_heal::Result<Vec<rustfs_storage_api::BucketInfo>> {
Ok(Vec::new())
}
+1 -1
View File
@@ -133,7 +133,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>, Arc<ECStoreHealStorage
// init bucket metadata system
let buckets_list = ecstore
.list_bucket(&rustfs_ecstore::store_api::BucketOptions {
.list_bucket(&rustfs_storage_api::BucketOptions {
no_metadata: true,
..Default::default()
})
+2 -2
View File
@@ -36,11 +36,11 @@ use rustfs_ecstore::data_usage::load_data_usage_from_backend;
use rustfs_ecstore::global::get_global_bucket_monitor;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::pools::{get_total_usable_capacity, get_total_usable_capacity_free};
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_iam::{get_global_iam_sys, oidc::oidc_plugin_authn_metrics_snapshot};
use rustfs_io_metrics::internode_metrics::global_internode_metrics;
use rustfs_io_metrics::{ProcessStatusSnapshot, snapshot_process_resource_and_system};
use rustfs_storage_api::StorageAdminApi;
use rustfs_storage_api::{BucketOptions, StorageAdminApi};
use std::collections::HashMap;
use std::time::Duration;
use sysinfo::{Networks, System};
+1
View File
@@ -63,6 +63,7 @@ rustfs-credentials = { workspace = true }
rustfs-policy = { workspace = true }
rustfs-utils = { workspace = true }
rustfs-config = { workspace = true }
rustfs-storage-api = { workspace = true }
rustfs-tls-runtime = { workspace = true, optional = true }
# Async dependencies
+2 -1
View File
@@ -17,7 +17,8 @@
use super::{SwiftError, SwiftResult};
use rustfs_credentials::Credentials;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, MakeBucketOptions};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_storage_api::MakeBucketOptions;
use s3s::dto::{Tag, Tagging};
use sha2::{Digest, Sha256};
use std::collections::HashMap;
+2 -3
View File
@@ -21,9 +21,8 @@ use super::types::Container;
use super::{SwiftError, SwiftResult};
use rustfs_credentials::Credentials;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{
BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, ListOperations, MakeBucketOptions,
};
use rustfs_ecstore::store_api::{BucketOperations, ListOperations};
use rustfs_storage_api::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
use s3s::dto::{Tag, Tagging};
use sha2::{Digest, Sha256};
use tracing::{debug, error};
+2 -1
View File
@@ -55,8 +55,9 @@ use super::{SwiftError, SwiftResult};
use axum::http::HeaderMap;
use rustfs_credentials::Credentials;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader};
use rustfs_ecstore::store_api::{BucketOperations, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader};
use rustfs_rio::HashReader;
use rustfs_storage_api::BucketOptions;
use std::collections::HashMap;
use tracing::debug;
use tracing::error;
+2 -1
View File
@@ -46,7 +46,8 @@ use rustfs_ecstore::disk::RUSTFS_META_BUCKET;
use rustfs_ecstore::error::Error as EcstoreError;
use rustfs_ecstore::global::is_erasure_sd;
use rustfs_ecstore::store::ECStore;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_storage_api::BucketOptions;
use serde::{Deserialize, Serialize};
use tokio::sync::mpsc;
use tokio::time::{Duration, Instant};
+2 -2
View File
@@ -41,10 +41,10 @@ use rustfs_ecstore::error::{Error, StorageError};
use rustfs_ecstore::global::GLOBAL_TierConfigMgr;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::set_disk::SetDisks;
use rustfs_ecstore::store_api::{BucketInfo, BucketOperations, BucketOptions, ObjectIO, ObjectInfo};
use rustfs_ecstore::store_api::{BucketOperations, ObjectIO, ObjectInfo};
use rustfs_ecstore::{error::Result, store::ECStore};
use rustfs_filemeta::FileMeta;
use rustfs_storage_api::{DiskSetSelector, StorageAdminApi};
use rustfs_storage_api::{BucketInfo, BucketOptions, DiskSetSelector, StorageAdminApi};
use rustfs_utils::path::path_join_buf;
use s3s::dto::{BucketLifecycleConfiguration, ReplicationConfiguration};
use std::collections::{HashMap, HashSet};
@@ -28,10 +28,7 @@ use rustfs_ecstore::{
global::GLOBAL_TierConfigMgr,
pools::path2_bucket_object_with_base_path,
store::ECStore,
store_api::{
BucketOperations, ListOperations, MakeBucketOptions, MultipartOperations, ObjectIO, ObjectOperations, ObjectOptions,
PutObjReader,
},
store_api::{BucketOperations, ListOperations, MultipartOperations, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader},
tier::{
tier_config::{TierConfig, TierMinIO, TierType},
warm_backend::{WarmBackend, WarmBackendGetOpts, build_transition_put_options},
@@ -41,6 +38,7 @@ use rustfs_filemeta::FileMeta;
use rustfs_scanner::scanner::init_data_scanner;
use rustfs_scanner::scanner_folder::ScannerItem;
use rustfs_scanner::scanner_io::ScannerIODisk;
use rustfs_storage_api::MakeBucketOptions;
use rustfs_utils::path::path_join_buf;
use s3s::dto::RestoreRequest;
use serial_test::serial;
@@ -132,7 +130,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>) {
// init bucket metadata system
let buckets_list = ecstore
.list_bucket(&rustfs_ecstore::store_api::BucketOptions {
.list_bucket(&rustfs_storage_api::BucketOptions {
no_metadata: true,
..Default::default()
})
@@ -198,7 +196,7 @@ async fn setup_isolated_test_env(init_expiry: bool) -> (Vec<PathBuf>, Arc<ECStor
.unwrap();
let buckets_list = ecstore
.list_bucket(&rustfs_ecstore::store_api::BucketOptions {
.list_bucket(&rustfs_storage_api::BucketOptions {
no_metadata: true,
..Default::default()
})
@@ -18,12 +18,6 @@ for later deletion.
- Why: legacy KMS create-key and key-status admin grants must keep working during the dedicated KMS policy migration.
- Removal condition: remove after KMS admin clients and built-in policies use `kms:Configure`, `kms:DescribeKey`, and `kms:ListKeys`.
- Status: planned cleanup.
- `RUSTFS_COMPAT_TODO(API-003)`
- Task: `API-003`
- File: `crates/ecstore/src/store_api/types.rs`
- Why: old `ecstore::store_api` bucket DTO import paths must keep compiling while storage API consumers migrate.
- Removal condition: remove after all consumers import bucket DTOs from the storage API crate.
- Status: planned cleanup.
- `RUSTFS_COMPAT_TODO(API-012)`
- Task: `API-012`
- File: `crates/ecstore/src/store_api/traits.rs`
+51 -41
View File
@@ -5,16 +5,16 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
## Current Context
- Issue: [`rustfs/backlog#660`](https://github.com/rustfs/backlog/issues/660)
- Branch: `overtrue/arch-config-compat-accessor-cleanup`
- Baseline: `origin/main` at `2e3c777309a68c0a21f267d7646a9798f6052277`
- Branch: `overtrue/arch-storage-api-dto-compat-cleanup`
- Baseline: `origin/main` at `0a987d870b3dca248bea8d4872568a25e235d917`
- PR type for this branch: `api-extraction`
- Runtime behavior changes: none intended.
- Rust code changes: remove the temporary CFG-008
`rustfs_ecstore::config` global server-config accessor compatibility
re-export after in-repo consumers moved to `rustfs_config::server_config`.
- Rust code changes: migrate remaining in-repo bucket DTO consumers to
`rustfs_storage_api` and remove the temporary API-003 public ECStore
`store_api` bucket DTO re-export.
- CI/script changes: none.
- Docs changes: remove the CFG-008 cleanup-register entry and record the
completed compatibility cleanup in the model-boundary ADR and progress notes.
- Docs changes: remove the API-003 cleanup-register entry and record the
completed storage API DTO compatibility cleanup in progress notes.
## Phase 0 Tasks
@@ -216,12 +216,16 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
mapping uses the new contract.
- [x] `API-003` Move DTOs.
- Current PR: `rustfs/rustfs#3314` merged.
- Cleanup branch: `overtrue/arch-storage-api-dto-compat-cleanup`.
- Completed slice: move the pure bucket/options DTO subset:
`MakeBucketOptions`, `SRBucketDeleteOp`, `DeleteBucketOptions`,
`BucketOptions`, and `BucketInfo`.
- Acceptance: `rustfs-storage-api` exports these DTOs, ECStore re-exports
them from the old `ecstore::store_api` path, and compatibility cleanup is
registered with `RUSTFS_COMPAT_TODO(API-003)`.
- Cleanup slice: migrate in-repo external consumers to
`rustfs_storage_api`, keep ECStore implementation use crate-private, and
remove the old public `ecstore::store_api` bucket DTO re-export.
- Acceptance: `rustfs-storage-api` exports these DTOs, in-repo external
consumers no longer use the old `rustfs_ecstore::store_api` DTO path, and
`RUSTFS_COMPAT_TODO(API-003)` is removed from source and cleanup register.
- Must preserve: no `ObjectOptions`, `ObjectInfo`, reader, compression,
encryption, filemeta conversion, multipart conversion, route, storage, or
runtime behavior changes in this PR.
@@ -355,58 +359,64 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
## Next PRs
1. `security-change`: make Local KMS unsafe defaults explicit development
1. `api-extraction`: continue API-012 namespace-lock-only cleanup after all
callers that only need locking depend on `NamespaceLocking`.
2. `security-change`: make Local KMS unsafe defaults explicit development
opt-ins or production failures in KMSD-002.
2. `security-change`: make Vault unsafe defaults explicit development opt-ins
3. `security-change`: make Vault unsafe defaults explicit development opt-ins
or production failures in KMSD-003.
## Pre-Push Review Log
| Expert | Status | Notes |
|---|---|---|
| Quality/architecture | pass | Confirmed the diff only removes the temporary CFG-008 ECStore accessor re-export while keeping ECStore persistence, storage-class ownership, and config initialization unchanged. |
| Migration preservation | pass | Confirmed all in-repo runtime readers and writers already use `rustfs_config::server_config`, and ECStore initialization still writes the same global snapshot through a private import. |
| Testing/verification | pass | Confirmed focused ECStore/config compile and tests, migration guards, old-path scan, and Rust risk scan cover this compatibility cleanup; full pre-commit is skipped under the current larger-granularity instruction. |
| Quality/architecture | pass | Confirmed the diff only removes the temporary API-003 public ECStore bucket DTO re-export and migrates remaining in-repo external consumers to `rustfs_storage_api`; bucket operation traits and runtime control flow remain unchanged. |
| Migration preservation | pass | Confirmed ECStore keeps crate-private DTO visibility for its own implementation while no external in-repo consumer uses the old public `rustfs_ecstore::store_api` DTO path. |
| Testing/verification | pass | Confirmed focused compile/tests, rustfs all-targets compile, heal/scanner test target compile, migration guards, dependency guard, source old-path scan, and added-line Rust risk scan cover this cleanup; full pre-commit is skipped under the current larger-granularity instruction. |
## Verification Notes
Passed:
- `cargo check -p rustfs-config -p rustfs-ecstore --lib`.
- `cargo test -p rustfs-ecstore config --lib`; 59 passed.
Passed after rebasing onto `0a987d870b3dca248bea8d4872568a25e235d917`:
- `cargo check -p rustfs-storage-api -p rustfs-ecstore -p rustfs-heal -p rustfs-scanner -p rustfs-obs -p rustfs-protocols --lib`.
- `cargo check -p rustfs --all-targets`.
- `cargo test -p rustfs-storage-api --lib`; 7 passed.
- `cargo test -p rustfs-ecstore --test storage_api_compat_test`; 1 passed.
- `cargo test -p rustfs-heal --tests --no-run`.
- `cargo test -p rustfs-scanner --tests --no-run`.
- `cargo test -p rustfs-protocols --lib swift`; 0 matched, lib test target
compiled and ran successfully.
- `cargo test -p rustfs-obs --lib stats_collector`; 14 passed.
- `cargo fmt --all --check`.
- `./scripts/check_architecture_migration_rules.sh`.
- `./scripts/check_layer_dependencies.sh`.
- `./scripts/check_metrics_migration_refs.sh`.
- `git diff --check`.
- CFG-008 source old-path and marker scan found no
`RUSTFS_COMPAT_TODO(CFG-008)`,
`rustfs_ecstore::config::{get_global_server_config,
set_global_server_config}`, or `crate::config::{get_global_server_config,
set_global_server_config}` matches in `crates/**/*.rs` or `rustfs/src`.
- Added-line risk scan found no production `unwrap`/`expect`, lossy numeric
casts, stringly public errors, boxed dynamic errors, stdout/stderr printing,
or relaxed atomic ordering.
- `cargo tree -p rustfs-config --edges normal` found no dependency on
`rustfs-ecstore`, `rustfs-scanner`, `rustfs-iam`, or `rustfs`.
- API-003 source old-path and marker scan found no
`RUSTFS_COMPAT_TODO(API-003)` or
`rustfs_ecstore::store_api::{BucketInfo, BucketOptions,
DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp}` matches in
`crates/**/*.rs` or `rustfs/src`.
- Added-line Rust risk scan found no new production `unwrap`/`expect`, lossy
numeric casts, stringly public errors, boxed dynamic errors, stdout/stderr
printing, or relaxed atomic ordering.
Notes:
- Full pre-commit may be skipped if focused tests, compile checks, and guards
pass, per the current instruction to increase PR granularity.
- This slice removes only the old CFG-008 global server-config accessor
compatibility path. ECStore retains `ConfigSys`, config persistence helpers,
storage-class global state, default registration wiring, startup
initialization, and storage behavior.
- The old `rustfs_ecstore::config` accessor path is no longer available after
this cleanup. Consumers must use `rustfs_config::server_config`.
- This slice removes only the old API-003 public bucket DTO re-export.
ECStore retains bucket operation traits, object/listing DTOs, storage
implementation wiring, and crate-private access to the storage API bucket
DTOs for its own trait implementations.
- The old public `rustfs_ecstore::store_api` bucket DTO path is no longer
available after this cleanup. Consumers must use `rustfs_storage_api`.
## Handoff Notes
- Keep this CFG-008 cleanup slice as an `api-extraction` PR that only removes
the temporary global server-config accessor compatibility re-export and its
cleanup-register entry.
- Do not move `ConfigSys`, storage-class global state,
`read_config_without_migrate`, `save_server_config`, config-object helpers,
default registration wiring, startup wiring, storage-class helpers, ECStore
persistence helpers, or storage persistence logic in this PR.
- Keep this API-003 cleanup slice as an `api-extraction` PR that only removes
the temporary public ECStore bucket DTO compatibility re-export, migrates
remaining in-repo external imports, and deletes the cleanup-register entry.
- Do not move `ObjectOptions`, `ObjectInfo`, reader types, multipart DTOs,
list result DTOs, storage traits, bucket operation logic, storage runtime
wiring, route behavior, or storage persistence logic in this PR.
- Do not add temporary compatibility code unless a matching
`RUSTFS_COMPAT_TODO(<task-id>)` marker and cleanup-register entry are added.
+2 -2
View File
@@ -22,11 +22,11 @@ use matchit::Params;
use rustfs_credentials::get_global_action_cred;
use rustfs_ecstore::bucket::versioning_sys::BucketVersioningSys;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions};
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::StorageAdminApi;
use rustfs_storage_api::{BucketOptions, StorageAdminApi};
use s3s::header::CONTENT_TYPE;
use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, s3_error};
use serde::Serialize;
+3 -5
View File
@@ -24,10 +24,7 @@ use http::{HeaderMap, StatusCode};
use hyper::Method;
use matchit::Params;
use rustfs_config::MAX_BUCKET_METADATA_IMPORT_SIZE;
use rustfs_ecstore::{
bucket::utils::{deserialize, serialize},
store_api::MakeBucketOptions,
};
use rustfs_ecstore::bucket::utils::{deserialize, serialize};
use rustfs_ecstore::{
bucket::{
metadata::{
@@ -41,12 +38,13 @@ use rustfs_ecstore::{
},
error::StorageError,
new_object_layer_fn,
store_api::{BucketOperations, BucketOptions},
store_api::BucketOperations,
};
use rustfs_policy::policy::{
BucketPolicy,
action::{Action, AdminAction},
};
use rustfs_storage_api::{BucketOptions, MakeBucketOptions};
use rustfs_utils::path::{SLASH_SEPARATOR, path_join_buf};
use s3s::{
Body, S3Request, S3Response, S3Result,
+1 -2
View File
@@ -30,10 +30,9 @@ use rustfs_ecstore::{
notification_sys::get_global_notification_sys,
rebalance::{DiskStat, RebalSaveOpt},
store_api::BucketOperations,
store_api::BucketOptions,
};
use rustfs_policy::policy::action::{Action, AdminAction};
use rustfs_storage_api::StorageAdminApi;
use rustfs_storage_api::{BucketOptions, StorageAdminApi};
use s3s::{
Body, S3Request, S3Response, S3Result,
header::{CONTENT_LENGTH, CONTENT_TYPE},
+2 -1
View File
@@ -34,8 +34,9 @@ use rustfs_ecstore::bucket::target::BucketTarget;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::global::global_rustfs_port;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_policy::policy::action::{Action, AdminAction};
use rustfs_storage_api::BucketOptions;
use s3s::header::CONTENT_TYPE;
use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, s3_error};
use std::collections::HashMap;
@@ -50,7 +50,7 @@ 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::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp};
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::{NewServiceAccountOpts, UpdateServiceAccountOpts, get_claims_from_token_with_secret};
@@ -69,6 +69,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_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;
+2 -1
View File
@@ -59,7 +59,7 @@ use rustfs_ecstore::config::com::read_config_without_migrate;
use rustfs_ecstore::global::GLOBAL_BOOT_TIME;
use rustfs_ecstore::notification_sys::get_global_notification_sys;
use rustfs_ecstore::rpc::PeerRestClient;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions};
use rustfs_ecstore::store_api::BucketOperations;
use rustfs_ecstore::{
global::{get_global_bucket_monitor, get_global_deployment_id, get_global_region},
new_object_layer_fn,
@@ -70,6 +70,7 @@ 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_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 -4
View File
@@ -55,16 +55,14 @@ use rustfs_ecstore::client::object_api_utils::to_s3s_etag;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::notification_sys::get_global_notification_sys;
use rustfs_ecstore::store_api::{
BucketOperations, BucketOptions, DeleteBucketOptions, ListObjectVersionsInfo, ListObjectsV2Info, ListOperations,
MakeBucketOptions, ObjectInfo,
};
use rustfs_ecstore::store_api::{BucketOperations, 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_targets::{
EventName,
arn::{ARN, TargetIDError},
+2 -1
View File
@@ -18,9 +18,10 @@ use rustfs_ecstore::{
disk::endpoint::Endpoint,
endpoints::{EndpointServerPools, Endpoints, PoolEndpoints},
store::ECStore,
store_api::{BucketOperations, BucketOptions, HealOperations, MakeBucketOptions, ObjectIO, ObjectOptions, PutObjReader},
store_api::{BucketOperations, HealOperations, ObjectIO, ObjectOptions, PutObjReader},
};
use rustfs_object_capacity::capacity_manager::{HybridStrategyConfig, create_isolated_manager};
use rustfs_storage_api::{BucketOptions, MakeBucketOptions};
use serial_test::serial;
use std::{
collections::HashSet,
@@ -29,16 +29,14 @@ use rustfs_ecstore::{
endpoints::{EndpointServerPools, Endpoints, PoolEndpoints},
global::GLOBAL_TierConfigMgr,
store::ECStore,
store_api::{
BucketOperations, BucketOptions, ListOperations, MakeBucketOptions, MultipartOperations, ObjectIO, ObjectOperations,
ObjectOptions, PutObjReader,
},
store_api::{BucketOperations, 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_utils::http::{SUFFIX_FORCE_DELETE, insert_header};
use s3s::{S3Request, dto::*};
use serial_test::serial;
+1 -1
View File
@@ -70,10 +70,10 @@ use rustfs_ecstore::{
store::ECStore,
store::init_local_disks,
store_api::BucketOperations,
store_api::BucketOptions,
update_erasure_type,
};
use rustfs_obs::{init_obs, set_global_guard};
use rustfs_storage_api::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 -1
View File
@@ -51,7 +51,6 @@ use rustfs_ecstore::{
store::init_local_disks,
store::prewarm_local_disk_id_map,
store_api::BucketOperations,
store_api::BucketOptions,
update_erasure_type,
};
use rustfs_heal::{
@@ -60,6 +59,7 @@ use rustfs_heal::{
use rustfs_iam::init_oidc_sys;
use rustfs_obs::{init_metrics_runtime, init_obs, set_global_guard};
use rustfs_scanner::init_data_scanner;
use rustfs_storage_api::BucketOptions;
use rustfs_utils::{
ExternalEnvCompatReport, apply_external_env_compat, get_env_bool_with_aliases, net::parse_and_resolve_address,
};
+2 -1
View File
@@ -40,10 +40,11 @@ use rustfs_ecstore::{
},
error::{StorageError, is_err_bucket_not_found, is_err_object_not_found, is_err_version_not_found},
new_object_layer_fn,
store_api::{BucketOperations, BucketOptions, ObjectLockRetentionOptions, ObjectOperations, ObjectOptions},
store_api::{BucketOperations, ObjectLockRetentionOptions, ObjectOperations, ObjectOptions},
};
use rustfs_io_metrics::record_s3_op;
use rustfs_s3_ops::S3Operation;
use rustfs_storage_api::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 -1
View File
@@ -25,7 +25,8 @@ use rustfs_ecstore::bucket::object_lock::objectlock_sys;
use rustfs_ecstore::bucket::replication::ReplicationConfigurationExt;
use rustfs_ecstore::error::StorageError;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions, ObjectInfo, ObjectToDelete};
use rustfs_ecstore::store_api::{BucketOperations, ObjectInfo, ObjectToDelete};
use rustfs_storage_api::BucketOptions;
use rustfs_targets::EventName;
use rustfs_targets::arn::{TargetID, TargetIDError};
use rustfs_utils::http::{
+1 -1
View File
@@ -37,7 +37,6 @@ use rustfs_ecstore::{
SERVICE_SIGNAL_RELOAD_DYNAMIC,
},
store::{all_local_disk_path, find_local_disk_by_ref},
store_api::{BucketOptions, DeleteBucketOptions, MakeBucketOptions},
};
use rustfs_filemeta::{FileInfo, MetacacheReader};
use rustfs_iam::{get_global_iam_sys, store::UserType};
@@ -50,6 +49,7 @@ use rustfs_protos::{
models::{PingBody, PingBodyBuilder},
proto_gen::node_service::{node_service_server::NodeService as Node, *},
};
use rustfs_storage_api::{BucketOptions, DeleteBucketOptions, MakeBucketOptions};
use serde::Deserialize;
use std::{collections::HashMap, io::Cursor, pin::Pin, sync::Arc};
use tokio::spawn;
+4 -2
View File
@@ -15,7 +15,8 @@
use crate::storage::s3_api::common::rustfs_owner;
use percent_encoding::percent_decode_str;
use rustfs_ecstore::client::object_api_utils::to_s3s_etag;
use rustfs_ecstore::store_api::{BucketInfo, ListObjectVersionsInfo, ListObjectsV2Info};
use rustfs_ecstore::store_api::{ListObjectVersionsInfo, ListObjectsV2Info};
use rustfs_storage_api::BucketInfo;
use s3s::dto::{
Bucket, CommonPrefix, DeleteMarkerEntry, EncodingType, ListBucketsOutput, ListObjectVersionsOutput, ListObjectsOutput,
ListObjectsV2Output, Object, ObjectStorageClass, ObjectVersion, ObjectVersionStorageClass, Timestamp,
@@ -387,7 +388,8 @@ mod tests {
build_list_objects_v2_output, parse_list_object_versions_params, parse_list_objects_v2_params,
};
use crate::storage::s3_api::common::rustfs_owner;
use rustfs_ecstore::store_api::{BucketInfo, ListObjectVersionsInfo, ListObjectsV2Info, ObjectInfo};
use rustfs_ecstore::store_api::{ListObjectVersionsInfo, ListObjectsV2Info, ObjectInfo};
use rustfs_storage_api::BucketInfo;
use s3s::S3ErrorCode;
use s3s::dto::{CommonPrefix, EncodingType, ListObjectsV2Output, Object};
use time::OffsetDateTime;