class_docstr: Facebook input channel implementation. Based on the HTTPInputChannel.
docstr: Make sure the incoming webhook requests are properly signed.
  
  Args:
      app_secret: Secret Key for application
      request_payload: request body
      hub_signature_header: X-Hub-Signature header sent with request
  
  Returns:
      bool: indicated that hub signature is validated
docstr_tok: ["Make","sure","the","incoming","webhook","requests","are","properly","signed",".","Args",":","app_secret",":","Secret","Key","for","application","request_payload",":","request","body","hub_signature_header",":","X-Hub-Signature","header","sent","with","request","Returns",":","bool",":","indicated","that","hub","signature","is","validated"]
code: def validate_hub_signature(
      app_secret: Text,
      request_payload: bytes,
      hub_signature_header: Text,
  ) -> bool:
      """Make sure the incoming webhook requests are properly signed.
  
      Args:
          app_secret: Secret Key for application
          request_payload: request body
          hub_signature_header: X-Hub-Signature header sent with request
  
      Returns:
          bool: indicated that hub signature is validated
      """
      # noinspection PyBroadException
      try:
          hash_method, hub_signature = hub_signature_header.split("=")
      except Exception:
          pass
      else:
          digest_module = getattr(hashlib, hash_method)
          hmac_object = hmac.new(
              bytearray(app_secret, "utf8"),
              request_payload,
              digest_module,
          )
          generated_hash = hmac_object.hexdigest()
          if hub_signature == generated_hash:
              return True
      return False
  
imports: import copy
  import hashlib
  import hmac
  import logging
  import structlog
  from fbmessenger import MessengerClient
  from fbmessenger.attachments import Image
  from fbmessenger.elements import Text
  from fbmessenger.quick_replies import QuickReplies, QuickReply
  from fbmessenger.sender_actions import SenderAction
  import rasa.shared.utils.io
  from sanic import Blueprint, response
  from sanic.request import Request
  from typing import Text, List, Dict, Any, Callable, Awaitable, Iterable, Optional, Union
  from rasa.core.channels.channel import UserMessage, OutputChannel, InputChannel
  from sanic.response import HTTPResponse
label_desc: Use image node_id 5 for calling the FacebookInput obj's underlying member method code with example usage: obj.validate_hub_signature(app_secret, request_payload, hub_signature_header) and returns: False, True