test_invoke_authorizer¶
Operation¶
test_invoke_authorizer
async
¶
test_invoke_authorizer(input: TestInvokeAuthorizerInput, plugins: list[Plugin] | None = None) -> TestInvokeAuthorizerOutput
Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
TestInvokeAuthorizerInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
TestInvokeAuthorizerOutput
|
An instance of |
Input¶
TestInvokeAuthorizerInput
dataclass
¶
Make a request to simulate the invocation of an Authorizer.
Attributes¶
additional_context
class-attribute
instance-attribute
¶
additional_context: dict[str, str] | None = None
A key-value map of additional context variables.
authorizer_id
class-attribute
instance-attribute
¶
authorizer_id: str | None = None
Specifies a test invoke authorizer request's Authorizer ID.
body
class-attribute
instance-attribute
¶
body: str | None = None
The simulated request body of an incoming invocation request.
headers
class-attribute
instance-attribute
¶
headers: dict[str, str] | None = None
A key-value map of headers to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, should be specified.
multi_value_headers
class-attribute
instance-attribute
¶
multi_value_headers: dict[str, list[str]] | None = None
The headers as a map from string to list of values to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, may be specified.
path_with_query_string
class-attribute
instance-attribute
¶
path_with_query_string: str | None = None
The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.
rest_api_id
class-attribute
instance-attribute
¶
rest_api_id: str | None = None
The string identifier of the associated RestApi.
stage_variables
class-attribute
instance-attribute
¶
stage_variables: dict[str, str] | None = None
A key-value map of stage variables to simulate an invocation on a deployed Stage.
Output¶
TestInvokeAuthorizerOutput
dataclass
¶
Represents the response of the test invoke request for a custom Authorizer
Attributes¶
authorization
class-attribute
instance-attribute
¶
authorization: dict[str, list[str]] | None = None
The authorization response.
claims
class-attribute
instance-attribute
¶
claims: dict[str, str] | None = None
The open identity claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
client_status
class-attribute
instance-attribute
¶
client_status: int = 0
The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
latency
class-attribute
instance-attribute
¶
latency: int = 0
The execution latency, in ms, of the test authorizer request.
log
class-attribute
instance-attribute
¶
log: str | None = None
The API Gateway execution log for the test authorizer request.
policy
class-attribute
instance-attribute
¶
policy: str | None = None
The JSON policy document returned by the Authorizer
principal_id
class-attribute
instance-attribute
¶
principal_id: str | None = None
The principal identity returned by the Authorizer