-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bindings for Amazon Web Services (AWS) General Reference -- @package aws-general @version 0.2.2 -- | Bindings for AWS General Reference -- -- API Version: 1.0 -- -- http://docs.aws.amazon.com/general/latest/gr/ module Aws.General class AwsType a where fromText = parseOnly $ parse <* eof toText :: (AwsType a, IsString b, Monoid b) => a -> b parse :: (AwsType a, Monad m, CharParsing m) => m a fromText :: AwsType a => Text -> Either String a data GeneralVersion GeneralVersion_1_0 :: GeneralVersion generalVersionToText :: IsString a => GeneralVersion -> a parseGeneralVersion :: CharParsing m => m GeneralVersion data SignatureVersion SignatureVersion2 :: SignatureVersion SignatureVersion4 :: SignatureVersion signatureVersionToText :: IsString a => SignatureVersion -> a parseSignatureVersion :: CharParsing m => m SignatureVersion data SignatureMethod SignatureMethodSha1 :: SignatureMethod SignatureMethodSha256 :: SignatureMethod signatureMethodToText :: IsString a => SignatureMethod -> a parseSignatureMethod :: CharParsing m => m SignatureMethod -- | Region -- -- http://docs.aws.amazon.com/general/1.0/gr/rande.html -- -- The relation between regions and service endpoints is not bijective -- for all AWS services. Not all AWS services support all regions. Some -- services don't use the concept of region at all. data Region ApNortheast1 :: Region ApSoutheast1 :: Region ApSoutheast2 :: Region EuWest1 :: Region SaEast1 :: Region UsEast1 :: Region UsWest1 :: Region UsWest2 :: Region -- | To override the region settings with a custom service endpoint, e.g. -- for testing purpose CustomEndpoint :: !Text -> !Int -> Region regionToText :: (Monoid a, IsString a) => Region -> a -- | Regions are parsed as follows: -- --
-- ApNortheast1 ::= "ap-northeast-1" -- ApSoutheast1 ::= "ap-southeast-1" -- ApSoutheast2 ::= "ap-southeast-2" -- EuWest1 ::= "eu-west-1" -- SaEast1 ::= "sa-east-1" -- UsEast1 ::= "us-east-1" -- UsWest1 ::= "us-west-1" -- UsWest2 ::= "us-west-2" -- CustomEndpoint ::= "custom:" Text ":" Int --parseRegion :: CharParsing m => m Region -- | AWS Account Id -- -- -- http://docs.aws.amazon.com/general/1.0/gr/acct-identifiers.html. -- -- This is actually a 12 digit number. newtype AccountId AccountId :: Text -> AccountId accountIdToText :: IsString a => AccountId -> a parseAccountId :: CharParsing m => m AccountId -- | AWS Canonical User ID -- -- -- http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html. -- -- This is actually a long hexadecimal number newtype CanonicalUserId CanonicalUserId :: Text -> CanonicalUserId canonicalUserIdToText :: IsString a => CanonicalUserId -> a parseCanonicalUserId :: CharParsing m => m CanonicalUserId -- | AWS Service Namespaces -- -- -- http://docs.aws.amazon.com/general/1.0/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces data ServiceNamespace ServiceNamespaceAwsPortal :: ServiceNamespace ServiceNamespaceAutoscaling :: ServiceNamespace ServiceNamespaceCloudformation :: ServiceNamespace ServiceNamespaceCloudfront :: ServiceNamespace ServiceNamespaceCloudwatch :: ServiceNamespace ServiceNamespaceDynamodb :: ServiceNamespace -- | Amazon EC2 and Amazon VPC ServiceNamespaceEc2 :: ServiceNamespace ServiceNamespaceElasticbeanstalk :: ServiceNamespace ServiceNamespaceElasticloadbalancing :: ServiceNamespace ServiceNamespaceElasticmapreduce :: ServiceNamespace ServiceNamespaceElasticache :: ServiceNamespace ServiceNamespaceGlacier :: ServiceNamespace ServiceNamespaceIam :: ServiceNamespace ServiceNamespaceKinesis :: ServiceNamespace ServiceNamespaceAwsMarketplaceManagement :: ServiceNamespace ServiceNamespaceOpsworks :: ServiceNamespace ServiceNamespaceRds :: ServiceNamespace ServiceNamespaceRedshift :: ServiceNamespace ServiceNamespaceRoute53 :: ServiceNamespace ServiceNamespaceS3 :: ServiceNamespace ServiceNamespaceSes :: ServiceNamespace ServiceNamespaceSdb :: ServiceNamespace ServiceNamespaceSqs :: ServiceNamespace ServiceNamespaceSns :: ServiceNamespace ServiceNamespaceStoragegateway :: ServiceNamespace ServiceNamespaceSts :: ServiceNamespace ServiceNamespaceSupport :: ServiceNamespace ServiceNamespaceSwf :: ServiceNamespace -- | For testing purposes (see -- http://docs.aws.amazon.com/general/1.0/gr/signature-v4-test-suite.html) ServiceNamespaceHost :: ServiceNamespace serviceNamespaceToText :: IsString a => ServiceNamespace -> a parseServiceNamespace :: CharParsing m => m ServiceNamespace -- | Amazon Resource Names -- -- -- http://docs.aws.amazon.com/general/1.0/gr/aws-arns-and-namespaces.html -- -- From the specification it is not clear if elements of -- arnResource can be empty. Though examples given in the -- specification do not inlcude such a case, our parser allows it. data Arn Arn :: ServiceNamespace -> Maybe Region -> Maybe AccountId -> [Text] -> Arn arnService :: Arn -> ServiceNamespace arnRegion :: Arn -> Maybe Region arnAccount :: Arn -> Maybe AccountId -- | expected to be non-empty. Elements are separated by only :. -- / is not treated specially. arnResource :: Arn -> [Text] arnToText :: (IsString a, Monoid a) => Arn -> a parseArn :: CharParsing m => m Arn instance Typeable GeneralVersion instance Typeable SignatureVersion instance Typeable SignatureMethod instance Typeable Region instance Typeable AccountId instance Typeable CanonicalUserId instance Typeable ServiceNamespace instance Typeable Arn instance Show GeneralVersion instance Read GeneralVersion instance Eq GeneralVersion instance Ord GeneralVersion instance Enum GeneralVersion instance Bounded GeneralVersion instance Generic GeneralVersion instance Show SignatureVersion instance Read SignatureVersion instance Eq SignatureVersion instance Ord SignatureVersion instance Enum SignatureVersion instance Bounded SignatureVersion instance Generic SignatureVersion instance Show SignatureMethod instance Read SignatureMethod instance Eq SignatureMethod instance Ord SignatureMethod instance Enum SignatureMethod instance Bounded SignatureMethod instance Generic SignatureMethod instance Show Region instance Read Region instance Eq Region instance Ord Region instance Generic Region instance Show AccountId instance Read AccountId instance Eq AccountId instance Ord AccountId instance IsString AccountId instance Generic AccountId instance Show CanonicalUserId instance Read CanonicalUserId instance Eq CanonicalUserId instance Ord CanonicalUserId instance IsString CanonicalUserId instance Generic CanonicalUserId instance Show ServiceNamespace instance Read ServiceNamespace instance Eq ServiceNamespace instance Ord ServiceNamespace instance Enum ServiceNamespace instance Bounded ServiceNamespace instance Generic ServiceNamespace instance Show Arn instance Read Arn instance Eq Arn instance Ord Arn instance Generic Arn instance Datatype D1GeneralVersion instance Constructor C1_0GeneralVersion instance Datatype D1SignatureVersion instance Constructor C1_0SignatureVersion instance Constructor C1_1SignatureVersion instance Datatype D1SignatureMethod instance Constructor C1_0SignatureMethod instance Constructor C1_1SignatureMethod instance Datatype D1Region instance Constructor C1_0Region instance Constructor C1_1Region instance Constructor C1_2Region instance Constructor C1_3Region instance Constructor C1_4Region instance Constructor C1_5Region instance Constructor C1_6Region instance Constructor C1_7Region instance Constructor C1_8Region instance Datatype D1AccountId instance Constructor C1_0AccountId instance Datatype D1CanonicalUserId instance Constructor C1_0CanonicalUserId instance Datatype D1ServiceNamespace instance Constructor C1_0ServiceNamespace instance Constructor C1_1ServiceNamespace instance Constructor C1_2ServiceNamespace instance Constructor C1_3ServiceNamespace instance Constructor C1_4ServiceNamespace instance Constructor C1_5ServiceNamespace instance Constructor C1_6ServiceNamespace instance Constructor C1_7ServiceNamespace instance Constructor C1_8ServiceNamespace instance Constructor C1_9ServiceNamespace instance Constructor C1_10ServiceNamespace instance Constructor C1_11ServiceNamespace instance Constructor C1_12ServiceNamespace instance Constructor C1_13ServiceNamespace instance Constructor C1_14ServiceNamespace instance Constructor C1_15ServiceNamespace instance Constructor C1_16ServiceNamespace instance Constructor C1_17ServiceNamespace instance Constructor C1_18ServiceNamespace instance Constructor C1_19ServiceNamespace instance Constructor C1_20ServiceNamespace instance Constructor C1_21ServiceNamespace instance Constructor C1_22ServiceNamespace instance Constructor C1_23ServiceNamespace instance Constructor C1_24ServiceNamespace instance Constructor C1_25ServiceNamespace instance Constructor C1_26ServiceNamespace instance Constructor C1_27ServiceNamespace instance Constructor C1_28ServiceNamespace instance Datatype D1Arn instance Constructor C1_0Arn instance Selector S1_0_0Arn instance Selector S1_0_1Arn instance Selector S1_0_2Arn instance Selector S1_0_3Arn instance Arbitrary Arn instance FromJSON Arn instance ToJSON Arn instance AwsType Arn instance NFData Arn instance Arbitrary ServiceNamespace instance Hashable ServiceNamespace instance AwsType ServiceNamespace instance NFData ServiceNamespace instance Arbitrary CanonicalUserId instance AwsType CanonicalUserId instance NFData CanonicalUserId instance Arbitrary AccountId instance AwsType AccountId instance NFData AccountId instance Arbitrary Region instance Hashable Region instance AwsType Region instance NFData Region instance Arbitrary SignatureMethod instance AwsType SignatureMethod instance NFData SignatureMethod instance Arbitrary SignatureVersion instance AwsType SignatureVersion instance NFData SignatureVersion instance Arbitrary GeneralVersion instance AwsType GeneralVersion instance NFData GeneralVersion -- | AWS Signature Version 4 -- -- API Version: 1.0 -- -- -- http://docs.aws.amazon.com/general/1.0/gr/signature-version-4.html module Aws.SignatureV4 data GeneralVersion GeneralVersion_1_0 :: GeneralVersion generalVersionToText :: IsString a => GeneralVersion -> a parseGeneralVersion :: CharParsing m => m GeneralVersion signatureVersion :: IsString a => a -- | AWS access credentials. -- -- This type is compatible with the Credential type from the -- aws package. You may use the following function to get a -- SignatureV4Credential from a Credential: -- --
-- cred2credv4 :: Credential -> SignatureV4Credential -- #if MIN_VERSION_aws(0,9,2) -- cred2credv4 (Credential a b c _) = SignatureV4Credential a b c -- #else -- cred2credv4 (Credential a b c) = SignatureV4Credential a b c -- #endif --data SignatureV4Credentials SignatureV4Credentials :: ByteString -> ByteString -> IORef [SigV4Key] -> Maybe ByteString -> SignatureV4Credentials sigV4AccessKeyId :: SignatureV4Credentials -> ByteString sigV4SecretAccessKey :: SignatureV4Credentials -> ByteString -- | used internally for caching the singing key sigV4SigningKeys :: SignatureV4Credentials -> IORef [SigV4Key] sigV4SecurityToken :: SignatureV4Credentials -> Maybe ByteString newCredentials :: (Functor m, MonadIO m) => ByteString -> ByteString -> Maybe ByteString -> m SignatureV4Credentials -- | Compute an AWS Signature Version 4 -- -- This version computes the derivied signing key each time it is invoked -- -- The request headers must include the host header. The -- query must include the Action parameter. -- -- The x-amz-date header is generated by the code. A possibly -- existing x-amz-date header or date header is -- replaced. signPostRequest :: SignatureV4Credentials -> Region -> ServiceNamespace -> UTCTime -> Method -> UriPath -> UriQuery -> RequestHeaders -> ByteString -> Either String RequestHeaders -- | Compute an AWS Signature Version 4 -- -- This version computes the derivied signing key each time it is invoked -- -- The request headers must include the host header. The -- query must include the Action parameter. signGetRequest :: SignatureV4Credentials -> Region -> ServiceNamespace -> UTCTime -> Method -> UriPath -> UriQuery -> RequestHeaders -> ByteString -> Either String UriQuery -- | The request headers must include the host header. The -- query must include the Action parameter. -- -- The x-amz-date header is generated by the code. A possibly -- existing x-amz-date header or date header is -- replaced. signPostRequestIO :: SignatureV4Credentials -> Region -> ServiceNamespace -> UTCTime -> Method -> UriPath -> UriQuery -> RequestHeaders -> ByteString -> IO (Either String RequestHeaders) -- | The request headers must include the host header. The -- query must include the Action parameter. signGetRequestIO :: SignatureV4Credentials -> Region -> ServiceNamespace -> UTCTime -> Method -> UriPath -> UriQuery -> RequestHeaders -> ByteString -> IO (Either String UriQuery) data AuthorizationInfo AuthorizationInfo :: !ByteString -> !ByteString -> !ByteString -> !UTCTime -> !ByteString -> AuthorizationInfo authzInfoAlgorithm :: AuthorizationInfo -> !ByteString authzInfoCredential :: AuthorizationInfo -> !ByteString authzInfoSignedHeaders :: AuthorizationInfo -> !ByteString authzInfoDate :: AuthorizationInfo -> !UTCTime authzInfoSignature :: AuthorizationInfo -> !ByteString authorizationInfo :: SignatureV4Credentials -> CredentialScope -> SignedHeaders -> UTCTime -> Signature -> AuthorizationInfo authorizationInfoQuery :: AuthorizationInfo -> UriQuery authorizationInfoHeader :: AuthorizationInfo -> RequestHeaders -- | Normalization of the date header breaks the AWS test suite, since the -- tests in that test suite use an invalid date. -- -- Date normalization is enabled by default but can be turned of via the -- cabal (compiletime) flag normalize-signature-v4-date. dateNormalizationEnabled :: Bool -- | We only support SHA256 since SHA1 has been deprecated signingAlgorithm :: IsString a => a type UriPath = [Text] type UriQuery = QueryText -- | Normalize URI Path according to RFC 3986 (6.2.2) normalizeUriPath :: UriPath -> UriPath -- | Normalize URI Query according to RFC 3986 (6.2.2) normalizeUriQuery :: UriQuery -> UriQuery newtype CanonicalUri CanonicalUri :: ByteString -> CanonicalUri -- | Compute canonical URI -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-create-canonical-request.html -- -- The input is assumed to be an absolute URI. If the first segment is -- .. it is kept as is. Most likely such an URI is invalid. canonicalUri :: UriPath -> UriQuery -> CanonicalUri newtype CanonicalHeaders CanonicalHeaders :: ByteString -> CanonicalHeaders -- | Compute canonical HTTP headers -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-create-canonical-request.html -- -- It is assumed (and not checked) that the header values comform with -- the definitions in RFC 2661. In particular non-comformant usage of -- quotation characters may lead to invalid results. canonicalHeaders :: RequestHeaders -> CanonicalHeaders data SignedHeaders -- | Compute signed headers -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-create-canonical-request.html signedHeaders :: RequestHeaders -> SignedHeaders newtype CanonicalRequest CanonicalRequest :: ByteString -> CanonicalRequest -- | Create Canonical Request for AWS Signature Version 4 -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-create-canonical-request.html -- -- This functions performs normalization of the URI and the Headers which -- is expensive. We should consider providing an alternate version of -- this function that bypasses these steps and simply assumes that the -- input is already canonical. canonicalRequest :: Method -> UriPath -> UriQuery -> RequestHeaders -> ByteString -> CanonicalRequest data HashedCanonicalRequest hashedCanonicalRequest :: CanonicalRequest -> HashedCanonicalRequest data CredentialScope CredentialScope :: !UTCTime -> !Region -> !ServiceNamespace -> CredentialScope credentialScopeDate :: CredentialScope -> !UTCTime credentialScopeRegion :: CredentialScope -> !Region credentialScopeService :: CredentialScope -> !ServiceNamespace credentialScopeToText :: (IsString a, Monoid a) => CredentialScope -> a newtype StringToSign StringToSign :: ByteString -> StringToSign -- | Create the String to Sign for AWS Signature Version 4 -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-create-string-to-sign.html stringToSign :: UTCTime -> CredentialScope -> CanonicalRequest -> StringToSign -- | This key can be computed once and cached. It is valid for all requests -- to the same service and the region till 00:00:00 UTC time. newtype SigningKey SigningKey :: ByteString -> SigningKey -- | Derive the signing key -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-calculate-signature.html signingKey :: SignatureV4Credentials -> CredentialScope -> SigningKey newtype Signature Signature :: ByteString -> Signature -- | Compute an AWS Signature Version 4 -- -- -- http://docs.aws.amazon.com/general/1.0/gr/sigv4-calculate-signature.html requestSignature :: SigningKey -> StringToSign -> Signature instance Typeable SignatureV4Credentials instance Typeable CanonicalUri instance Typeable CanonicalHeaders instance Typeable SignedHeaders instance Typeable CanonicalRequest instance Typeable HashedCanonicalRequest instance Typeable CredentialScope instance Typeable StringToSign instance Typeable SigningKey instance Typeable Signature instance Generic SignatureV4Credentials instance Show CanonicalUri instance Read CanonicalUri instance Eq CanonicalUri instance Ord CanonicalUri instance Generic CanonicalUri instance Show CanonicalHeaders instance Read CanonicalHeaders instance Eq CanonicalHeaders instance Ord CanonicalHeaders instance Generic CanonicalHeaders instance Show SignedHeaders instance Read SignedHeaders instance Eq SignedHeaders instance Ord SignedHeaders instance Generic SignedHeaders instance Show CanonicalRequest instance Read CanonicalRequest instance Eq CanonicalRequest instance Ord CanonicalRequest instance Generic CanonicalRequest instance Show HashedCanonicalRequest instance Read HashedCanonicalRequest instance Eq HashedCanonicalRequest instance Ord HashedCanonicalRequest instance Generic HashedCanonicalRequest instance Show CredentialScope instance Read CredentialScope instance Generic CredentialScope instance Show StringToSign instance Read StringToSign instance Eq StringToSign instance Ord StringToSign instance Generic StringToSign instance Show SigningKey instance Read SigningKey instance Eq SigningKey instance Ord SigningKey instance Generic SigningKey instance Show Signature instance Read Signature instance Eq Signature instance Ord Signature instance Generic Signature instance Datatype D1SignatureV4Credentials instance Constructor C1_0SignatureV4Credentials instance Selector S1_0_0SignatureV4Credentials instance Selector S1_0_1SignatureV4Credentials instance Selector S1_0_2SignatureV4Credentials instance Selector S1_0_3SignatureV4Credentials instance Datatype D1CanonicalUri instance Constructor C1_0CanonicalUri instance Datatype D1CanonicalHeaders instance Constructor C1_0CanonicalHeaders instance Datatype D1SignedHeaders instance Constructor C1_0SignedHeaders instance Datatype D1CanonicalRequest instance Constructor C1_0CanonicalRequest instance Datatype D1HashedCanonicalRequest instance Constructor C1_0HashedCanonicalRequest instance Datatype D1CredentialScope instance Constructor C1_0CredentialScope instance Selector S1_0_0CredentialScope instance Selector S1_0_1CredentialScope instance Selector S1_0_2CredentialScope instance Datatype D1StringToSign instance Constructor C1_0StringToSign instance Datatype D1SigningKey instance Constructor C1_0SigningKey instance Datatype D1Signature instance Constructor C1_0Signature instance NFData Signature instance NFData SigningKey instance NFData StringToSign instance Arbitrary CredentialScope instance AwsType CredentialScope instance Eq CredentialScope instance NFData CredentialScope instance NFData HashedCanonicalRequest instance NFData CanonicalRequest instance NFData SignedHeaders instance NFData CanonicalHeaders instance NFData CanonicalUri