libZSservicesZSamazonka-iotZSamazonka-iot
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

Creating a Request

data TestAuthorization Source #

See: newTestAuthorization smart constructor.

Constructors

TestAuthorization' 

Fields

  • clientId :: Maybe Text

    The MQTT client ID.

  • policyNamesToAdd :: Maybe [Text]

    When testing custom authorization, the policies specified here are treated as if they are attached to the principal being authorized.

  • principal :: Maybe Text

    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).

  • cognitoIdentityPoolId :: Maybe Text

    The Cognito identity pool ID.

  • policyNamesToSkip :: Maybe [Text]

    When testing custom authorization, the policies specified here are treated as if they are not attached to the principal being authorized.

  • authInfos :: NonEmpty AuthInfo

    A list of authorization info objects. Simulating authorization will create a response for each authInfo object in the list.

Instances

Instances details
Eq TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Read TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Show TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Generic TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type Rep TestAuthorization :: Type -> Type #

NFData TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Methods

rnf :: TestAuthorization -> () #

Hashable TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

ToJSON TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

AWSRequest TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type AWSResponse TestAuthorization #

ToHeaders TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

ToPath TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

ToQuery TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

type Rep TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

type Rep TestAuthorization = D1 ('MetaData "TestAuthorization" "Amazonka.IoT.TestAuthorization" "libZSservicesZSamazonka-iotZSamazonka-iot" 'False) (C1 ('MetaCons "TestAuthorization'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "clientId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "policyNamesToAdd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "principal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "cognitoIdentityPoolId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "policyNamesToSkip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "authInfos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty AuthInfo))))))
type AWSResponse TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

newTestAuthorization Source #

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:

$sel:clientId:TestAuthorization', testAuthorization_clientId - The MQTT client 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: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:cognitoIdentityPoolId:TestAuthorization', testAuthorization_cognitoIdentityPoolId - The Cognito identity pool ID.

$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: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_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_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_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_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

Instances details
Eq TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Read TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Show TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Generic TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type Rep TestAuthorizationResponse :: Type -> Type #

NFData TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

type Rep TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

type Rep TestAuthorizationResponse = D1 ('MetaData "TestAuthorizationResponse" "Amazonka.IoT.TestAuthorization" "libZSservicesZSamazonka-iotZSamazonka-iot" 'False) (C1 ('MetaCons "TestAuthorizationResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "authResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [AuthResult])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

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