Migrate UI backend from direct storage calls to S3 API proxy via boto3
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
import logging
|
||||
import mimetypes
|
||||
import re
|
||||
@@ -2963,7 +2964,11 @@ def _bucket_policy_handler(bucket_name: str) -> Response:
|
||||
store.delete_policy(bucket_name)
|
||||
current_app.logger.info("Bucket policy removed", extra={"bucket": bucket_name})
|
||||
return Response(status=204)
|
||||
payload = request.get_json(silent=True)
|
||||
raw_body = request.get_data(cache=False) or b""
|
||||
try:
|
||||
payload = json.loads(raw_body)
|
||||
except (json.JSONDecodeError, ValueError):
|
||||
return _error_response("MalformedPolicy", "Policy document must be JSON", 400)
|
||||
if not payload:
|
||||
return _error_response("MalformedPolicy", "Policy document must be JSON", 400)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user