mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 16:46:55 +00:00
Merge branch 'main' of github.com:rustfs/s3-rustfs into feature/observability-metrics
# Conflicts: # Cargo.toml # iam/src/manager.rs # iam/src/store/object.rs # rustfs/src/admin/handlers/sts.rs # rustfs/src/main.rs # rustfs/src/storage/ecfs.rs
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ path = "src/main.rs"
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zip = { workspace = true }
|
||||
rustfs-zip = { workspace = true }
|
||||
tokio-tar = { workspace = true }
|
||||
madmin = { workspace = true }
|
||||
api = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
admin::router::Operation,
|
||||
auth::{check_key_valid, get_session_token},
|
||||
@@ -16,6 +14,7 @@ use s3s::{
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use serde_urlencoded::from_bytes;
|
||||
use std::collections::HashMap;
|
||||
use time::{Duration, OffsetDateTime};
|
||||
use tracing::{info, warn};
|
||||
|
||||
@@ -50,7 +49,7 @@ impl Operation for AssumeRoleHandle {
|
||||
let (cred, _owner) =
|
||||
check_key_valid(get_session_token(&req.uri, &req.headers).unwrap_or_default(), &user.access_key).await?;
|
||||
|
||||
// // TODO: 判断权限,不允许 sts 访问
|
||||
// TODO: Check permissions, do not allow STS access
|
||||
if cred.is_temp() || cred.is_service_account() {
|
||||
return Err(s3_error!(InvalidRequest, "AccessDenied"));
|
||||
}
|
||||
|
||||
+1397
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -139,7 +139,7 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
// let local_ip = utils::get_local_ip().ok_or(local_addr.ip()).unwrap();
|
||||
let local_ip = rustfs_utils::get_local_ip().ok_or(local_addr.ip()).unwrap();
|
||||
|
||||
// for rpc
|
||||
// For RPC
|
||||
let (endpoint_pools, setup_type) = EndpointServerPools::from_volumes(server_address.clone().as_str(), opt.volumes.clone())
|
||||
.map_err(|err| Error::from_string(err.to_string()))?;
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ impl S3Access for FS {
|
||||
// /// + [`cx.s3_op().name()`](crate::S3Operation::name)
|
||||
// /// + [`cx.extensions_mut()`](S3AccessContext::extensions_mut)
|
||||
async fn check(&self, cx: &mut S3AccessContext<'_>) -> S3Result<()> {
|
||||
// 上层验证了 ak/sk
|
||||
// Upper layer has verified ak/sk
|
||||
// info!(
|
||||
// "s3 check uri: {:?}, method: {:?} path: {:?}, s3_op: {:?}, cred: {:?}, headers:{:?}",
|
||||
// cx.uri(),
|
||||
@@ -176,7 +176,7 @@ impl S3Access for FS {
|
||||
let ext = cx.extensions_mut();
|
||||
ext.insert(req_info);
|
||||
|
||||
// 统一在这验证?还是在下面各自验证?
|
||||
// Verify uniformly here? Or verify separately below?
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ use policy::policy::BucketPolicy;
|
||||
use policy::policy::BucketPolicyArgs;
|
||||
use policy::policy::Validator;
|
||||
use query::instance::make_rustfsms;
|
||||
use rustfs_zip::CompressionFormat;
|
||||
use s3s::dto::*;
|
||||
use s3s::s3_error;
|
||||
use s3s::S3Error;
|
||||
@@ -83,7 +84,6 @@ use tracing::info;
|
||||
use tracing::warn;
|
||||
use transform_stream::AsyncTryStream;
|
||||
use uuid::Uuid;
|
||||
use zip::CompressionFormat;
|
||||
|
||||
macro_rules! try_ {
|
||||
($result:expr) => {
|
||||
@@ -204,8 +204,8 @@ impl FS {
|
||||
// )
|
||||
// .await
|
||||
// {
|
||||
// Ok(_) => println!("解压成功!"),
|
||||
// Err(e) => println!("解压失败:{}", e),
|
||||
// Ok(_) => println!("Decompression successful!"),
|
||||
// Err(e) => println!("Decompression failed: {}", e),
|
||||
// }
|
||||
|
||||
// TODO: etag
|
||||
@@ -341,7 +341,7 @@ impl S3 for FS {
|
||||
#[tracing::instrument(level = "debug", skip(self, req))]
|
||||
async fn delete_bucket(&self, req: S3Request<DeleteBucketInput>) -> S3Result<S3Response<DeleteBucketOutput>> {
|
||||
let input = req.input;
|
||||
// TODO: DeleteBucketInput 没有 force 参数?
|
||||
// TODO: DeleteBucketInput doesn't have force parameter?
|
||||
let Some(store) = new_object_layer_fn() else {
|
||||
return Err(S3Error::with_message(S3ErrorCode::InternalError, "Not init".to_string()));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user