amazonka-sts 1.4.5 → 1.5.0
raw patch · 16 files changed
+379/−425 lines, 16 filesdep ~amazonka-coredep ~amazonka-stsdep ~amazonka-testPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: amazonka-core, amazonka-sts, amazonka-test
API changes (from Hackage documentation)
- Network.AWS.STS: cAccessKeyId :: Lens' Credentials Text
- Network.AWS.STS: cExpiration :: Lens' Credentials UTCTime
- Network.AWS.STS: cSecretAccessKey :: Lens' Credentials Text
- Network.AWS.STS: cSessionToken :: Lens' Credentials Text
- Network.AWS.STS: credentials :: Text -> Text -> Text -> UTCTime -> Credentials
- Network.AWS.STS: data Credentials
- Network.AWS.STS.AssumeRole: instance GHC.Read.Read Network.AWS.STS.AssumeRole.AssumeRoleResponse
- Network.AWS.STS.AssumeRoleWithSAML: instance GHC.Read.Read Network.AWS.STS.AssumeRoleWithSAML.AssumeRoleWithSAMLResponse
- Network.AWS.STS.AssumeRoleWithWebIdentity: instance GHC.Read.Read Network.AWS.STS.AssumeRoleWithWebIdentity.AssumeRoleWithWebIdentityResponse
- Network.AWS.STS.GetFederationToken: instance GHC.Read.Read Network.AWS.STS.GetFederationToken.GetFederationTokenResponse
- Network.AWS.STS.GetSessionToken: instance GHC.Read.Read Network.AWS.STS.GetSessionToken.GetSessionTokenResponse
- Network.AWS.STS.Types: cAccessKeyId :: Lens' Credentials Text
- Network.AWS.STS.Types: cExpiration :: Lens' Credentials UTCTime
- Network.AWS.STS.Types: cSecretAccessKey :: Lens' Credentials Text
- Network.AWS.STS.Types: cSessionToken :: Lens' Credentials Text
- Network.AWS.STS.Types: credentials :: Text -> Text -> Text -> UTCTime -> Credentials
- Network.AWS.STS.Types: data Credentials
- Network.AWS.STS.AssumeRole: arrsCredentials :: Lens' AssumeRoleResponse (Maybe Credentials)
+ Network.AWS.STS.AssumeRole: arrsCredentials :: Lens' AssumeRoleResponse (Maybe AuthEnv)
- Network.AWS.STS.AssumeRoleWithSAML: arwsamlrsCredentials :: Lens' AssumeRoleWithSAMLResponse (Maybe Credentials)
+ Network.AWS.STS.AssumeRoleWithSAML: arwsamlrsCredentials :: Lens' AssumeRoleWithSAMLResponse (Maybe AuthEnv)
- Network.AWS.STS.AssumeRoleWithWebIdentity: arwwirsCredentials :: Lens' AssumeRoleWithWebIdentityResponse (Maybe Credentials)
+ Network.AWS.STS.AssumeRoleWithWebIdentity: arwwirsCredentials :: Lens' AssumeRoleWithWebIdentityResponse (Maybe AuthEnv)
- Network.AWS.STS.GetFederationToken: gftrsCredentials :: Lens' GetFederationTokenResponse (Maybe Credentials)
+ Network.AWS.STS.GetFederationToken: gftrsCredentials :: Lens' GetFederationTokenResponse (Maybe AuthEnv)
- Network.AWS.STS.GetSessionToken: gstrsCredentials :: Lens' GetSessionTokenResponse (Maybe Credentials)
+ Network.AWS.STS.GetSessionToken: gstrsCredentials :: Lens' GetSessionTokenResponse (Maybe AuthEnv)
Files
- README.md +1/−1
- amazonka-sts.cabal +16/−11
- gen/Network/AWS/STS.hs +11/−19
- gen/Network/AWS/STS/AssumeRole.hs +50/−46
- gen/Network/AWS/STS/AssumeRoleWithSAML.hs +50/−46
- gen/Network/AWS/STS/AssumeRoleWithWebIdentity.hs +51/−46
- gen/Network/AWS/STS/DecodeAuthorizationMessage.hs +23/−22
- gen/Network/AWS/STS/GetCallerIdentity.hs +28/−24
- gen/Network/AWS/STS/GetFederationToken.hs +36/−35
- gen/Network/AWS/STS/GetSessionToken.hs +33/−31
- gen/Network/AWS/STS/Types.hs +44/−42
- gen/Network/AWS/STS/Types/Product.hs +21/−87
- gen/Network/AWS/STS/Types/Sum.hs +3/−3
- gen/Network/AWS/STS/Waiters.hs +6/−6
- test/Main.hs +2/−2
- test/Test/AWS/Gen/STS.hs +4/−4
README.md view
@@ -8,7 +8,7 @@ ## Version -`1.4.5`+`1.5.0` ## Description
amazonka-sts.cabal view
@@ -1,13 +1,13 @@ name: amazonka-sts-version: 1.4.5+version: 1.5.0 synopsis: Amazon Security Token Service SDK. homepage: https://github.com/brendanhay/amazonka bug-reports: https://github.com/brendanhay/amazonka/issues-license: OtherLicense+license: MPL-2.0 license-file: LICENSE author: Brendan Hay-maintainer: Brendan Hay <brendan.g.hay@gmail.com>-copyright: Copyright (c) 2013-2016 Brendan Hay+maintainer: Brendan Hay <brendan.g.hay+amazonka@gmail.com>+copyright: Copyright (c) 2013-2017 Brendan Hay category: Network, AWS, Cloud, Distributed Computing build-type: Simple cabal-version: >= 1.10@@ -29,14 +29,19 @@ to get started. source-repository head- type: git- location: git://github.com/brendanhay/amazonka.git+ type: git+ location: git://github.com/brendanhay/amazonka.git+ subdir: amazonka-sts library default-language: Haskell2010 hs-source-dirs: src gen - ghc-options: -Wall+ ghc-options:+ -Wall+ -fwarn-incomplete-uni-patterns+ -fwarn-incomplete-record-updates+ -funbox-strict-fields exposed-modules: Network.AWS.STS@@ -55,7 +60,7 @@ , Network.AWS.STS.Types.Sum build-depends:- amazonka-core == 1.4.5.*+ amazonka-core == 1.5.0.* , base >= 4.7 && < 5 test-suite amazonka-sts-test@@ -75,9 +80,9 @@ , Test.AWS.STS.Internal build-depends:- amazonka-core == 1.4.5.*- , amazonka-test == 1.4.5.*- , amazonka-sts == 1.4.5.*+ amazonka-core == 1.5.0.*+ , amazonka-test == 1.5.0.*+ , amazonka-sts , base , bytestring , tasty
gen/Network/AWS/STS.hs view
@@ -5,9 +5,9 @@ -- | -- Module : Network.AWS.STS--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -96,14 +96,6 @@ , aruAssumedRoleId , aruARN - -- ** Credentials- , Credentials- , credentials- , cAccessKeyId- , cSecretAccessKey- , cSessionToken- , cExpiration- -- ** FederatedUser , FederatedUser , federatedUser@@ -111,15 +103,15 @@ , fuARN ) where -import Network.AWS.STS.AssumeRole-import Network.AWS.STS.AssumeRoleWithSAML-import Network.AWS.STS.AssumeRoleWithWebIdentity-import Network.AWS.STS.DecodeAuthorizationMessage-import Network.AWS.STS.GetCallerIdentity-import Network.AWS.STS.GetFederationToken-import Network.AWS.STS.GetSessionToken-import Network.AWS.STS.Types-import Network.AWS.STS.Waiters+import Network.AWS.STS.AssumeRole+import Network.AWS.STS.AssumeRoleWithSAML+import Network.AWS.STS.AssumeRoleWithWebIdentity+import Network.AWS.STS.DecodeAuthorizationMessage+import Network.AWS.STS.GetCallerIdentity+import Network.AWS.STS.GetFederationToken+import Network.AWS.STS.GetSessionToken+import Network.AWS.STS.Types+import Network.AWS.STS.Waiters {- $errors Error matchers are designed for use with the functions provided by
gen/Network/AWS/STS/AssumeRole.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.AssumeRole--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -71,24 +71,25 @@ , arrsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'assumeRole' smart constructor. data AssumeRole = AssumeRole'- { _arTokenCode :: !(Maybe Text)- , _arDurationSeconds :: !(Maybe Nat)- , _arPolicy :: !(Maybe Text)- , _arExternalId :: !(Maybe Text)- , _arSerialNumber :: !(Maybe Text)- , _arRoleARN :: !Text- , _arRoleSessionName :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arTokenCode :: !(Maybe Text)+ , _arDurationSeconds :: !(Maybe Nat)+ , _arPolicy :: !(Maybe Text)+ , _arExternalId :: !(Maybe Text)+ , _arSerialNumber :: !(Maybe Text)+ , _arRoleARN :: !Text+ , _arRoleSessionName :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRole' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -99,28 +100,29 @@ -- -- * 'arPolicy' - An IAM policy in JSON format. This parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both (the intersection of) the access policy of the role that is being assumed, /and/ the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity> in the /IAM User Guide/ . The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters. ----- * 'arExternalId' - A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html How to Use an External ID When Granting Access to Your AWS Resources to a Third Party> in the /IAM User Guide/ . The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:\/-+-- * 'arExternalId' - A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html How to Use an External ID When Granting Access to Your AWS Resources to a Third Party> in the /IAM User Guide/ . The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/- ----- * 'arSerialNumber' - The identification number of the MFA device that is associated with the user who is making the @AssumeRole@ call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- * 'arSerialNumber' - The identification number of the MFA device that is associated with the user who is making the @AssumeRole@ call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- -- -- * 'arRoleARN' - The Amazon Resource Name (ARN) of the role to assume. ----- * 'arRoleSessionName' - An identifier for the assumed role session. Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- * 'arRoleSessionName' - An identifier for the assumed role session. Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- assumeRole :: Text -- ^ 'arRoleARN' -> Text -- ^ 'arRoleSessionName' -> AssumeRole assumeRole pRoleARN_ pRoleSessionName_ =- AssumeRole'- { _arTokenCode = Nothing- , _arDurationSeconds = Nothing- , _arPolicy = Nothing- , _arExternalId = Nothing- , _arSerialNumber = Nothing- , _arRoleARN = pRoleARN_- , _arRoleSessionName = pRoleSessionName_- }+ AssumeRole'+ { _arTokenCode = Nothing+ , _arDurationSeconds = Nothing+ , _arPolicy = Nothing+ , _arExternalId = Nothing+ , _arSerialNumber = Nothing+ , _arRoleARN = pRoleARN_+ , _arRoleSessionName = pRoleSessionName_+ } + -- | The value provided by the MFA device, if the trust policy of the role being assumed requires MFA (that is, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the @TokenCode@ value is missing or expired, the @AssumeRole@ call returns an "access denied" error. The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits. arTokenCode :: Lens' AssumeRole (Maybe Text) arTokenCode = lens _arTokenCode (\ s a -> s{_arTokenCode = a});@@ -133,11 +135,11 @@ arPolicy :: Lens' AssumeRole (Maybe Text) arPolicy = lens _arPolicy (\ s a -> s{_arPolicy = a}); --- | A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html How to Use an External ID When Granting Access to Your AWS Resources to a Third Party> in the /IAM User Guide/ . The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:\/-+-- | A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html How to Use an External ID When Granting Access to Your AWS Resources to a Third Party> in the /IAM User Guide/ . The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/- arExternalId :: Lens' AssumeRole (Maybe Text) arExternalId = lens _arExternalId (\ s a -> s{_arExternalId = a}); --- | The identification number of the MFA device that is associated with the user who is making the @AssumeRole@ call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- | The identification number of the MFA device that is associated with the user who is making the @AssumeRole@ call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- arSerialNumber :: Lens' AssumeRole (Maybe Text) arSerialNumber = lens _arSerialNumber (\ s a -> s{_arSerialNumber = a}); @@ -145,7 +147,7 @@ arRoleARN :: Lens' AssumeRole Text arRoleARN = lens _arRoleARN (\ s a -> s{_arRoleARN = a}); --- | An identifier for the assumed role session. Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- | An identifier for the assumed role session. Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- arRoleSessionName :: Lens' AssumeRole Text arRoleSessionName = lens _arRoleSessionName (\ s a -> s{_arRoleSessionName = a}); @@ -160,9 +162,9 @@ <*> (x .@? "AssumedRoleUser") <*> (pure (fromEnum s))) -instance Hashable AssumeRole+instance Hashable AssumeRole where -instance NFData AssumeRole+instance NFData AssumeRole where instance ToHeaders AssumeRole where toHeaders = const mempty@@ -188,12 +190,13 @@ -- -- /See:/ 'assumeRoleResponse' smart constructor. data AssumeRoleResponse = AssumeRoleResponse'- { _arrsPackedPolicySize :: !(Maybe Nat)- , _arrsCredentials :: !(Maybe Credentials)- , _arrsAssumedRoleUser :: !(Maybe AssumedRoleUser)- , _arrsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arrsPackedPolicySize :: !(Maybe Nat)+ , _arrsCredentials :: !(Maybe AuthEnv)+ , _arrsAssumedRoleUser :: !(Maybe AssumedRoleUser)+ , _arrsResponseStatus :: !Int+ } deriving (Eq, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRoleResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -209,19 +212,20 @@ :: Int -- ^ 'arrsResponseStatus' -> AssumeRoleResponse assumeRoleResponse pResponseStatus_ =- AssumeRoleResponse'- { _arrsPackedPolicySize = Nothing- , _arrsCredentials = Nothing- , _arrsAssumedRoleUser = Nothing- , _arrsResponseStatus = pResponseStatus_- }+ AssumeRoleResponse'+ { _arrsPackedPolicySize = Nothing+ , _arrsCredentials = Nothing+ , _arrsAssumedRoleUser = Nothing+ , _arrsResponseStatus = pResponseStatus_+ } + -- | A percentage value that indicates the size of the policy in packed form. The service rejects any policy with a packed size greater than 100 percent, which means the policy exceeded the allowed space. arrsPackedPolicySize :: Lens' AssumeRoleResponse (Maybe Natural) arrsPackedPolicySize = lens _arrsPackedPolicySize (\ s a -> s{_arrsPackedPolicySize = a}) . mapping _Nat; -- | The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token. __Note:__ The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.-arrsCredentials :: Lens' AssumeRoleResponse (Maybe Credentials)+arrsCredentials :: Lens' AssumeRoleResponse (Maybe AuthEnv) arrsCredentials = lens _arrsCredentials (\ s a -> s{_arrsCredentials = a}); -- | The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you can use to refer to the resulting temporary security credentials. For example, you can reference these credentials as a principal in a resource-based policy by using the ARN or assumed role ID. The ARN and ID include the @RoleSessionName@ that you specified when you called @AssumeRole@ .@@ -232,4 +236,4 @@ arrsResponseStatus :: Lens' AssumeRoleResponse Int arrsResponseStatus = lens _arrsResponseStatus (\ s a -> s{_arrsResponseStatus = a}); -instance NFData AssumeRoleResponse+instance NFData AssumeRoleResponse where
gen/Network/AWS/STS/AssumeRoleWithSAML.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.AssumeRoleWithSAML--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -74,22 +74,23 @@ , arwsamlrsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'assumeRoleWithSAML' smart constructor. data AssumeRoleWithSAML = AssumeRoleWithSAML'- { _arwsamlDurationSeconds :: !(Maybe Nat)- , _arwsamlPolicy :: !(Maybe Text)- , _arwsamlRoleARN :: !Text- , _arwsamlPrincipalARN :: !Text- , _arwsamlSAMLAssertion :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arwsamlDurationSeconds :: !(Maybe Nat)+ , _arwsamlPolicy :: !(Maybe Text)+ , _arwsamlRoleARN :: !Text+ , _arwsamlPrincipalARN :: !Text+ , _arwsamlSAMLAssertion :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRoleWithSAML' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -109,14 +110,15 @@ -> Text -- ^ 'arwsamlSAMLAssertion' -> AssumeRoleWithSAML assumeRoleWithSAML pRoleARN_ pPrincipalARN_ pSAMLAssertion_ =- AssumeRoleWithSAML'- { _arwsamlDurationSeconds = Nothing- , _arwsamlPolicy = Nothing- , _arwsamlRoleARN = pRoleARN_- , _arwsamlPrincipalARN = pPrincipalARN_- , _arwsamlSAMLAssertion = pSAMLAssertion_- }+ AssumeRoleWithSAML'+ { _arwsamlDurationSeconds = Nothing+ , _arwsamlPolicy = Nothing+ , _arwsamlRoleARN = pRoleARN_+ , _arwsamlPrincipalARN = pPrincipalARN_+ , _arwsamlSAMLAssertion = pSAMLAssertion_+ } + -- | The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's @SessionNotOnOrAfter@ value. The actual expiration time is whichever value is shorter. arwsamlDurationSeconds :: Lens' AssumeRoleWithSAML (Maybe Natural) arwsamlDurationSeconds = lens _arwsamlDurationSeconds (\ s a -> s{_arwsamlDurationSeconds = a}) . mapping _Nat;@@ -154,9 +156,9 @@ <*> (x .@? "Issuer") <*> (pure (fromEnum s))) -instance Hashable AssumeRoleWithSAML+instance Hashable AssumeRoleWithSAML where -instance NFData AssumeRoleWithSAML+instance NFData AssumeRoleWithSAML where instance ToHeaders AssumeRoleWithSAML where toHeaders = const mempty@@ -181,17 +183,18 @@ -- -- /See:/ 'assumeRoleWithSAMLResponse' smart constructor. data AssumeRoleWithSAMLResponse = AssumeRoleWithSAMLResponse'- { _arwsamlrsSubject :: !(Maybe Text)- , _arwsamlrsAudience :: !(Maybe Text)- , _arwsamlrsPackedPolicySize :: !(Maybe Nat)- , _arwsamlrsCredentials :: !(Maybe Credentials)- , _arwsamlrsSubjectType :: !(Maybe Text)- , _arwsamlrsNameQualifier :: !(Maybe Text)- , _arwsamlrsAssumedRoleUser :: !(Maybe AssumedRoleUser)- , _arwsamlrsIssuer :: !(Maybe Text)- , _arwsamlrsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arwsamlrsSubject :: !(Maybe Text)+ , _arwsamlrsAudience :: !(Maybe Text)+ , _arwsamlrsPackedPolicySize :: !(Maybe Nat)+ , _arwsamlrsCredentials :: !(Maybe AuthEnv)+ , _arwsamlrsSubjectType :: !(Maybe Text)+ , _arwsamlrsNameQualifier :: !(Maybe Text)+ , _arwsamlrsAssumedRoleUser :: !(Maybe AssumedRoleUser)+ , _arwsamlrsIssuer :: !(Maybe Text)+ , _arwsamlrsResponseStatus :: !Int+ } deriving (Eq, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRoleWithSAMLResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -217,18 +220,19 @@ :: Int -- ^ 'arwsamlrsResponseStatus' -> AssumeRoleWithSAMLResponse assumeRoleWithSAMLResponse pResponseStatus_ =- AssumeRoleWithSAMLResponse'- { _arwsamlrsSubject = Nothing- , _arwsamlrsAudience = Nothing- , _arwsamlrsPackedPolicySize = Nothing- , _arwsamlrsCredentials = Nothing- , _arwsamlrsSubjectType = Nothing- , _arwsamlrsNameQualifier = Nothing- , _arwsamlrsAssumedRoleUser = Nothing- , _arwsamlrsIssuer = Nothing- , _arwsamlrsResponseStatus = pResponseStatus_- }+ AssumeRoleWithSAMLResponse'+ { _arwsamlrsSubject = Nothing+ , _arwsamlrsAudience = Nothing+ , _arwsamlrsPackedPolicySize = Nothing+ , _arwsamlrsCredentials = Nothing+ , _arwsamlrsSubjectType = Nothing+ , _arwsamlrsNameQualifier = Nothing+ , _arwsamlrsAssumedRoleUser = Nothing+ , _arwsamlrsIssuer = Nothing+ , _arwsamlrsResponseStatus = pResponseStatus_+ } + -- | The value of the @NameID@ element in the @Subject@ element of the SAML assertion. arwsamlrsSubject :: Lens' AssumeRoleWithSAMLResponse (Maybe Text) arwsamlrsSubject = lens _arwsamlrsSubject (\ s a -> s{_arwsamlrsSubject = a});@@ -242,7 +246,7 @@ arwsamlrsPackedPolicySize = lens _arwsamlrsPackedPolicySize (\ s a -> s{_arwsamlrsPackedPolicySize = a}) . mapping _Nat; -- | The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token. __Note:__ The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.-arwsamlrsCredentials :: Lens' AssumeRoleWithSAMLResponse (Maybe Credentials)+arwsamlrsCredentials :: Lens' AssumeRoleWithSAMLResponse (Maybe AuthEnv) arwsamlrsCredentials = lens _arwsamlrsCredentials (\ s a -> s{_arwsamlrsCredentials = a}); -- | The format of the name ID, as defined by the @Format@ attribute in the @NameID@ element of the SAML assertion. Typical examples of the format are @transient@ or @persistent@ . If the format includes the prefix @urn:oasis:names:tc:SAML:2.0:nameid-format@ , that prefix is removed. For example, @urn:oasis:names:tc:SAML:2.0:nameid-format:transient@ is returned as @transient@ . If the format includes any other prefix, the format is returned with no modifications.@@ -265,4 +269,4 @@ arwsamlrsResponseStatus :: Lens' AssumeRoleWithSAMLResponse Int arwsamlrsResponseStatus = lens _arwsamlrsResponseStatus (\ s a -> s{_arwsamlrsResponseStatus = a}); -instance NFData AssumeRoleWithSAMLResponse+instance NFData AssumeRoleWithSAMLResponse where
gen/Network/AWS/STS/AssumeRoleWithWebIdentity.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.AssumeRoleWithWebIdentity--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -37,7 +37,7 @@ -- -- For more information about how to use web identity federation and the @AssumeRoleWithWebIdentity@ API, see the following resources: ----- * <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual Using Web Identity Federation APIs for Mobile Apps> and <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity Federation Through a Web-based Identity Provider> .+-- * <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html Using Web Identity Federation APIs for Mobile Apps> and <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity Federation Through a Web-based Identity Provider> . -- -- * <https://web-identity-federation-playground.s3.amazonaws.com/index.html Web Identity Federation Playground> . This interactive website lets you walk through the process of authenticating via Login with Amazon, Facebook, or Google, getting temporary security credentials, and then using those credentials to make a request to AWS. --@@ -73,23 +73,24 @@ , arwwirsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'assumeRoleWithWebIdentity' smart constructor. data AssumeRoleWithWebIdentity = AssumeRoleWithWebIdentity'- { _arwwiProviderId :: !(Maybe Text)- , _arwwiDurationSeconds :: !(Maybe Nat)- , _arwwiPolicy :: !(Maybe Text)- , _arwwiRoleARN :: !Text- , _arwwiRoleSessionName :: !Text- , _arwwiWebIdentityToken :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arwwiProviderId :: !(Maybe Text)+ , _arwwiDurationSeconds :: !(Maybe Nat)+ , _arwwiPolicy :: !(Maybe Text)+ , _arwwiRoleARN :: !Text+ , _arwwiRoleSessionName :: !Text+ , _arwwiWebIdentityToken :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRoleWithWebIdentity' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -102,7 +103,7 @@ -- -- * 'arwwiRoleARN' - The Amazon Resource Name (ARN) of the role that the caller is assuming. ----- * 'arwwiRoleSessionName' - An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the @AssumedRoleUser@ response element. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- * 'arwwiRoleSessionName' - An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the @AssumedRoleUser@ response element. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- -- -- * 'arwwiWebIdentityToken' - The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity provider. Your application must get this token by authenticating the user who is using your application with a web identity provider before the application makes an @AssumeRoleWithWebIdentity@ call. assumeRoleWithWebIdentity@@ -111,15 +112,16 @@ -> Text -- ^ 'arwwiWebIdentityToken' -> AssumeRoleWithWebIdentity assumeRoleWithWebIdentity pRoleARN_ pRoleSessionName_ pWebIdentityToken_ =- AssumeRoleWithWebIdentity'- { _arwwiProviderId = Nothing- , _arwwiDurationSeconds = Nothing- , _arwwiPolicy = Nothing- , _arwwiRoleARN = pRoleARN_- , _arwwiRoleSessionName = pRoleSessionName_- , _arwwiWebIdentityToken = pWebIdentityToken_- }+ AssumeRoleWithWebIdentity'+ { _arwwiProviderId = Nothing+ , _arwwiDurationSeconds = Nothing+ , _arwwiPolicy = Nothing+ , _arwwiRoleARN = pRoleARN_+ , _arwwiRoleSessionName = pRoleSessionName_+ , _arwwiWebIdentityToken = pWebIdentityToken_+ } + -- | The fully qualified host component of the domain name of the identity provider. Specify this value only for OAuth 2.0 access tokens. Currently @www.amazon.com@ and @graph.facebook.com@ are the only supported identity providers for OAuth 2.0 access tokens. Do not include URL schemes and port numbers. Do not specify this value for OpenID Connect ID tokens. arwwiProviderId :: Lens' AssumeRoleWithWebIdentity (Maybe Text) arwwiProviderId = lens _arwwiProviderId (\ s a -> s{_arwwiProviderId = a});@@ -136,7 +138,7 @@ arwwiRoleARN :: Lens' AssumeRoleWithWebIdentity Text arwwiRoleARN = lens _arwwiRoleARN (\ s a -> s{_arwwiRoleARN = a}); --- | An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the @AssumedRoleUser@ response element. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- | An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the @AssumedRoleUser@ response element. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- arwwiRoleSessionName :: Lens' AssumeRoleWithWebIdentity Text arwwiRoleSessionName = lens _arwwiRoleSessionName (\ s a -> s{_arwwiRoleSessionName = a}); @@ -160,9 +162,9 @@ <*> (x .@? "Provider") <*> (pure (fromEnum s))) -instance Hashable AssumeRoleWithWebIdentity+instance Hashable AssumeRoleWithWebIdentity where -instance NFData AssumeRoleWithWebIdentity+instance NFData AssumeRoleWithWebIdentity where instance ToHeaders AssumeRoleWithWebIdentity where toHeaders = const mempty@@ -188,15 +190,16 @@ -- -- /See:/ 'assumeRoleWithWebIdentityResponse' smart constructor. data AssumeRoleWithWebIdentityResponse = AssumeRoleWithWebIdentityResponse'- { _arwwirsAudience :: !(Maybe Text)- , _arwwirsSubjectFromWebIdentityToken :: !(Maybe Text)- , _arwwirsPackedPolicySize :: !(Maybe Nat)- , _arwwirsCredentials :: !(Maybe Credentials)- , _arwwirsAssumedRoleUser :: !(Maybe AssumedRoleUser)- , _arwwirsProvider :: !(Maybe Text)- , _arwwirsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _arwwirsAudience :: !(Maybe Text)+ , _arwwirsSubjectFromWebIdentityToken :: !(Maybe Text)+ , _arwwirsPackedPolicySize :: !(Maybe Nat)+ , _arwwirsCredentials :: !(Maybe AuthEnv)+ , _arwwirsAssumedRoleUser :: !(Maybe AssumedRoleUser)+ , _arwwirsProvider :: !(Maybe Text)+ , _arwwirsResponseStatus :: !Int+ } deriving (Eq, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumeRoleWithWebIdentityResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -218,16 +221,17 @@ :: Int -- ^ 'arwwirsResponseStatus' -> AssumeRoleWithWebIdentityResponse assumeRoleWithWebIdentityResponse pResponseStatus_ =- AssumeRoleWithWebIdentityResponse'- { _arwwirsAudience = Nothing- , _arwwirsSubjectFromWebIdentityToken = Nothing- , _arwwirsPackedPolicySize = Nothing- , _arwwirsCredentials = Nothing- , _arwwirsAssumedRoleUser = Nothing- , _arwwirsProvider = Nothing- , _arwwirsResponseStatus = pResponseStatus_- }+ AssumeRoleWithWebIdentityResponse'+ { _arwwirsAudience = Nothing+ , _arwwirsSubjectFromWebIdentityToken = Nothing+ , _arwwirsPackedPolicySize = Nothing+ , _arwwirsCredentials = Nothing+ , _arwwirsAssumedRoleUser = Nothing+ , _arwwirsProvider = Nothing+ , _arwwirsResponseStatus = pResponseStatus_+ } + -- | The intended audience (also known as client ID) of the web identity token. This is traditionally the client identifier issued to the application that requested the web identity token. arwwirsAudience :: Lens' AssumeRoleWithWebIdentityResponse (Maybe Text) arwwirsAudience = lens _arwwirsAudience (\ s a -> s{_arwwirsAudience = a});@@ -241,7 +245,7 @@ arwwirsPackedPolicySize = lens _arwwirsPackedPolicySize (\ s a -> s{_arwwirsPackedPolicySize = a}) . mapping _Nat; -- | The temporary security credentials, which include an access key ID, a secret access key, and a security token. __Note:__ The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.-arwwirsCredentials :: Lens' AssumeRoleWithWebIdentityResponse (Maybe Credentials)+arwwirsCredentials :: Lens' AssumeRoleWithWebIdentityResponse (Maybe AuthEnv) arwwirsCredentials = lens _arwwirsCredentials (\ s a -> s{_arwwirsCredentials = a}); -- | The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you can use to refer to the resulting temporary security credentials. For example, you can reference these credentials as a principal in a resource-based policy by using the ARN or assumed role ID. The ARN and ID include the @RoleSessionName@ that you specified when you called @AssumeRole@ .@@ -257,3 +261,4 @@ arwwirsResponseStatus = lens _arwwirsResponseStatus (\ s a -> s{_arwwirsResponseStatus = a}); instance NFData AssumeRoleWithWebIdentityResponse+ where
gen/Network/AWS/STS/DecodeAuthorizationMessage.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.DecodeAuthorizationMessage--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -55,18 +55,19 @@ , damrsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'decodeAuthorizationMessage' smart constructor. newtype DecodeAuthorizationMessage = DecodeAuthorizationMessage'- { _damEncodedMessage :: Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _damEncodedMessage :: Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'DecodeAuthorizationMessage' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -76,10 +77,9 @@ :: Text -- ^ 'damEncodedMessage' -> DecodeAuthorizationMessage decodeAuthorizationMessage pEncodedMessage_ =- DecodeAuthorizationMessage'- { _damEncodedMessage = pEncodedMessage_- }+ DecodeAuthorizationMessage' {_damEncodedMessage = pEncodedMessage_} + -- | The encoded message that was returned with the response. damEncodedMessage :: Lens' DecodeAuthorizationMessage Text damEncodedMessage = lens _damEncodedMessage (\ s a -> s{_damEncodedMessage = a});@@ -95,9 +95,9 @@ DecodeAuthorizationMessageResponse' <$> (x .@? "DecodedMessage") <*> (pure (fromEnum s))) -instance Hashable DecodeAuthorizationMessage+instance Hashable DecodeAuthorizationMessage where -instance NFData DecodeAuthorizationMessage+instance NFData DecodeAuthorizationMessage where instance ToHeaders DecodeAuthorizationMessage where toHeaders = const mempty@@ -119,10 +119,11 @@ -- -- /See:/ 'decodeAuthorizationMessageResponse' smart constructor. data DecodeAuthorizationMessageResponse = DecodeAuthorizationMessageResponse'- { _damrsDecodedMessage :: !(Maybe Text)- , _damrsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _damrsDecodedMessage :: !(Maybe Text)+ , _damrsResponseStatus :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'DecodeAuthorizationMessageResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -134,11 +135,10 @@ :: Int -- ^ 'damrsResponseStatus' -> DecodeAuthorizationMessageResponse decodeAuthorizationMessageResponse pResponseStatus_ =- DecodeAuthorizationMessageResponse'- { _damrsDecodedMessage = Nothing- , _damrsResponseStatus = pResponseStatus_- }+ DecodeAuthorizationMessageResponse'+ {_damrsDecodedMessage = Nothing, _damrsResponseStatus = pResponseStatus_} + -- | An XML document that contains the decoded message. damrsDecodedMessage :: Lens' DecodeAuthorizationMessageResponse (Maybe Text) damrsDecodedMessage = lens _damrsDecodedMessage (\ s a -> s{_damrsDecodedMessage = a});@@ -148,3 +148,4 @@ damrsResponseStatus = lens _damrsResponseStatus (\ s a -> s{_damrsResponseStatus = a}); instance NFData DecodeAuthorizationMessageResponse+ where
gen/Network/AWS/STS/GetCallerIdentity.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.GetCallerIdentity--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -37,24 +37,26 @@ , gcirsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'getCallerIdentity' smart constructor. data GetCallerIdentity =- GetCallerIdentity'- deriving (Eq,Read,Show,Data,Typeable,Generic)+ GetCallerIdentity'+ deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetCallerIdentity' with the minimum fields required to make a request. -- getCallerIdentity :: GetCallerIdentity getCallerIdentity = GetCallerIdentity' + instance AWSRequest GetCallerIdentity where type Rs GetCallerIdentity = GetCallerIdentityResponse request = postQuery sts@@ -66,9 +68,9 @@ (x .@? "UserId") <*> (pure (fromEnum s))) -instance Hashable GetCallerIdentity+instance Hashable GetCallerIdentity where -instance NFData GetCallerIdentity+instance NFData GetCallerIdentity where instance ToHeaders GetCallerIdentity where toHeaders = const mempty@@ -89,12 +91,13 @@ -- -- /See:/ 'getCallerIdentityResponse' smart constructor. data GetCallerIdentityResponse = GetCallerIdentityResponse'- { _gcirsARN :: !(Maybe Text)- , _gcirsAccount :: !(Maybe Text)- , _gcirsUserId :: !(Maybe Text)- , _gcirsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _gcirsARN :: !(Maybe Text)+ , _gcirsAccount :: !(Maybe Text)+ , _gcirsUserId :: !(Maybe Text)+ , _gcirsResponseStatus :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetCallerIdentityResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -110,13 +113,14 @@ :: Int -- ^ 'gcirsResponseStatus' -> GetCallerIdentityResponse getCallerIdentityResponse pResponseStatus_ =- GetCallerIdentityResponse'- { _gcirsARN = Nothing- , _gcirsAccount = Nothing- , _gcirsUserId = Nothing- , _gcirsResponseStatus = pResponseStatus_- }+ GetCallerIdentityResponse'+ { _gcirsARN = Nothing+ , _gcirsAccount = Nothing+ , _gcirsUserId = Nothing+ , _gcirsResponseStatus = pResponseStatus_+ } + -- | The AWS ARN associated with the calling entity. gcirsARN :: Lens' GetCallerIdentityResponse (Maybe Text) gcirsARN = lens _gcirsARN (\ s a -> s{_gcirsARN = a});@@ -133,4 +137,4 @@ gcirsResponseStatus :: Lens' GetCallerIdentityResponse Int gcirsResponseStatus = lens _gcirsResponseStatus (\ s a -> s{_gcirsResponseStatus = a}); -instance NFData GetCallerIdentityResponse+instance NFData GetCallerIdentityResponse where
gen/Network/AWS/STS/GetFederationToken.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.GetFederationToken--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -29,7 +29,7 @@ -- -- * You cannot use these credentials to call any IAM APIs. ----- * You cannot call any STS APIs.+-- * You cannot call any STS APIs except @GetCallerIdentity@ . -- -- --@@ -71,20 +71,21 @@ , gftrsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'getFederationToken' smart constructor. data GetFederationToken = GetFederationToken'- { _gftDurationSeconds :: !(Maybe Nat)- , _gftPolicy :: !(Maybe Text)- , _gftName :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _gftDurationSeconds :: !(Maybe Nat)+ , _gftPolicy :: !(Maybe Text)+ , _gftName :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetFederationToken' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -93,17 +94,15 @@ -- -- * 'gftPolicy' - An IAM policy in JSON format that is passed with the @GetFederationToken@ call and evaluated along with the policy or policies that are attached to the IAM user whose credentials are used to call @GetFederationToken@ . The passed policy is used to scope down the permissions that are available to the IAM user, by allowing only a subset of the permissions that are granted to the IAM user. The passed policy cannot grant more permissions than those granted to the IAM user. The final permissions for the federated user are the most restrictive set based on the intersection of the passed policy and the IAM user policy. If you do not pass a policy, the resulting temporary security credentials have no effective permissions. The only exception is when the temporary security credentials are used to access a resource that has a resource-based policy that specifically allows the federated user to access the resource. The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters. For more information about how permissions work, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html Permissions for GetFederationToken> . ----- * 'gftName' - The name of the federated user. The name is used as an identifier for the temporary security credentials (such as @Bob@ ). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- * 'gftName' - The name of the federated user. The name is used as an identifier for the temporary security credentials (such as @Bob@ ). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- getFederationToken :: Text -- ^ 'gftName' -> GetFederationToken getFederationToken pName_ =- GetFederationToken'- { _gftDurationSeconds = Nothing- , _gftPolicy = Nothing- , _gftName = pName_- }+ GetFederationToken'+ {_gftDurationSeconds = Nothing, _gftPolicy = Nothing, _gftName = pName_} + -- | The duration, in seconds, that the session should last. Acceptable durations for federation sessions range from 900 seconds (15 minutes) to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained using AWS account (root) credentials are restricted to a maximum of 3600 seconds (one hour). If the specified duration is longer than one hour, the session obtained by using AWS account (root) credentials defaults to one hour. gftDurationSeconds :: Lens' GetFederationToken (Maybe Natural) gftDurationSeconds = lens _gftDurationSeconds (\ s a -> s{_gftDurationSeconds = a}) . mapping _Nat;@@ -112,7 +111,7 @@ gftPolicy :: Lens' GetFederationToken (Maybe Text) gftPolicy = lens _gftPolicy (\ s a -> s{_gftPolicy = a}); --- | The name of the federated user. The name is used as an identifier for the temporary security credentials (such as @Bob@ ). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- | The name of the federated user. The name is used as an identifier for the temporary security credentials (such as @Bob@ ). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@- gftName :: Lens' GetFederationToken Text gftName = lens _gftName (\ s a -> s{_gftName = a}); @@ -128,9 +127,9 @@ <*> (x .@? "FederatedUser") <*> (pure (fromEnum s))) -instance Hashable GetFederationToken+instance Hashable GetFederationToken where -instance NFData GetFederationToken+instance NFData GetFederationToken where instance ToHeaders GetFederationToken where toHeaders = const mempty@@ -152,12 +151,13 @@ -- -- /See:/ 'getFederationTokenResponse' smart constructor. data GetFederationTokenResponse = GetFederationTokenResponse'- { _gftrsPackedPolicySize :: !(Maybe Nat)- , _gftrsCredentials :: !(Maybe Credentials)- , _gftrsFederatedUser :: !(Maybe FederatedUser)- , _gftrsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _gftrsPackedPolicySize :: !(Maybe Nat)+ , _gftrsCredentials :: !(Maybe AuthEnv)+ , _gftrsFederatedUser :: !(Maybe FederatedUser)+ , _gftrsResponseStatus :: !Int+ } deriving (Eq, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetFederationTokenResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -173,19 +173,20 @@ :: Int -- ^ 'gftrsResponseStatus' -> GetFederationTokenResponse getFederationTokenResponse pResponseStatus_ =- GetFederationTokenResponse'- { _gftrsPackedPolicySize = Nothing- , _gftrsCredentials = Nothing- , _gftrsFederatedUser = Nothing- , _gftrsResponseStatus = pResponseStatus_- }+ GetFederationTokenResponse'+ { _gftrsPackedPolicySize = Nothing+ , _gftrsCredentials = Nothing+ , _gftrsFederatedUser = Nothing+ , _gftrsResponseStatus = pResponseStatus_+ } + -- | A percentage value indicating the size of the policy in packed form. The service rejects policies for which the packed size is greater than 100 percent of the allowed value. gftrsPackedPolicySize :: Lens' GetFederationTokenResponse (Maybe Natural) gftrsPackedPolicySize = lens _gftrsPackedPolicySize (\ s a -> s{_gftrsPackedPolicySize = a}) . mapping _Nat; -- | The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token. __Note:__ The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.-gftrsCredentials :: Lens' GetFederationTokenResponse (Maybe Credentials)+gftrsCredentials :: Lens' GetFederationTokenResponse (Maybe AuthEnv) gftrsCredentials = lens _gftrsCredentials (\ s a -> s{_gftrsCredentials = a}); -- | Identifiers for the federated user associated with the credentials (such as @arn:aws:sts::123456789012:federated-user/Bob@ or @123456789012:Bob@ ). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.@@ -196,4 +197,4 @@ gftrsResponseStatus :: Lens' GetFederationTokenResponse Int gftrsResponseStatus = lens _gftrsResponseStatus (\ s a -> s{_gftrsResponseStatus = a}); -instance NFData GetFederationTokenResponse+instance NFData GetFederationTokenResponse where
gen/Network/AWS/STS/GetSessionToken.hs view
@@ -12,9 +12,9 @@ -- | -- Module : Network.AWS.STS.GetSessionToken--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -27,7 +27,7 @@ -- -- * You cannot call any IAM APIs unless MFA authentication information is included in the request. ----- * You cannot call any STS API /except/ @AssumeRole@ .+-- * You cannot call any STS API /except/ @AssumeRole@ or @GetCallerIdentity@ . -- -- --@@ -53,20 +53,21 @@ , gstrsResponseStatus ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Request-import Network.AWS.Response-import Network.AWS.STS.Types-import Network.AWS.STS.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.STS.Types+import Network.AWS.STS.Types.Product -- | /See:/ 'getSessionToken' smart constructor. data GetSessionToken = GetSessionToken'- { _gstTokenCode :: !(Maybe Text)- , _gstDurationSeconds :: !(Maybe Nat)- , _gstSerialNumber :: !(Maybe Text)- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _gstTokenCode :: !(Maybe Text)+ , _gstDurationSeconds :: !(Maybe Nat)+ , _gstSerialNumber :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetSessionToken' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -75,16 +76,17 @@ -- -- * 'gstDurationSeconds' - The duration, in seconds, that the credentials should remain valid. Acceptable durations for IAM user sessions range from 900 seconds (15 minutes) to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions for AWS account owners are restricted to a maximum of 3600 seconds (one hour). If the duration is longer than one hour, the session for AWS account owners defaults to one hour. ----- * 'gstSerialNumber' - The identification number of the MFA device that is associated with the IAM user who is making the @GetSessionToken@ call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- * 'gstSerialNumber' - The identification number of the MFA device that is associated with the IAM user who is making the @GetSessionToken@ call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials. The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/- getSessionToken :: GetSessionToken getSessionToken =- GetSessionToken'- { _gstTokenCode = Nothing- , _gstDurationSeconds = Nothing- , _gstSerialNumber = Nothing- }+ GetSessionToken'+ { _gstTokenCode = Nothing+ , _gstDurationSeconds = Nothing+ , _gstSerialNumber = Nothing+ } + -- | The value provided by the MFA device, if MFA is required. If any policy requires the IAM user to submit an MFA code, specify this value. If MFA authentication is required, and the user does not provide a code when requesting a set of temporary security credentials, the user will receive an "access denied" response when requesting resources that require MFA authentication. The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits. gstTokenCode :: Lens' GetSessionToken (Maybe Text) gstTokenCode = lens _gstTokenCode (\ s a -> s{_gstTokenCode = a});@@ -93,7 +95,7 @@ gstDurationSeconds :: Lens' GetSessionToken (Maybe Natural) gstDurationSeconds = lens _gstDurationSeconds (\ s a -> s{_gstDurationSeconds = a}) . mapping _Nat; --- | The identification number of the MFA device that is associated with the IAM user who is making the @GetSessionToken@ call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials. The format for this parameter, as described by its regex pattern, is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-+-- | The identification number of the MFA device that is associated with the IAM user who is making the @GetSessionToken@ call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as @GAHT12345678@ ) or an Amazon Resource Name (ARN) for a virtual device (such as @arn:aws:iam::123456789012:mfa/user@ ). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials. The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/- gstSerialNumber :: Lens' GetSessionToken (Maybe Text) gstSerialNumber = lens _gstSerialNumber (\ s a -> s{_gstSerialNumber = a}); @@ -106,9 +108,9 @@ GetSessionTokenResponse' <$> (x .@? "Credentials") <*> (pure (fromEnum s))) -instance Hashable GetSessionToken+instance Hashable GetSessionToken where -instance NFData GetSessionToken+instance NFData GetSessionToken where instance ToHeaders GetSessionToken where toHeaders = const mempty@@ -131,10 +133,11 @@ -- -- /See:/ 'getSessionTokenResponse' smart constructor. data GetSessionTokenResponse = GetSessionTokenResponse'- { _gstrsCredentials :: !(Maybe Credentials)- , _gstrsResponseStatus :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _gstrsCredentials :: !(Maybe AuthEnv)+ , _gstrsResponseStatus :: !Int+ } deriving (Eq, Show, Data, Typeable, Generic) + -- | Creates a value of 'GetSessionTokenResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -146,17 +149,16 @@ :: Int -- ^ 'gstrsResponseStatus' -> GetSessionTokenResponse getSessionTokenResponse pResponseStatus_ =- GetSessionTokenResponse'- { _gstrsCredentials = Nothing- , _gstrsResponseStatus = pResponseStatus_- }+ GetSessionTokenResponse'+ {_gstrsCredentials = Nothing, _gstrsResponseStatus = pResponseStatus_} + -- | The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token. __Note:__ The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.-gstrsCredentials :: Lens' GetSessionTokenResponse (Maybe Credentials)+gstrsCredentials :: Lens' GetSessionTokenResponse (Maybe AuthEnv) gstrsCredentials = lens _gstrsCredentials (\ s a -> s{_gstrsCredentials = a}); -- | -- | The response status code. gstrsResponseStatus :: Lens' GetSessionTokenResponse Int gstrsResponseStatus = lens _gstrsResponseStatus (\ s a -> s{_gstrsResponseStatus = a}); -instance NFData GetSessionTokenResponse+instance NFData GetSessionTokenResponse where
gen/Network/AWS/STS/Types.hs view
@@ -4,9 +4,9 @@ -- | -- Module : Network.AWS.STS.Types--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --@@ -31,14 +31,6 @@ , aruAssumedRoleId , aruARN - -- * Credentials- , Credentials- , credentials- , cAccessKeyId- , cSecretAccessKey- , cSessionToken- , cExpiration- -- * FederatedUser , FederatedUser , federatedUser@@ -46,38 +38,40 @@ , fuARN ) where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.Sign.V4-import Network.AWS.STS.Types.Product-import Network.AWS.STS.Types.Sum+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Sign.V4+import Network.AWS.STS.Types.Product+import Network.AWS.STS.Types.Sum -- | API version @2011-06-15@ of the Amazon Security Token Service SDK configuration. sts :: Service sts =- Service- { _svcAbbrev = "STS"- , _svcSigner = v4- , _svcPrefix = "sts"- , _svcVersion = "2011-06-15"- , _svcEndpoint = defaultEndpoint sts- , _svcTimeout = Just 70- , _svcCheck = statusSuccess- , _svcError = parseXMLError "STS"- , _svcRetry = retry- }+ Service+ { _svcAbbrev = "STS"+ , _svcSigner = v4+ , _svcPrefix = "sts"+ , _svcVersion = "2011-06-15"+ , _svcEndpoint = defaultEndpoint sts+ , _svcTimeout = Just 70+ , _svcCheck = statusSuccess+ , _svcError = parseXMLError "STS"+ , _svcRetry = retry+ } where retry =- Exponential- { _retryBase = 5.0e-2- , _retryGrowth = 2- , _retryAttempts = 5- , _retryCheck = check- }+ Exponential+ { _retryBase = 5.0e-2+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ } check e+ | has (hasCode "ThrottledException" . hasStatus 400) e =+ Just "throttled_exception" | has (hasStatus 429) e = Just "too_many_requests" | has (hasCode "ThrottlingException" . hasStatus 400) e =- Just "throttling_exception"+ Just "throttling_exception" | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling" | has (hasStatus 504) e = Just "gateway_timeout" | has (hasStatus 502) e = Just "bad_gateway"@@ -86,56 +80,63 @@ | has (hasStatus 509) e = Just "limit_exceeded" | otherwise = Nothing + -- | The request was rejected because the policy document was malformed. The error message describes the specific error. -- -- _MalformedPolicyDocumentException :: AsError a => Getting (First ServiceError) a ServiceError _MalformedPolicyDocumentException =- _ServiceError . hasStatus 400 . hasCode "MalformedPolicyDocument"+ _MatchServiceError sts "MalformedPolicyDocument" . hasStatus 400 + -- | The error returned if the message passed to @DecodeAuthorizationMessage@ was invalid. This can happen if the token contains invalid characters, such as linebreaks. -- -- _InvalidAuthorizationMessageException :: AsError a => Getting (First ServiceError) a ServiceError _InvalidAuthorizationMessageException =- _ServiceError .- hasStatus 400 . hasCode "InvalidAuthorizationMessageException"+ _MatchServiceError sts "InvalidAuthorizationMessageException" . hasStatus 400 + -- | The request was rejected because the policy document was too large. The error message describes how big the policy document is, in packed form, as a percentage of what the API allows. -- -- _PackedPolicyTooLargeException :: AsError a => Getting (First ServiceError) a ServiceError _PackedPolicyTooLargeException =- _ServiceError . hasStatus 400 . hasCode "PackedPolicyTooLarge"+ _MatchServiceError sts "PackedPolicyTooLarge" . hasStatus 400 + -- | STS is not activated in the requested region for the account that is being asked to generate credentials. The account administrator must use the IAM console to activate STS in that region. For more information, see <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html Activating and Deactivating AWS STS in an AWS Region> in the /IAM User Guide/ . -- -- _RegionDisabledException :: AsError a => Getting (First ServiceError) a ServiceError _RegionDisabledException =- _ServiceError . hasStatus 403 . hasCode "RegionDisabledException"+ _MatchServiceError sts "RegionDisabledException" . hasStatus 403 + -- | The request could not be fulfilled because the non-AWS identity provider (IDP) that was asked to verify the incoming identity token could not be reached. This is often a transient error caused by network conditions. Retry the request a limited number of times so that you don't exceed the request rate. If the error persists, the non-AWS identity provider might be down or not responding. -- -- _IdPCommunicationErrorException :: AsError a => Getting (First ServiceError) a ServiceError _IdPCommunicationErrorException =- _ServiceError . hasStatus 400 . hasCode "IDPCommunicationError"+ _MatchServiceError sts "IDPCommunicationError" . hasStatus 400 + -- | The web identity token that was passed could not be validated by AWS. Get a new identity token from the identity provider and then retry the request. -- -- _InvalidIdentityTokenException :: AsError a => Getting (First ServiceError) a ServiceError _InvalidIdentityTokenException =- _ServiceError . hasStatus 400 . hasCode "InvalidIdentityToken"+ _MatchServiceError sts "InvalidIdentityToken" . hasStatus 400 + -- | The web identity token that was passed is expired or is not valid. Get a new identity token from the identity provider and then retry the request. -- -- _ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError _ExpiredTokenException =- _ServiceError . hasStatus 400 . hasCode "ExpiredTokenException"+ _MatchServiceError sts "ExpiredTokenException" . hasStatus 400 + -- | The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid. -- --@@ -143,4 +144,5 @@ -- _IdPRejectedClaimException :: AsError a => Getting (First ServiceError) a ServiceError _IdPRejectedClaimException =- _ServiceError . hasStatus 403 . hasCode "IDPRejectedClaim"+ _MatchServiceError sts "IDPRejectedClaim" . hasStatus 403+
gen/Network/AWS/STS/Types/Product.hs view
@@ -9,17 +9,17 @@ -- | -- Module : Network.AWS.STS.Types.Product--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Network.AWS.STS.Types.Product where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.STS.Types.Sum+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.STS.Types.Sum -- | The identifiers for the temporary security credentials that the operation returns. --@@ -27,10 +27,11 @@ -- -- /See:/ 'assumedRoleUser' smart constructor. data AssumedRoleUser = AssumedRoleUser'- { _aruAssumedRoleId :: !Text- , _aruARN :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _aruAssumedRoleId :: !Text+ , _aruARN :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'AssumedRoleUser' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -43,11 +44,9 @@ -> Text -- ^ 'aruARN' -> AssumedRoleUser assumedRoleUser pAssumedRoleId_ pARN_ =- AssumedRoleUser'- { _aruAssumedRoleId = pAssumedRoleId_- , _aruARN = pARN_- }+ AssumedRoleUser' {_aruAssumedRoleId = pAssumedRoleId_, _aruARN = pARN_} + -- | A unique identifier that contains the role ID and the role session name of the role that is being assumed. The role ID is generated by AWS when the role is created. aruAssumedRoleId :: Lens' AssumedRoleUser Text aruAssumedRoleId = lens _aruAssumedRoleId (\ s a -> s{_aruAssumedRoleId = a});@@ -61,73 +60,9 @@ = AssumedRoleUser' <$> (x .@ "AssumedRoleId") <*> (x .@ "Arn") -instance Hashable AssumedRoleUser--instance NFData AssumedRoleUser---- | AWS credentials for API authentication.------------ /See:/ 'credentials' smart constructor.-data Credentials = Credentials'- { _cAccessKeyId :: !Text- , _cSecretAccessKey :: !Text- , _cSessionToken :: !Text- , _cExpiration :: !ISO8601- } deriving (Eq,Read,Show,Data,Typeable,Generic)---- | Creates a value of 'Credentials' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'cAccessKeyId' - The access key ID that identifies the temporary security credentials.------ * 'cSecretAccessKey' - The secret access key that can be used to sign requests.------ * 'cSessionToken' - The token that users must pass to the service API to use the temporary credentials.------ * 'cExpiration' - The date on which the current credentials expire.-credentials- :: Text -- ^ 'cAccessKeyId'- -> Text -- ^ 'cSecretAccessKey'- -> Text -- ^ 'cSessionToken'- -> UTCTime -- ^ 'cExpiration'- -> Credentials-credentials pAccessKeyId_ pSecretAccessKey_ pSessionToken_ pExpiration_ =- Credentials'- { _cAccessKeyId = pAccessKeyId_- , _cSecretAccessKey = pSecretAccessKey_- , _cSessionToken = pSessionToken_- , _cExpiration = _Time # pExpiration_- }---- | The access key ID that identifies the temporary security credentials.-cAccessKeyId :: Lens' Credentials Text-cAccessKeyId = lens _cAccessKeyId (\ s a -> s{_cAccessKeyId = a});---- | The secret access key that can be used to sign requests.-cSecretAccessKey :: Lens' Credentials Text-cSecretAccessKey = lens _cSecretAccessKey (\ s a -> s{_cSecretAccessKey = a});---- | The token that users must pass to the service API to use the temporary credentials.-cSessionToken :: Lens' Credentials Text-cSessionToken = lens _cSessionToken (\ s a -> s{_cSessionToken = a});---- | The date on which the current credentials expire.-cExpiration :: Lens' Credentials UTCTime-cExpiration = lens _cExpiration (\ s a -> s{_cExpiration = a}) . _Time;--instance FromXML Credentials where- parseXML x- = Credentials' <$>- (x .@ "AccessKeyId") <*> (x .@ "SecretAccessKey") <*>- (x .@ "SessionToken")- <*> (x .@ "Expiration")--instance Hashable Credentials+instance Hashable AssumedRoleUser where -instance NFData Credentials+instance NFData AssumedRoleUser where -- | Identifiers for the federated user that is associated with the credentials. --@@ -135,10 +70,11 @@ -- -- /See:/ 'federatedUser' smart constructor. data FederatedUser = FederatedUser'- { _fuFederatedUserId :: !Text- , _fuARN :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ { _fuFederatedUserId :: !Text+ , _fuARN :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic) + -- | Creates a value of 'FederatedUser' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired:@@ -151,11 +87,9 @@ -> Text -- ^ 'fuARN' -> FederatedUser federatedUser pFederatedUserId_ pARN_ =- FederatedUser'- { _fuFederatedUserId = pFederatedUserId_- , _fuARN = pARN_- }+ FederatedUser' {_fuFederatedUserId = pFederatedUserId_, _fuARN = pARN_} + -- | The string that identifies the federated user associated with the credentials, similar to the unique ID of an IAM user. fuFederatedUserId :: Lens' FederatedUser Text fuFederatedUserId = lens _fuFederatedUserId (\ s a -> s{_fuFederatedUserId = a});@@ -169,6 +103,6 @@ = FederatedUser' <$> (x .@ "FederatedUserId") <*> (x .@ "Arn") -instance Hashable FederatedUser+instance Hashable FederatedUser where -instance NFData FederatedUser+instance NFData FederatedUser where
gen/Network/AWS/STS/Types/Sum.hs view
@@ -9,12 +9,12 @@ -- | -- Module : Network.AWS.STS.Types.Sum--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Network.AWS.STS.Types.Sum where -import Network.AWS.Prelude+import Network.AWS.Prelude
gen/Network/AWS/STS/Waiters.hs view
@@ -7,15 +7,15 @@ -- | -- Module : Network.AWS.STS.Waiters--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Network.AWS.STS.Waiters where -import Network.AWS.Lens-import Network.AWS.Prelude-import Network.AWS.STS.Types-import Network.AWS.Waiter+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.STS.Types+import Network.AWS.Waiter
test/Main.hs view
@@ -2,9 +2,9 @@ -- | -- Module : Main--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) --
test/Test/AWS/Gen/STS.hs view
@@ -5,20 +5,20 @@ -- | -- Module : Test.AWS.Gen.STS--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2017 Brendan Hay -- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Test.AWS.Gen.STS where import Data.Proxy+import Network.AWS.STS import Test.AWS.Fixture import Test.AWS.Prelude-import Test.Tasty-import Network.AWS.STS import Test.AWS.STS.Internal+import Test.Tasty -- Auto-generated: the actual test selection needs to be manually placed into -- the top-level so that real test data can be incrementally added.