mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-07 13:53:12 +00:00
fix admin add user fail
This commit is contained in:
@@ -45,8 +45,6 @@ fn encrypt<T: aes_gcm::aead::Aead>(
|
||||
|
||||
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());
|
||||
|
||||
@@ -94,6 +94,7 @@ pub async fn check_key_valid(security_token: Option<String>, 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<String>, 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 {
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user