| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <[email protected]> |
| Stability | provisional |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.Sign.V4.Base
Description
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 CanonicalPath = Tag "canonical-path" 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 -> CanonicalPath -> Hash -> CanonicalQuery -> CanonicalHeaders -> SignedHeaders -> CanonicalRequest
- escapedPath :: Region -> Request a -> Path
- canonicalPath :: Region -> Request a -> CanonicalPath
- fullRawPath :: Region -> Request a -> RawPath
- canonicalQuery :: QueryString -> CanonicalQuery
- canonicalHeaders :: NormalisedHeaders -> CanonicalHeaders
- signedHeaders :: NormalisedHeaders -> SignedHeaders
- normaliseHeaders :: [Header] -> NormalisedHeaders
Documentation
Constructors
Instances
| ToLog V4 Source # | |
Defined in Amazonka.Sign.V4.Base Methods 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 ByteStrings 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 Methods toBS :: CredentialScope -> ByteString Source # | |
| ToByteString (Tag s ByteString) Source # | |
Defined in Amazonka.Sign.V4.Base Methods toBS :: Tag s ByteString -> ByteString Source # | |
| ToLog (Tag s ByteString) Source # | |
Defined in Amazonka.Sign.V4.Base Methods build :: Tag s ByteString -> ByteStringBuilder Source # | |
| Show a => Show (Tag s a) 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 CanonicalPath = Tag "canonical-path" ByteString Source #
type Path = Tag "path" ByteString Source #
type Signature = Tag "signature" ByteString Source #
authorisation :: V4 -> ByteString Source #
Arguments
| :: 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 -> CanonicalPath -> Hash -> CanonicalQuery -> CanonicalHeaders -> SignedHeaders -> CanonicalRequest Source #
canonicalPath :: Region -> Request a -> CanonicalPath Source #
fullRawPath :: Region -> Request a -> RawPath Source #
The complete raw path for a request, including any $sel:basePath:Endpoint on
the endpoint.
normaliseHeaders :: [Header] -> NormalisedHeaders Source #