awstin.apigateway package

awstin.apigateway.auth module

awstin.apigateway.auth.accept(principal_id, resource_arn)[source]

Return an auth lambda response granting access to the given resource ARN to the given principle ID.

Parameters
  • principal_id (str) – The principal ID to grant access to

  • resource_arn (str) – The ARN of the resource to grant access to

Returns

Auth lambda response

Return type

dict

awstin.apigateway.auth.invalid(body='Invalid')[source]

Return an auth lambda response indicating the request is invalid.

Parameters

body (str, optional) – Optional resposnse body. Default “Invalid”

Returns

Auth lambda response

Return type

dict

awstin.apigateway.auth.reject(principal_id, resource_arn)[source]

Return an auth lambda response rejecting access to the given resource ARN to the given principle ID.

Parameters
  • principal_id (str) – The principal ID to reject access to

  • resource_arn (str) – The ARN of the resource to reject access to

Returns

Auth lambda response

Return type

dict

awstin.apigateway.auth.unauthorized(body='Unauthorized')[source]

Return an auth lambda response indicating the requester is unauthorized.

Parameters

body (str, optional) – Optional resposnse body. Default “Unauthorized”

Returns

Auth lambda response

Return type

dict

awstin.apigateway.websocket module

class awstin.apigateway.websocket.Websocket(domain_name, stage=None)[source]

Bases: object

Serverless-to-client push via websocket

send(connection_id, message)[source]

Send a message to the user