original_docstring:  Decorator that will check and add event.requestContext.authorizer.sub to the event kwargs.
  
      Args:
          handler (func): a handler function with the signature (event, context) -> result
  
      Returns:
          handler (func): a lambda handler function that is sub aware
      
docstring: Decorator that will check and add event.requestContext.authorizer.sub to the event kwargs.
docstring_tokens: Decorator that will check and add event . requestContext . authorizer . sub to the event kwargs .
code: def sub_aware(handler):
      """ Decorator that will check and add event.requestContext.authorizer.sub to the event kwargs.
  
      Args:
          handler (func): a handler function with the signature (event, context) -> result
  
      Returns:
          handler (func): a lambda handler function that is sub aware
      """
      def handler_wrapper(event, context, **kwargs):
          sub = utils.deep_get(event, 'requestContext', 'authorizer', 'sub')
          if not sub:
              logger.error('Sub requestContext variable missing.')
              return {'statusCode': 500, 'body': 'Invalid sub.'}
  
          kwargs['sub'] = sub
          return handler(event, context, **kwargs)
  
      return handler_wrapper
code_tokens: def sub_aware ( handler ) : def handler_wrapper ( event , context , ** kwargs ) : sub = utils . deep_get ( event , 'requestContext' , 'authorizer' , 'sub' ) if not sub : logger . error ( 'Sub requestContext variable missing.' ) return { 'statusCode' : 500 , 'body' : 'Invalid sub.' } kwargs [ 'sub' ] = sub return handler ( event , context , ** kwargs ) return handler_wrapper
short_docstring: Decorator that will check and add event.requestContext.authorizer.sub to the event kwargs.
short_docstring_tokens: Decorator that will check and add event . requestContext . authorizer . sub to the event kwargs .
comment: """ Decorator that will check and add event.requestContext.authorizer.sub to the event kwargs.
  
      Args:
          handler (func): a handler function with the signature (event, context) -> result
  
      Returns:
          handler (func): a lambda handler function that is sub aware
      """