fix: update to minio/pkg/console changes (#3545)

This commit is contained in:
Harshavardhana
2020-12-20 10:10:29 -08:00
committed by GitHub
parent fca6cb2815
commit 41c804b179
6 changed files with 22 additions and 25 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ func (t traceV2) Response(resp *http.Response) (err error) {
console.Debug(string(respTrace))
}
if globalInsecure && resp.TLS != nil {
dumpTLSCertificates(resp.TLS)
if resp.TLS != nil {
printTLSCertInfo(resp.TLS)
}
return err
+2 -2
View File
@@ -86,8 +86,8 @@ func (t traceV4) Response(resp *http.Response) (err error) {
console.Debug(string(respTrace))
}
if globalInsecure && resp.TLS != nil {
dumpTLSCertificates(resp.TLS)
if resp.TLS != nil {
printTLSCertInfo(resp.TLS)
}
return err
-5
View File
@@ -70,11 +70,6 @@ func setGlobals(quiet, debug, json, noColor, insecure bool) {
globalNoColor = globalNoColor || noColor
globalInsecure = globalInsecure || insecure
// Enable debug messages if requested.
if globalDebug {
console.DebugPrint = true
}
// Disable colorified messages if requested.
if globalNoColor || globalQuiet {
console.SetColorOff()
+12 -10
View File
@@ -102,18 +102,20 @@ func randString(n int, src rand.Source, prefix string) string {
return prefix + string(b[0:30-len(prefix)])
}
// dumpTlsCertificates prints some fields of the certificates received from the server.
// printTLSCertInfo prints some fields of the certificates received from the server.
// Fields will be inspected by the user, so they must be conscise and useful
func dumpTLSCertificates(t *tls.ConnectionState) {
for _, cert := range t.PeerCertificates {
console.Debugln("TLS Certificate found: ")
if len(cert.Issuer.Country) > 0 {
console.Debugln(" >> Country: " + cert.Issuer.Country[0])
func printTLSCertInfo(t *tls.ConnectionState) {
if globalDebug {
for _, cert := range t.PeerCertificates {
console.Debugln("TLS Certificate found: ")
if len(cert.Issuer.Country) > 0 {
console.Debugln(" >> Country: " + cert.Issuer.Country[0])
}
if len(cert.Issuer.Organization) > 0 {
console.Debugln(" >> Organization: " + cert.Issuer.Organization[0])
}
console.Debugln(" >> Expires: " + cert.NotAfter.String())
}
if len(cert.Issuer.Organization) > 0 {
console.Debugln(" >> Organization: " + cert.Issuer.Organization[0])
}
console.Debugln(" >> Expires: " + cert.NotAfter.String())
}
}
+2 -2
View File
@@ -13,8 +13,8 @@ require (
github.com/mattn/go-isatty v0.0.12
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/minio/cli v1.22.0
github.com/minio/minio v0.0.0-20201217022412-970ddb424b7d
github.com/minio/minio-go/v7 v7.0.6
github.com/minio/minio v0.0.0-20201219173637-3e16ec457a24
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c
github.com/minio/sha256-simd v0.1.1
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/profile v1.3.0
+4 -4
View File
@@ -364,10 +364,10 @@ github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2
github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc=
github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/minio v0.0.0-20201217022412-970ddb424b7d h1:adgAHMjTf6ecUKNMxRQbd0+5N/AibcPe44l1GVJ7riA=
github.com/minio/minio v0.0.0-20201217022412-970ddb424b7d/go.mod h1:EYEA7s0k4DW2FU1DXFzV8wz6lJ+njjwOqDjpb4q7egg=
github.com/minio/minio-go/v7 v7.0.6 h1:9czXaG0LEZ9s74smSqy0rm034MxngQoP6HTTuSc5GEs=
github.com/minio/minio-go/v7 v7.0.6/go.mod h1:HcIuq+11d/3MfavIPZiswSzfQ1VJ2Lwxp/XLtW46IWQ=
github.com/minio/minio v0.0.0-20201219173637-3e16ec457a24 h1:/evfBonJRJ+30RXVnxVIzzP0puZ0l3Zh9s3+6R/RskY=
github.com/minio/minio v0.0.0-20201219173637-3e16ec457a24/go.mod h1:sIgZV5KcIpn3bitFPXbrx/OyGcca57QzrgxT5I8nabg=
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c h1:NgTbI1w/B+2Jcl+YKTULAAXqkwWqMZbkzmVdWNwzKnA=
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c/go.mod h1:pEZBUa+L2m9oECoIA6IcSK8bv/qggtQVLovjeKK5jYc=
github.com/minio/selfupdate v0.3.1 h1:BWEFSNnrZVMUWXbXIgLDNDjbejkmpAmZvy/nCz1HlEs=
github.com/minio/selfupdate v0.3.1/go.mod h1:b8ThJzzH7u2MkF6PcIra7KaXO9Khf6alWPvMSyTDCFM=
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=