diff --git a/.gitignore b/.gitignore index 8518e24d..f9557007 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ mc .run* .idea/ mc.RELEASE* -mc.gz \ No newline at end of file +mc.gz +.DS_Store \ No newline at end of file diff --git a/cmd/client-fs_darwin.go b/cmd/client-fs_darwin.go index c746fdbf..5b5052a9 100644 --- a/cmd/client-fs_darwin.go +++ b/cmd/client-fs_darwin.go @@ -35,7 +35,7 @@ var ( ) // IsGetEvent checks if the event return is a get event. -func IsGetEvent(event notify.Event) bool { +func IsGetEvent(_ notify.Event) bool { return false } diff --git a/cmd/pipe_unsupported.go b/cmd/pipe_unsupported.go index e6b3e93d..3612050a 100644 --- a/cmd/pipe_unsupported.go +++ b/cmd/pipe_unsupported.go @@ -21,7 +21,7 @@ package cmd import "os" -func increasePipeBufferSize(f *os.File, desiredPipeSize int) error { +func increasePipeBufferSize(_ *os.File, _ int) error { // this is not supported on non-Linux platforms. return nil } diff --git a/cmd/stat.go b/cmd/stat.go index b0b3b0e0..216fca02 100644 --- a/cmd/stat.go +++ b/cmd/stat.go @@ -107,6 +107,17 @@ func (stat statMessage) String() (msg string) { } } } + + if maxKeyEncrypted > 0 { + if keyID, ok := stat.Metadata["X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"]; ok { + msgBuilder.WriteString(fmt.Sprintf("%-10s: SSE-%s (%s)\n", "Encryption", "KMS", keyID)) + } else if _, ok := stat.Metadata["X-Amz-Server-Side-Encryption-Customer-Key-Md5"]; ok { + msgBuilder.WriteString(fmt.Sprintf("%-10s: SSE-%s\n", "Encryption", "C")) + } else { + msgBuilder.WriteString(fmt.Sprintf("%-10s: SSE-%s\n", "Encryption", "S3")) + } + } + if maxKeyMetadata > 0 { msgBuilder.WriteString(fmt.Sprintf("%-10s:", "Metadata") + "\n") for k, v := range stat.Metadata { @@ -117,14 +128,6 @@ func (stat statMessage) String() (msg string) { } } - if maxKeyEncrypted > 0 { - msgBuilder.WriteString(fmt.Sprintf("%-10s:", "Encrypted") + "\n") - for k, v := range stat.Metadata { - if strings.HasPrefix(strings.ToLower(k), serverEncryptionKeyPrefix) { - msgBuilder.WriteString(fmt.Sprintf(" %-*.*s: %s ", maxKeyEncrypted, maxKeyEncrypted, k, v) + "\n") - } - } - } if stat.ReplicationStatus != "" { msgBuilder.WriteString(fmt.Sprintf("%-10s: %s ", "Replication Status", stat.ReplicationStatus)) }