| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.IoT.TestAuthorization
Description
Tests if a specified principal is authorized to perform an IoT action on a specified resource. Use this to test and debug the authorization behavior of devices that connect to the IoT device gateway.
Requires permission to access the TestAuthorization action.
Synopsis
- data TestAuthorization = TestAuthorization' {}
- newTestAuthorization :: NonEmpty AuthInfo -> TestAuthorization
- testAuthorization_clientId :: Lens' TestAuthorization (Maybe Text)
- testAuthorization_cognitoIdentityPoolId :: Lens' TestAuthorization (Maybe Text)
- testAuthorization_policyNamesToAdd :: Lens' TestAuthorization (Maybe [Text])
- testAuthorization_policyNamesToSkip :: Lens' TestAuthorization (Maybe [Text])
- testAuthorization_principal :: Lens' TestAuthorization (Maybe Text)
- testAuthorization_authInfos :: Lens' TestAuthorization (NonEmpty AuthInfo)
- data TestAuthorizationResponse = TestAuthorizationResponse' {
- authResults :: Maybe [AuthResult]
- httpStatus :: Int
- newTestAuthorizationResponse :: Int -> TestAuthorizationResponse
- testAuthorizationResponse_authResults :: Lens' TestAuthorizationResponse (Maybe [AuthResult])
- testAuthorizationResponse_httpStatus :: Lens' TestAuthorizationResponse Int
Creating a Request
data TestAuthorization Source #
See: newTestAuthorization smart constructor.
Constructors
| TestAuthorization' | |
Fields
| |
Instances
Create a value of TestAuthorization with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
TestAuthorization, testAuthorization_clientId - The MQTT client ID.
TestAuthorization, testAuthorization_cognitoIdentityPoolId - The Cognito identity pool ID.
$sel:policyNamesToAdd:TestAuthorization', testAuthorization_policyNamesToAdd - When testing custom authorization, the policies specified here are
treated as if they are attached to the principal being authorized.
$sel:policyNamesToSkip:TestAuthorization', testAuthorization_policyNamesToSkip - When testing custom authorization, the policies specified here are
treated as if they are not attached to the principal being authorized.
$sel:principal:TestAuthorization', testAuthorization_principal - The principal. Valid principals are CertificateArn
(arn:aws:iot:region:accountId:cert/certificateId), thingGroupArn
(arn:aws:iot:region:accountId:thinggroup/groupName) and CognitoId
(region:id).
$sel:authInfos:TestAuthorization', testAuthorization_authInfos - A list of authorization info objects. Simulating authorization will
create a response for each authInfo object in the list.
Request Lenses
testAuthorization_clientId :: Lens' TestAuthorization (Maybe Text) Source #
The MQTT client ID.
testAuthorization_cognitoIdentityPoolId :: Lens' TestAuthorization (Maybe Text) Source #
The Cognito identity pool ID.
testAuthorization_policyNamesToAdd :: Lens' TestAuthorization (Maybe [Text]) Source #
When testing custom authorization, the policies specified here are treated as if they are attached to the principal being authorized.
testAuthorization_policyNamesToSkip :: Lens' TestAuthorization (Maybe [Text]) Source #
When testing custom authorization, the policies specified here are treated as if they are not attached to the principal being authorized.
testAuthorization_principal :: Lens' TestAuthorization (Maybe Text) Source #
The principal. Valid principals are CertificateArn (arn:aws:iot:region:accountId:cert/certificateId), thingGroupArn (arn:aws:iot:region:accountId:thinggroup/groupName) and CognitoId (region:id).
testAuthorization_authInfos :: Lens' TestAuthorization (NonEmpty AuthInfo) Source #
A list of authorization info objects. Simulating authorization will
create a response for each authInfo object in the list.
Destructuring the Response
data TestAuthorizationResponse Source #
See: newTestAuthorizationResponse smart constructor.
Constructors
| TestAuthorizationResponse' | |
Fields
| |
Instances
newTestAuthorizationResponse Source #
Create a value of TestAuthorizationResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:authResults:TestAuthorizationResponse', testAuthorizationResponse_authResults - The authentication results.
$sel:httpStatus:TestAuthorizationResponse', testAuthorizationResponse_httpStatus - The response's http status code.
Response Lenses
testAuthorizationResponse_authResults :: Lens' TestAuthorizationResponse (Maybe [AuthResult]) Source #
The authentication results.
testAuthorizationResponse_httpStatus :: Lens' TestAuthorizationResponse Int Source #
The response's http status code.