minio/cmd/gateway
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
..
azure Updated Prometheus metrics (#11141) 2021-01-18 20:35:38 -08:00
gcs Updated Prometheus metrics (#11141) 2021-01-18 20:35:38 -08:00
hdfs HDFS support keytab (#11473) 2021-02-07 17:29:47 -08:00
nas feat: migrate to ROOT_USER/PASSWORD from ACCESS/SECRET_KEY (#11185) 2021-01-05 10:22:57 -08:00
s3 Simplify PutObjReader for plain-text reader usage (#11470) 2021-02-10 08:52:50 -08:00
gateway.go Remove B2 gateway implementation (#9547) 2020-05-07 19:00:30 -07:00