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
+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;
}