mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 06:13:14 +00:00
fix(s3): allow anonymous access when PublicAccessBlock config is miss… (#2039)
Co-authored-by: GatewayJ <8352692332qq.com>
This commit is contained in:
@@ -473,13 +473,13 @@ pub async fn authorize_request<T>(req: &mut S3Request<T>, action: Action) -> S3R
|
||||
|
||||
if policy_allowed {
|
||||
// RestrictPublicBuckets: when true, deny public access even if bucket policy allows it.
|
||||
// Fail closed: if we cannot read the config, do not allow public access.
|
||||
match metadata_sys::get_public_access_block_config(bucket_name).await {
|
||||
Ok((config, _)) => {
|
||||
if config.restrict_public_buckets.unwrap_or(false) {
|
||||
return Err(s3_error!(AccessDenied, "Access Denied"));
|
||||
}
|
||||
}
|
||||
Err(StorageError::ConfigNotFound) => {}
|
||||
Err(_) => {
|
||||
return Err(s3_error!(AccessDenied, "Access Denied"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user