minio/cmd/gateway/s3
Andreas Auernhammer 838d4dafbd
gateway: don't use encrypted ETags for If-Match (#11400)
This commit fixes a bug in the S3 gateway that causes
GET requests to fail when the object is encrypted by the
gateway itself.

The gateway was not able to GET the object since it always
specified a `If-Match` pre-condition checking that the object
ETag matches an expected ETag - even for encrypted ETags.

The problem is that an encrypted ETag will never match the ETag
computed by the backend causing the `If-Match` pre-condition
to fail.

This commit fixes this by not sending an `If-Match` header when
the ETag is encrypted. This is acceptable because:
  1. A gateway-encrypted object consists of two objects at the backend
     and there is no way to provide a concurrency-safe implementation
     of two consecutive S3 GETs in the deployment model of the S3
     gateway.
     Ref: S3 gateways are self-contained and isolated - and there may
          be multiple instances at the same time (no lock across
          instances).
  2. Even if the data object changes (concurrent PUT) while gateway
     A has download the metadata object (but not issued the GET to
     the data object => data race) then we don't return invalid data
     to the client since the decryption (of the currently uploaded data)
     will fail - given the metadata of the previous object.
2021-02-01 23:02:08 -08:00
..
gateway-s3_test.go Move dependency from minio-go v6 to v7 (#10042) 2020-07-14 09:38:05 -07:00
gateway-s3-metadata_test.go use GlobalContext whenever possible (#9280) 2020-04-09 09:30:02 -07:00
gateway-s3-metadata.go avoid double listObjectParts calls improves performance (#9606) 2020-05-15 08:06:45 -07:00
gateway-s3-sse.go gateway: don't use encrypted ETags for If-Match (#11400) 2021-02-01 23:02:08 -08:00
gateway-s3-utils.go add gateway object tagging support (#9124) 2020-05-23 11:09:35 -07:00
gateway-s3.go tagging: Add event notif for PUT object tagging (#11366) 2021-02-01 13:52:51 -08:00