)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4dac78a62828b8f8e1f4fa8128fda089318835bc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0b4512b8_ba8afc06","updated":"2026-11-19 03:52:53.000000000","message":"this helps get tests passing on us-west-1 \n\nbut I don\u0027t changes that \"add more stuff to `S3Request.__init__`\" and almost exclusively see those an an oppertunity to be \"more correct by moving logic into the controller\"\n\n1016414: sq? Validate object GET payload hashes in operation context | https://review.opendev.org/c/openstack/swift/+/1016414","commit_id":"3ce39c9539d521774c4183d84910c7b61142d897"}],"swift/common/middleware/s3api/s3request.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4dac78a62828b8f8e1f4fa8128fda089318835bc","unresolved":true,"context_lines":[{"line_number":692,"context_line":"    def _is_x_amz_content_sha256_format_checked(self):"},{"line_number":693,"context_line":"        # AWS checks the format of a presigned request only for GetObject"},{"line_number":694,"context_line":"        return (self._is_x_amz_content_sha256_required or"},{"line_number":695,"context_line":"                (self.method \u003d\u003d \u0027GET\u0027 and bool(self.object_name)))"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"    @property"},{"line_number":698,"context_line":"    def signing_timestamp(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9268b11f_7c4b8fba","line":695,"updated":"2026-11-19 03:52:53.000000000","message":"setting aside how complicated (gross?) it\u0027s getting to have properties in s3request named:\n```\n_is_x_amz_content_sha256_format_checked\n_is_x_amz_content_sha256_required\n```\n\nthis implementation is actually wrong b/c a query-auth\u0027d get-object-acl shouldn\u0027t  validate the content-sha256 format on AWS:\n\nhttps://review.opendev.org/c/openstack/swift/+/1016414/comment/eceaa218_4ff6a645/\n\nIt\u0027s a *real* mystery why GetObject *specifically* seems to care about the shape of this header even when it\u0027s not required b/c the client is using query auth; but I think the best way to express that myster might be a check in the controller GetObject handler:\n\n```\ndiff --git a/swift/common/middleware/s3api/controllers/obj.py b/swift/common/middleware/s3api/controllers/obj.py\nindex eb6d8cdbc..b8670e7e1 100644\n--- a/swift/common/middleware/s3api/controllers/obj.py\n+++ b/swift/common/middleware/s3api/controllers/obj.py\n@@ -162,6 +162,7 @@ class ObjectController(Controller):\n         \"\"\"\n         Handle GET Object request\n         \"\"\"\n+        req.validate_content_sha256(check_format\u003dTrue)\n         return self.GETorHEAD(req)\n \n     @public\n```","commit_id":"3ce39c9539d521774c4183d84910c7b61142d897"}]}
