add functions to remove confidential information (#6516)

This commit adds two functions for removing
confidential information - like SSE-C keys -
from HTTP headers / object metadata.

This creates a central point grouping all
headers/entries which must be filtered / removed.

See also https://github.com/minio/minio/pull/6489#discussion_r219797993
of #6489
This commit is contained in:
Andreas Auernhammer
2018-09-24 17:32:51 +02:00
committed by Nitish Tiwari
parent 48bfebe442
commit 8cf7b88cc5
4 changed files with 125 additions and 4 deletions

View File

@@ -74,6 +74,14 @@ const (
SSEAlgorithmKMS = "aws:kms"
)
// RemoveSensitiveHeaders removes confidential encryption
// information - e.g. the SSE-C key - from the HTTP headers.
// It has the same semantics as RemoveSensitiveEntires.
func RemoveSensitiveHeaders(h http.Header) {
h.Del(SSECKey)
h.Del(SSECopyKey)
}
// S3 represents AWS SSE-S3. It provides functionality to handle
// SSE-S3 requests.
var S3 = s3{}