feat: allow storage endpoint updates and deletion

This commit is contained in:
237899745
2026-07-25 16:41:31 +08:00
parent 0fe3d4ce8e
commit d29f43d2e3
5 changed files with 188 additions and 68 deletions

View File

@@ -522,6 +522,22 @@ pub async fn test_endpoint(state: &AppState, endpoint: &StorageEndpoint) -> Resu
Ok(())
}
pub async fn test_existing_object(
state: &AppState,
endpoint: &StorageEndpoint,
key: &str,
) -> Result<(), AppError> {
let client = client_for(state, endpoint, EndpointKind::Internal)?;
client
.head_object()
.bucket(&endpoint.bucket)
.key(key)
.send()
.await
.map_err(|err| storage_error("S3 历史对象访问测试失败", err))?;
Ok(())
}
fn client_for(
state: &AppState,
endpoint: &StorageEndpoint,