def _prepare_authorizer_event(self, arn, lambda_event, lambda_context):
        # type: (str, EventType, LambdaContext) -> EventType
        """Translate event for an authorizer input."""
        authorizer_event = lambda_event.copy()
        authorizer_event['type'] = 'TOKEN'
        try:
            authorizer_event['authorizationToken'] = authorizer_event.get(
                'headers', {})['authorization']
        except KeyError:
            raise NotAuthorizedError(
                {'x-amzn-RequestId': lambda_context.aws_request_id,
                 'x-amzn-ErrorType': 'UnauthorizedException'},
                b'{"message":"Unauthorized"}')
        authorizer_event['methodArn'] = arn
        return authorizer_event
def _prepare_authorizer_event ( self , arn , lambda_event , lambda_context ) : authorizer_event = lambda_event . copy ( ) authorizer_event [ 'type' ] = 'TOKEN' try : authorizer_event [ 'authorizationToken' ] = authorizer_event . get ( 'headers' , { } ) [ 'authorization' ] except KeyError : raise NotAuthorizedError ( { 'x-amzn-RequestId' : lambda_context . aws_request_id , 'x-amzn-ErrorType' : 'UnauthorizedException' } , b'{"message":"Unauthorized"}' ) authorizer_event [ 'methodArn' ] = arn return authorizer_event
Translate event for an authorizer input.