Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Synopsis
- data V4 = V4 {
- metaTime :: UTCTime
- metaMethod :: Method
- metaPath :: Path
- metaEndpoint :: Endpoint
- metaCredential :: Credential
- metaCanonicalQuery :: CanonicalQuery
- metaCanonicalRequest :: CanonicalRequest
- metaCanonicalHeaders :: CanonicalHeaders
- metaSignedHeaders :: SignedHeaders
- metaStringToSign :: StringToSign
- metaSignature :: Signature
- metaHeaders :: [Header]
- metaTimeout :: Maybe Seconds
- base :: Hash -> Request a -> AuthEnv -> Region -> UTCTime -> (V4, ClientRequest -> ClientRequest)
- newtype Tag (s :: Symbol) a = Tag {
- untag :: a
- type Hash = Tag "body-digest" ByteString
- type StringToSign = Tag "string-to-sign" ByteString
- type Credential = Tag "credential" ByteString
- type CredentialScope = Tag "credential-scope" [ByteString]
- type CanonicalRequest = Tag "canonical-request" ByteString
- type CanonicalHeaders = Tag "canonical-headers" ByteString
- type CanonicalQuery = Tag "canonical-query" ByteString
- type SignedHeaders = Tag "signed-headers" ByteString
- type NormalisedHeaders = Tag "normalised-headers" [(ByteString, ByteString)]
- type Method = Tag "method" ByteString
- type Path = Tag "path" ByteString
- type Signature = Tag "signature" ByteString
- authorisation :: V4 -> ByteString
- signRequest :: V4 -> RequestBody -> (ClientRequest -> ClientRequest) -> Signed a
- signMetadata :: AuthEnv -> Region -> UTCTime -> (Credential -> SignedHeaders -> QueryString -> QueryString) -> Hash -> Request a -> V4
- algorithm :: ByteString
- signature :: SecretKey -> CredentialScope -> StringToSign -> Signature
- stringToSign :: UTCTime -> CredentialScope -> CanonicalRequest -> StringToSign
- credential :: AccessKey -> CredentialScope -> Credential
- credentialScope :: Service -> Endpoint -> UTCTime -> CredentialScope
- canonicalRequest :: Method -> Path -> Hash -> CanonicalQuery -> CanonicalHeaders -> SignedHeaders -> CanonicalRequest
- escapedPath :: Request a -> Path
- canonicalQuery :: QueryString -> CanonicalQuery
- canonicalHeaders :: NormalisedHeaders -> CanonicalHeaders
- signedHeaders :: NormalisedHeaders -> SignedHeaders
- normaliseHeaders :: [Header] -> NormalisedHeaders
Documentation
Instances
ToLog V4 Source # | |
Defined in Amazonka.Sign.V4.Base build :: V4 -> ByteStringBuilder Source # |
base :: Hash -> Request a -> AuthEnv -> Region -> UTCTime -> (V4, ClientRequest -> ClientRequest) Source #
newtype Tag (s :: Symbol) a Source #
Used to tag provenance. This allows keeping the same layout as
the signing documentation, passing ByteString
s everywhere, with
some type guarantees.
Data.Tagged is not used for no reason other than the dependency, syntactic length, and the ToByteString instance.
Instances
ToByteString CredentialScope Source # | |
Defined in Amazonka.Sign.V4.Base toBS :: CredentialScope -> ByteString Source # | |
Show a => Show (Tag s a) Source # | |
ToByteString (Tag s ByteString) Source # | |
Defined in Amazonka.Sign.V4.Base toBS :: Tag s ByteString -> ByteString Source # | |
ToLog (Tag s ByteString) Source # | |
Defined in Amazonka.Sign.V4.Base build :: Tag s ByteString -> ByteStringBuilder Source # |
type Hash = Tag "body-digest" ByteString Source #
type StringToSign = Tag "string-to-sign" ByteString Source #
type Credential = Tag "credential" ByteString Source #
type CredentialScope = Tag "credential-scope" [ByteString] Source #
type CanonicalRequest = Tag "canonical-request" ByteString Source #
type CanonicalHeaders = Tag "canonical-headers" ByteString Source #
type CanonicalQuery = Tag "canonical-query" ByteString Source #
type SignedHeaders = Tag "signed-headers" ByteString Source #
type NormalisedHeaders = Tag "normalised-headers" [(ByteString, ByteString)] Source #
type Method = Tag "method" ByteString Source #
type Path = Tag "path" ByteString Source #
type Signature = Tag "signature" ByteString Source #
authorisation :: V4 -> ByteString Source #
:: V4 | Pre-signRequestd signing metadata. |
-> RequestBody | The request body. |
-> (ClientRequest -> ClientRequest) | Insert authentication information. |
-> Signed a |
signMetadata :: AuthEnv -> Region -> UTCTime -> (Credential -> SignedHeaders -> QueryString -> QueryString) -> Hash -> Request a -> V4 Source #
signature :: SecretKey -> CredentialScope -> StringToSign -> Signature Source #
stringToSign :: UTCTime -> CredentialScope -> CanonicalRequest -> StringToSign Source #
credential :: AccessKey -> CredentialScope -> Credential Source #
credentialScope :: Service -> Endpoint -> UTCTime -> CredentialScope Source #
canonicalRequest :: Method -> Path -> Hash -> CanonicalQuery -> CanonicalHeaders -> SignedHeaders -> CanonicalRequest Source #
escapedPath :: Request a -> Path Source #
normaliseHeaders :: [Header] -> NormalisedHeaders Source #