code.dwrz.net

Go monorepo.
Log | Files | Refs

headers.go (3307B)


      1 package v4
      2 
      3 // IgnoredHeaders is a list of headers that are ignored during signing
      4 var IgnoredHeaders = Rules{
      5 	ExcludeList{
      6 		MapRule{
      7 			"Authorization":   struct{}{},
      8 			"User-Agent":      struct{}{},
      9 			"X-Amzn-Trace-Id": struct{}{},
     10 		},
     11 	},
     12 }
     13 
     14 // RequiredSignedHeaders is a allow list for Build canonical headers.
     15 var RequiredSignedHeaders = Rules{
     16 	AllowList{
     17 		MapRule{
     18 			"Cache-Control":                         struct{}{},
     19 			"Content-Disposition":                   struct{}{},
     20 			"Content-Encoding":                      struct{}{},
     21 			"Content-Language":                      struct{}{},
     22 			"Content-Md5":                           struct{}{},
     23 			"Content-Type":                          struct{}{},
     24 			"Expires":                               struct{}{},
     25 			"If-Match":                              struct{}{},
     26 			"If-Modified-Since":                     struct{}{},
     27 			"If-None-Match":                         struct{}{},
     28 			"If-Unmodified-Since":                   struct{}{},
     29 			"Range":                                 struct{}{},
     30 			"X-Amz-Acl":                             struct{}{},
     31 			"X-Amz-Copy-Source":                     struct{}{},
     32 			"X-Amz-Copy-Source-If-Match":            struct{}{},
     33 			"X-Amz-Copy-Source-If-Modified-Since":   struct{}{},
     34 			"X-Amz-Copy-Source-If-None-Match":       struct{}{},
     35 			"X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
     36 			"X-Amz-Copy-Source-Range":               struct{}{},
     37 			"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{},
     38 			"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key":       struct{}{},
     39 			"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5":   struct{}{},
     40 			"X-Amz-Grant-Full-control":                                    struct{}{},
     41 			"X-Amz-Grant-Read":                                            struct{}{},
     42 			"X-Amz-Grant-Read-Acp":                                        struct{}{},
     43 			"X-Amz-Grant-Write":                                           struct{}{},
     44 			"X-Amz-Grant-Write-Acp":                                       struct{}{},
     45 			"X-Amz-Metadata-Directive":                                    struct{}{},
     46 			"X-Amz-Mfa":                                                   struct{}{},
     47 			"X-Amz-Request-Payer":                                         struct{}{},
     48 			"X-Amz-Server-Side-Encryption":                                struct{}{},
     49 			"X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id":                 struct{}{},
     50 			"X-Amz-Server-Side-Encryption-Customer-Algorithm":             struct{}{},
     51 			"X-Amz-Server-Side-Encryption-Customer-Key":                   struct{}{},
     52 			"X-Amz-Server-Side-Encryption-Customer-Key-Md5":               struct{}{},
     53 			"X-Amz-Storage-Class":                                         struct{}{},
     54 			"X-Amz-Website-Redirect-Location":                             struct{}{},
     55 			"X-Amz-Content-Sha256":                                        struct{}{},
     56 			"X-Amz-Tagging":                                               struct{}{},
     57 		},
     58 	},
     59 	Patterns{"X-Amz-Object-Lock-"},
     60 	Patterns{"X-Amz-Meta-"},
     61 }
     62 
     63 // AllowedQueryHoisting is a allowed list for Build query headers. The boolean value
     64 // represents whether or not it is a pattern.
     65 var AllowedQueryHoisting = InclusiveRules{
     66 	ExcludeList{RequiredSignedHeaders},
     67 	Patterns{"X-Amz-"},
     68 }