Bump AWS SDK
Fixes https://github.com/docker/distribution/issues/3097 Signed-off-by: Yong Wen Chua <lawliet89@users.noreply.github.com>
This commit is contained in:
parent
492a10376c
commit
e1464fd317
200 changed files with 33190 additions and 7451 deletions
16
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy.go
generated
vendored
16
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy.go
generated
vendored
|
@ -32,6 +32,19 @@ func (t AWSEpochTime) MarshalJSON() ([]byte, error) {
|
|||
return []byte(fmt.Sprintf(`{"AWS:EpochTime":%d}`, t.UTC().Unix())), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON unserializes AWS Profile epoch time.
|
||||
func (t *AWSEpochTime) UnmarshalJSON(data []byte) error {
|
||||
var epochTime struct {
|
||||
Sec int64 `json:"AWS:EpochTime"`
|
||||
}
|
||||
err := json.Unmarshal(data, &epochTime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t.Time = time.Unix(epochTime.Sec, 0).UTC()
|
||||
return nil
|
||||
}
|
||||
|
||||
// An IPAddress wraps an IPAddress source IP providing JSON serialization information
|
||||
type IPAddress struct {
|
||||
SourceIP string `json:"AWS:SourceIp"`
|
||||
|
@ -169,11 +182,10 @@ func NewCannedPolicy(resource string, expires time.Time) *Policy {
|
|||
|
||||
// encodePolicy encodes the Policy as JSON and also base 64 encodes it.
|
||||
func encodePolicy(p *Policy) (b64Policy, jsonPolicy []byte, err error) {
|
||||
jsonPolicy, err = json.Marshal(p)
|
||||
jsonPolicy, err = encodePolicyJSON(p)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to encode policy, %s", err.Error())
|
||||
}
|
||||
|
||||
// Remove leading and trailing white space, JSON encoding will note include
|
||||
// whitespace within the encoding.
|
||||
jsonPolicy = bytes.TrimSpace(jsonPolicy)
|
||||
|
|
14
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy_json_1_6.go
generated
vendored
Normal file
14
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy_json_1_6.go
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
// +build !go1.7
|
||||
|
||||
package sign
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func encodePolicyJSON(p *Policy) ([]byte, error) {
|
||||
src, err := json.Marshal(p)
|
||||
// Convert \u0026 back to &
|
||||
return bytes.Replace(src, []byte("\\u0026"), []byte("&"), -1), err
|
||||
}
|
16
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy_json_1_7.go
generated
vendored
Normal file
16
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/policy_json_1_7.go
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
// +build go1.7
|
||||
|
||||
package sign
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func encodePolicyJSON(p *Policy) ([]byte, error) {
|
||||
buffer := &bytes.Buffer{}
|
||||
encoder := json.NewEncoder(buffer)
|
||||
encoder.SetEscapeHTML(false)
|
||||
err := encoder.Encode(p)
|
||||
return buffer.Bytes(), err
|
||||
}
|
2
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/sign_cookie.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/service/cloudfront/sign/sign_cookie.go
generated
vendored
|
@ -179,7 +179,7 @@ func cookieURLScheme(u string) (string, error) {
|
|||
//
|
||||
// // Or get Signed cookies for a resource that will expire in 1 hour
|
||||
// // and set path and domain of cookies
|
||||
// cookies, err := s.Sign(policy, func(o *sign.CookieOptions) {
|
||||
// cookies, err := s.SignWithPolicy(policy, func(o *sign.CookieOptions) {
|
||||
// o.Path = "/"
|
||||
// o.Domain = ".example.com"
|
||||
// })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue