mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 13:16:28 +00:00
refactor: segment external storage api boundaries (#3903)
This commit is contained in:
@@ -39,7 +39,7 @@ mod storage_api;
|
||||
pub mod store;
|
||||
pub mod sys;
|
||||
pub mod utils;
|
||||
pub(crate) use storage_api::{
|
||||
pub(crate) use storage_api::crate_boundary::{
|
||||
IAM_CONFIG_ROOT_PREFIX, IamEcstoreError, IamStorageError, IamStore, classify_iam_system_path_failure_reason,
|
||||
delete_iam_config, is_iam_first_cluster_node_local, read_iam_config_no_lock, read_iam_config_with_metadata, save_iam_config,
|
||||
save_iam_config_with_opts,
|
||||
@@ -53,8 +53,8 @@ pub(crate) struct IamNotificationPeerErr {
|
||||
pub(crate) err: Option<IamEcstoreError>,
|
||||
}
|
||||
|
||||
impl From<storage_api::IamEcstoreNotificationPeerErr> for IamNotificationPeerErr {
|
||||
fn from(value: storage_api::IamEcstoreNotificationPeerErr) -> Self {
|
||||
impl From<storage_api::crate_boundary::IamEcstoreNotificationPeerErr> for IamNotificationPeerErr {
|
||||
fn from(value: storage_api::crate_boundary::IamEcstoreNotificationPeerErr) -> Self {
|
||||
Self { err: value.err }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::storage_api::{IamNotificationSys, notification_sys as ecstore_notification_sys};
|
||||
use crate::storage_api::runtime::{IamNotificationSys, notification_sys as ecstore_notification_sys};
|
||||
use rustfs_config::server_config::{Config as ServerConfig, get_global_server_config};
|
||||
use rustfs_credentials::{Credentials, get_global_action_cred};
|
||||
|
||||
|
||||
@@ -80,3 +80,19 @@ pub(crate) async fn is_iam_first_cluster_node_local() -> bool {
|
||||
pub(crate) fn notification_sys() -> Option<&'static IamNotificationSys> {
|
||||
get_global_notification_sys()
|
||||
}
|
||||
|
||||
pub(crate) mod crate_boundary {
|
||||
pub(crate) use super::{
|
||||
IAM_CONFIG_ROOT_PREFIX, IamEcstoreError, IamEcstoreNotificationPeerErr, IamStorageError, IamStore,
|
||||
classify_iam_system_path_failure_reason, delete_iam_config, is_iam_first_cluster_node_local, read_iam_config_no_lock,
|
||||
read_iam_config_with_metadata, save_iam_config, save_iam_config_with_opts,
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) mod object_store {
|
||||
pub(crate) use super::{HTTPPreconditions, ListOperations, ObjectInfoOrErr, ObjectOperations};
|
||||
}
|
||||
|
||||
pub(crate) mod runtime {
|
||||
pub(crate) use super::{IamNotificationSys, notification_sys};
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ use tokio::sync::mpsc::{self, Sender};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{debug, error, warn};
|
||||
|
||||
use crate::storage_api::{HTTPPreconditions, ListOperations as _, ObjectInfoOrErr as StorageObjectInfoOrErr, ObjectOperations};
|
||||
use crate::storage_api::object_store::{
|
||||
HTTPPreconditions, ListOperations as _, ObjectInfoOrErr as StorageObjectInfoOrErr, ObjectOperations,
|
||||
};
|
||||
|
||||
pub static IAM_CONFIG_PREFIX: LazyLock<String> = LazyLock::new(|| format!("{IAM_CONFIG_ROOT_PREFIX}/iam"));
|
||||
pub static IAM_CONFIG_USERS_PREFIX: LazyLock<String> = LazyLock::new(|| format!("{IAM_CONFIG_ROOT_PREFIX}/iam/users/"));
|
||||
|
||||
Reference in New Issue
Block a user