IdentitySource

class aws_cdk.aws_apigateway.IdentitySource

Bases: object

Represents an identity source.

The source can be specified either as a literal value (e.g: Auth) which cannot be blank, or as an unresolved string token.

ExampleMetadata:

infused

Example:

# auth_fn: lambda.Function
# books: apigateway.Resource


auth = apigateway.RequestAuthorizer(self, "booksAuthorizer",
    handler=auth_fn,
    identity_sources=[apigateway.IdentitySource.header("Authorization")]
)

books.add_method("GET", apigateway.HttpIntegration("http://amazon.com"),
    authorizer=auth
)

Static Methods

classmethod context(context)

Provides a properly formatted request context identity source.

Parameters:

context (str) – the name of the context variable the IdentitySource will represent.

Return type:

str

Returns:

a request context identity source.

classmethod header(header_name)

Provides a properly formatted header identity source.

Parameters:

header_name (str) – the name of the header the IdentitySource will represent.

Return type:

str

Returns:

a header identity source.

classmethod query_string(query_string)

Provides a properly formatted query string identity source.

Parameters:

query_string (str) – the name of the query string the IdentitySource will represent.

Return type:

str

Returns:

a query string identity source.

classmethod stage_variable(stage_variable)

Provides a properly formatted API Gateway stage variable identity source.

Parameters:

stage_variable (str) – the name of the stage variable the IdentitySource will represent.

Return type:

str

Returns:

an API Gateway stage variable identity source.