Vendorize minio-go (#2660)

This commit is contained in:
kannappanr
2019-01-25 15:19:04 -08:00
committed by GitHub
parent 07169d421e
commit e940856fee
5 changed files with 32 additions and 27 deletions
+2 -6
View File
@@ -36,6 +36,8 @@ import (
*/
// ErrorResponse - Is the typed error returned by all API operations.
// ErrorResponse struct should be comparable since it is compared inside
// golang http API (https://github.com/golang/go/issues/29768)
type ErrorResponse struct {
XMLName xml.Name `xml:"Error" json:"-"`
Code string
@@ -51,9 +53,6 @@ type ErrorResponse struct {
// Underlying HTTP status code for the returned error
StatusCode int `xml:"-" json:"-"`
// Headers of the returned S3 XML error
Headers http.Header `xml:"-" json:"-"`
}
// ToErrorResponse - Returns parsed ErrorResponse struct from body and
@@ -177,9 +176,6 @@ func httpRespToErrorResponse(resp *http.Response, bucketName, objectName string)
errResp.Message = fmt.Sprintf("Region does not match, expecting region ‘%s’.", errResp.Region)
}
// Save headers returned in the API XML error
errResp.Headers = resp.Header
return errResp
}
+1 -1
View File
@@ -102,7 +102,7 @@ type Options struct {
// Global constants.
const (
libraryName = "minio-go"
libraryVersion = "v6.0.14"
libraryVersion = "v6.0.15"
)
// User Agent should always following the below style.
+1 -1
View File
@@ -151,7 +151,7 @@ func getCanonicalHeaders(req http.Request, ignoredHeaders map[string]bool) strin
if idx > 0 {
buf.WriteByte(',')
}
buf.WriteString(v)
buf.WriteString(signV4TrimAll(v))
}
buf.WriteByte('\n')
}
+9
View File
@@ -21,6 +21,7 @@ import (
"crypto/hmac"
"crypto/sha256"
"net/http"
"strings"
)
// unsignedPayload - value to be set to X-Amz-Content-Sha256 header when
@@ -47,3 +48,11 @@ func getHostAddr(req *http.Request) string {
}
return req.URL.Host
}
// Trim leading and trailing spaces and replace sequential spaces with one space, following Trimall()
// in http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
func signV4TrimAll(input string) string {
// Compress adjacent spaces (a space is determined by
// unicode.IsSpace() internally here) to one space and return
return strings.Join(strings.Fields(input), " ")
}
+19 -19
View File
@@ -111,46 +111,46 @@
"revisionTime": "2017-02-27T07:32:28Z"
},
{
"checksumSHA1": "Sbze8wr7T6Avtc+4K8BbcHlIx4E=",
"checksumSHA1": "AKbqalGJxudio9N94TFtqDD8PWs=",
"path": "github.com/minio/minio-go",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "kgQZ7iWmuKVboL2d4DUU9l5isng=",
"checksumSHA1": "EkkMfXkYIxEckIkgr3yM1xQtMkE=",
"path": "github.com/minio/minio-go/pkg/credentials",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "Md5pOKYfoKtrG7xNvs2FtiDPfDc=",
"path": "github.com/minio/minio-go/pkg/encrypt",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "6D/qMFV+e39L+6aeT+Seq1guohM=",
"checksumSHA1": "BxFHeQVFZ0t/ZFBJTeM2uegFZI8=",
"path": "github.com/minio/minio-go/pkg/policy",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "bbWjcrOQsV57qK+BSsrNAsI+Q/o=",
"checksumSHA1": "1KcTZxPRRQ0BWLt1zDVG1bSjm/4=",
"path": "github.com/minio/minio-go/pkg/s3signer",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "UQLtl8GIFr1lcHlM7KluYdU3JQg=",
"checksumSHA1": "7iUaZkEJdhkyAu3F07vrX8pyavI=",
"path": "github.com/minio/minio-go/pkg/s3utils",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "Wt8ej+rZXTdNBR9Xyw1eGo3Iq5o=",
"path": "github.com/minio/minio-go/pkg/set",
"revision": "a42b0e14697ffdcb4ef223384c1cac12738f574f",
"revisionTime": "2019-01-20T10:05:29Z"
"revision": "17db16b312c7356c6fbac0329b104fe8c74d736d",
"revisionTime": "2019-01-24T10:19:12Z"
},
{
"checksumSHA1": "g8YlJVY8CHJy+N4pAF1522n/Yr8=",