Documentation ¶
Index ¶
- func EncodePath(pathName string) string
- func GetCanonicalRequest(extractedSignedHeaders http.Header, payload, queryStr, urlPath, method string) string
- func GetContentSHA256Checksum(r *http.Request) (string, error)
- func GetSignature(signingKey []byte, stringToSign string) string
- func GetSignedHeaders(signedHeaders http.Header) string
- func GetSigningKey(secretKey string, t time.Time, region string) []byte
- func GetStringToSign(canonicalRequest string, t time.Time, scope string) string
- func IsRequestSignatureV4(r *http.Request) bool
- type AuthType
- type Option
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePath ¶
EncodePath encode the strings from UTF-8 byte representations to HTML hex escape sequences
This is necessary since regular url.Parse() and url.Encode() functions do not support UTF-8 non english characters cannot be parsed due to the nature in which url.Encode() is written
This function on the other hand is a direct replacement for url.Encode() technique to support pretty much every UTF-8 character.
func GetCanonicalRequest ¶
func GetCanonicalRequest(extractedSignedHeaders http.Header, payload, queryStr, urlPath, method string) string
GetCanonicalRequest generate a canonical request of style
canonicalRequest =
<HTTPMethod>\n <CanonicalURI>\n <CanonicalQueryString>\n <CanonicalHeaders>\n <SignedHeaders>\n <HashedPayload>
func GetSignature ¶
GetSignature final signature in hexadecimal form.
func GetSignedHeaders ¶
GetSignedHeaders generate a string i.e alphabetically sorted, semicolon-separated list of lowercase request header names
func GetSigningKey ¶
GetSigningKey hmac seed to calculate final signature.
func GetStringToSign ¶
GetStringToSign a string based on selected query values.
func IsRequestSignatureV4 ¶
IsRequestSignatureV4 Verify if request has AWS Signature Version '4'.
Types ¶
type AuthType ¶
type AuthType int
AuthType Authorization type.
const ( AuthTypeUnknown AuthType = iota AuthTypeAnonymous AuthTypePresigned AuthTypePresignedV2 AuthTypePostPolicy AuthTypeStreamingSigned AuthTypeSigned AuthTypeSignedV2 AuthTypeJWT AuthTypeSTS )
List of all supported auth types.
func GetRequestAuthType ¶
GetRequestAuthType Get request authentication type.