diff --git a/rustfs/src/admin/handlers/service_account.rs b/rustfs/src/admin/handlers/service_account.rs index 47d6e8b19..fb6cb156a 100644 --- a/rustfs/src/admin/handlers/service_account.rs +++ b/rustfs/src/admin/handlers/service_account.rs @@ -22,7 +22,7 @@ impl Operation for AddServiceAccount { warn!("handle AddServiceAccount, req: {req:?}"); let Some(cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; - let is_owner = true; // 先按true处理,后期根据请求决定。 + let _is_owner = true; // 先按true处理,后期根据请求决定。 let body = req.input.store_all_unlimited().await.unwrap(); let body = crypto::decrypt_data(cred.secret_key.expose().as_bytes(), &body[..]) .map_err(|_| s3_error!(InternalError, "encrypt data failed"))?; @@ -39,8 +39,8 @@ impl Operation for AddServiceAccount { } // 校验合法性, Name, Expiration, Description - let target_user = create_req.target_user.as_ref().unwrap_or(&cred.access_key); - let deny_only = true; + let _target_user = create_req.target_user.as_ref().unwrap_or(&cred.access_key); + let _deny_only = true; // todo 校验权限 @@ -109,7 +109,7 @@ impl Operation for UpdateServiceAccount { async fn call(&self, req: S3Request, _params: Params<'_, '_>) -> S3Result> { warn!("handle UpdateServiceAccount"); - let Some(cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; + let Some(_cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; // return Err(s3_error!(NotImplemented)); // @@ -121,7 +121,7 @@ impl Operation for UpdateServiceAccount { pub struct InfoServiceAccount {} #[async_trait::async_trait] impl Operation for InfoServiceAccount { - async fn call(&self, req: S3Request, params: Params<'_, '_>) -> S3Result> { + async fn call(&self, req: S3Request, _params: Params<'_, '_>) -> S3Result> { warn!("handle InfoServiceAccount"); let Some(cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; @@ -149,7 +149,7 @@ impl Operation for InfoServiceAccount { return Err(s3_error!(InvalidRequest, "access key is not exist")); }; - let (sa, sp) = iam::get_service_account(ak).await.map_err(|e| { + let (sa, _sp) = iam::get_service_account(ak).await.map_err(|e| { debug!("get service account failed, err: {e:?}"); s3_error!(InternalError) })?; @@ -206,7 +206,7 @@ impl Operation for InfoServiceAccount { pub struct ListServiceAccount {} #[async_trait::async_trait] impl Operation for ListServiceAccount { - async fn call(&self, req: S3Request, params: Params<'_, '_>) -> S3Result> { + async fn call(&self, _req: S3Request, _params: Params<'_, '_>) -> S3Result> { warn!("handle ListServiceAccount"); todo!() } @@ -218,9 +218,9 @@ impl Operation for DeleteServiceAccount { async fn call(&self, req: S3Request, params: Params<'_, '_>) -> S3Result> { warn!("handle DeleteServiceAccount"); - let Some(cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; + let Some(_cred) = req.credentials else { return Err(s3_error!(InvalidRequest, "get cred failed")) }; - let Some(service_account) = params.get("accessKey") else { + let Some(_service_account) = params.get("accessKey") else { return Err(s3_error!(InvalidRequest, "Invalid arguments specified.")); }; diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 550eb044c..17ea6dd35 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -25,7 +25,7 @@ use iam::init_iam_sys; use protos::proto_gen::node_service::node_service_server::NodeServiceServer; use s3s::{auth::SimpleAuth, service::S3ServiceBuilder}; use service::hybrid; -use std::{io::IsTerminal, net::SocketAddr, str::FromStr, sync::Arc}; +use std::{io::IsTerminal, net::SocketAddr, str::FromStr}; use tokio::net::TcpListener; use tonic::{metadata::MetadataValue, Request, Status}; use tracing::{debug, error, info, warn}; diff --git a/rustfs/src/storage/acess.rs b/rustfs/src/storage/acess.rs index 0d8552cab..c13b027ea 100644 --- a/rustfs/src/storage/acess.rs +++ b/rustfs/src/storage/acess.rs @@ -10,6 +10,7 @@ use s3s::auth::Credentials; use s3s::{dto::*, s3_error, S3Request, S3Result}; use uuid::Uuid; +#[allow(dead_code)] #[derive(Default, Clone)] struct ReqInfo { pub card: Option,