test_authorization
async
¶
test_authorization(
auth_infos: AuthInfos,
*,
config_overrides: Optional[AsyncIoTClientConfig] = None,
principal: Optional[Principal] = None,
cognito_identity_pool_id: Optional[CognitoIdentityPoolId] = None,
client_id: Optional[ClientId] = None,
policy_names_to_add: Optional[PolicyNames] = None,
policy_names_to_skip: Optional[PolicyNames] = None,
) -> TestAuthorizationResponse
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.
Parameters:
-
principal(Optional[Principal], default:None) –The principal. Valid principals are CertificateArn (arn:aws:iot:region:accountId:cert/certificateId) and CognitoId (region:id).
-
cognito_identity_pool_id(Optional[CognitoIdentityPoolId], default:None) –The Cognito identity pool ID.
-
auth_infos(AuthInfos) –A list of authorization info objects. Simulating authorization will create a response for each
authInfoobject in the list. -
client_id(Optional[ClientId], default:None) –The MQTT client ID.
-
policy_names_to_add(Optional[PolicyNames], default:None) –When testing custom authorization, the policies specified here are treated as if they are attached to the principal being authorized.
-
policy_names_to_skip(Optional[PolicyNames], default:None) –When testing custom authorization, the policies specified here are treated as if they are not attached to the principal being authorized.
Raises:
-
InternalFailureException–An unexpected error has occurred.
-
InvalidRequestException–The request is not valid.
-
LimitExceededException–A limit has been exceeded.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The rate exceeds the limit.
-
UnauthorizedException–You are not authorized to perform this operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iot/_services/async_io_t.py
16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 | |