minio/cmd/gateway/s3
Krishnan Parthasarathi b87fae0049
Simplify PutObjReader for plain-text reader usage (#11470)
This change moves away from a unified constructor for plaintext and encrypted
usage. NewPutObjReader is simplified for the plain-text reader use. For
encrypted reader use, WithEncryption should be called on an initialized PutObjReader.

Plaintext:
func NewPutObjReader(rawReader *hash.Reader) *PutObjReader

The hash.Reader is used to provide payload size and md5sum to the downstream
consumers. This is different from the previous version in that there is no need
to pass nil values for unused parameters.

Encrypted:
func WithEncryption(encReader *hash.Reader,
key *crypto.ObjectKey) (*PutObjReader, error)

This method sets up encrypted reader along with the key to seal the md5sum
produced by the plain-text reader (already setup when NewPutObjReader was
called).

Usage:
```
  pReader := NewPutObjReader(rawReader)
  // ... other object handler code goes here

  // Prepare the encrypted hashed reader
  pReader, err = pReader.WithEncryption(encReader, objEncKey)

```
2021-02-10 08:52:50 -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 Simplify PutObjReader for plain-text reader usage (#11470) 2021-02-10 08:52:50 -08:00
gateway-s3-sse.go fix: replication metadata comparsion and other fixes (#11410) 2021-02-03 20:41:33 -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