fix add service_account

This commit is contained in:
weisd
2025-02-25 00:39:19 +08:00
parent 15a246bf75
commit dae6616720
3 changed files with 7 additions and 9 deletions
-2
View File
@@ -2067,9 +2067,7 @@ pub async fn get_file_info(buf: &[u8], volume: &str, path: &str, version_id: &st
});
}
warn!("get_file_info vid {:?}", &vid);
let fi = meta.into_fileinfo(volume, path, version_id, opts.data, true)?;
warn!("get_file_info {:?}", &fi);
Ok(fi)
}
+3 -3
View File
@@ -40,10 +40,10 @@ impl Operation for AddServiceAccount {
}
};
let mut create_req: AddServiceAccountReq =
let create_req: AddServiceAccountReq =
serde_json::from_slice(&body[..]).map_err(|e| s3_error!(InvalidRequest, "unmarshal body failed, e: {:?}", e))?;
create_req.expiration = create_req.expiration.and_then(|expire| expire.replace_millisecond(0).ok());
// create_req.expiration = create_req.expiration.and_then(|expire| expire.replace_millisecond(0).ok());
if has_space_be(&create_req.access_key) {
return Err(s3_error!(InvalidRequest, "access key has spaces"));
@@ -72,7 +72,7 @@ impl Operation for AddServiceAccount {
let req_groups = cred.groups.clone();
let mut req_is_derived_cred = false;
if cred.is_owner() || cred.is_service_account() {
if cred.is_service_account() || cred.is_temp() {
req_parent_user = cred.parent_user.clone();
req_is_derived_cred = true;
}
+4 -4
View File
@@ -10,10 +10,10 @@ mkdir -p ./target/volume/test
# mkdir -p ./target/volume/test{0..4}
# if [ -z "$RUST_LOG" ]; then
# export RUST_BACKTRACE=1
# export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug"
# fi
if [ -z "$RUST_LOG" ]; then
export RUST_BACKTRACE=1
export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug"
fi
# export RUSTFS_ERASURE_SET_DRIVE_COUNT=5