amazonka-iot-2.0: Amazon IoT SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

  • cognitoIdentityPoolId :: Maybe Text

    The Cognito identity pool ID.

  • policyNamesToAdd :: Maybe [Text]

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

  • policyNamesToSkip :: Maybe [Text]

    When testing custom authorization, the policies specified here are treated as if they are not 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).

  • 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
ToJSON TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.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

AWSRequest TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type AWSResponse TestAuthorization #

Generic TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type Rep TestAuthorization :: Type -> Type #

Read TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Show TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

NFData TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Methods

rnf :: TestAuthorization -> () #

Eq TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Hashable TestAuthorization Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

type AWSResponse 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" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" 'False) (C1 ('MetaCons "TestAuthorization'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "clientId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "cognitoIdentityPoolId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "policyNamesToAdd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])))) :*: (S1 ('MetaSel ('Just "policyNamesToSkip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "principal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "authInfos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty AuthInfo))))))

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:

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

Instances details
Generic TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Associated Types

type Rep TestAuthorizationResponse :: Type -> Type #

Read TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Show TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

NFData TestAuthorizationResponse Source # 
Instance details

Defined in Amazonka.IoT.TestAuthorization

Eq 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" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" '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