diff --git a/crypto/src/encdec/encrypt.rs b/crypto/src/encdec/encrypt.rs index 47bdf3dc0..bc96d353b 100644 --- a/crypto/src/encdec/encrypt.rs +++ b/crypto/src/encdec/encrypt.rs @@ -45,8 +45,6 @@ fn encrypt( let nonce = T::generate_nonce(rand::thread_rng()); - println!("encrypt nonce len {}, {:?}", nonce.len(), &id); - let encryptor = stream.encrypt(&nonce, data).map_err(Error::ErrEncryptFailed)?; let mut ciphertext = Vec::with_capacity(salt.len() + 1 + nonce.len() + encryptor.len()); diff --git a/rustfs/src/admin/handlers.rs b/rustfs/src/admin/handlers.rs index c975d2a06..0b239bf25 100644 --- a/rustfs/src/admin/handlers.rs +++ b/rustfs/src/admin/handlers.rs @@ -94,6 +94,7 @@ pub async fn check_key_valid(security_token: Option, ak: &str) -> S3Resu let sys_cred = cred.clone(); + // warn!("check_key_valid cred {:?}, as: {:?}", &cred, &ak); if cred.access_key != ak { let Ok(iam_store) = iam::get() else { return Err(S3Error::with_message( @@ -124,6 +125,9 @@ pub async fn check_key_valid(security_token: Option, ak: &str) -> S3Resu cred = u.credentials; } + // warn!("check_key_valid cred {:?}", &cred); + // warn!("check_key_valid security_token {:?}", &security_token); + let claims = check_claims_from_token(&security_token.unwrap_or_default(), &cred) .map_err(|e| S3Error::with_message(S3ErrorCode::InternalError, format!("check claims failed {}", e)))?; @@ -158,8 +162,8 @@ pub fn check_claims_from_token(token: &str, cred: &auth::Credentials) -> S3Resul return Err(s3_error!(InvalidRequest, "invalid token")); } - if cred.is_temp() || cred.is_expired() { - return Err(s3_error!(InvalidRequest, "invalid access key is temp or expired")); + if cred.is_temp() && cred.is_expired() { + return Err(s3_error!(InvalidRequest, "invalid access key is temp and expired")); } let Some(sys_cred) = get_global_action_cred() else { diff --git a/scripts/run.sh b/scripts/run.sh index ad55a8512..b2436ac16 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -10,9 +10,9 @@ mkdir -p ./target/volume/test mkdir -p ./target/volume/test{0..4} -# if [ -z "$RUST_LOG" ]; then -# export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug" -# fi +if [ -z "$RUST_LOG" ]; then + export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug" +fi # export RUSTFS_ERASURE_SET_DRIVE_COUNT=5