crypto: add RemoveInternalEntries function (#6616)

This commit adds a function for removing crypto-specific
internal entries from the object metadata.

See #6604
This commit is contained in:
Andreas Auernhammer
2018-10-19 19:50:52 +02:00
committed by kannappanr
parent 62b560510b
commit 8a6c3aa3cd
3 changed files with 63 additions and 7 deletions

View File

@@ -40,6 +40,18 @@ func RemoveSensitiveEntries(metadata map[string]string) { // The functions is te
delete(metadata, SSECopyKey)
}
// RemoveInternalEntries removes all crypto-specific internal
// metadata entries from the metadata map.
func RemoveInternalEntries(metadata map[string]string) {
delete(metadata, SSEMultipart)
delete(metadata, SSEIV)
delete(metadata, SSESealAlgorithm)
delete(metadata, SSECSealedKey)
delete(metadata, S3SealedKey)
delete(metadata, S3KMSKeyID)
delete(metadata, S3KMSSealedKey)
}
// IsEncrypted returns true if the object metadata indicates
// that it was uploaded using some form of server-side-encryption.
//