mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 21:26:28 +00:00
sync s3s, return UnauthorizedAccess error code when credentials is none
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ impl IAMAuth {
|
||||
impl S3Auth for IAMAuth {
|
||||
async fn get_secret_key(&self, access_key: &str) -> S3Result<SecretKey> {
|
||||
if access_key.is_empty() {
|
||||
return Err(s3_error!(NotSignedUp, "Your account is not signed up"));
|
||||
return Err(s3_error!(UnauthorizedAccess, "Your account is not signed up"));
|
||||
}
|
||||
|
||||
if let Ok(key) = self.simple_auth.get_secret_key(access_key).await {
|
||||
@@ -32,6 +32,6 @@ impl S3Auth for IAMAuth {
|
||||
}
|
||||
}
|
||||
|
||||
Err(s3_error!(NotSignedUp, "Your account is not signed up2"))
|
||||
Err(s3_error!(UnauthorizedAccess, "Your account is not signed up2"))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-4
@@ -67,10 +67,7 @@ fn match_for_io_error(err_status: &Status) -> Option<&std::io::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
err = match err.source() {
|
||||
Some(err) => err,
|
||||
None => return None,
|
||||
};
|
||||
err = err.source()?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ impl S3Access for FS {
|
||||
);
|
||||
|
||||
if cx.credentials().is_none() {
|
||||
return Err(s3_error!(AccessDenied, "Signature is required"));
|
||||
return Err(s3_error!(UnauthorizedAccess, "Signature is required"));
|
||||
};
|
||||
|
||||
// TODO: FIXME: check auth
|
||||
|
||||
@@ -550,6 +550,7 @@ impl S3 for FS {
|
||||
.map(|v| Bucket {
|
||||
creation_date: v.created.map(Timestamp::from),
|
||||
name: Some(v.name.clone()),
|
||||
..Default::default()
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user