code: def start_call(self, info, headers):
      auth_header = None
      for header in headers:
          if header.lower() == "authorization":
              auth_header = headers[header][0]
              break
  
      if not auth_header:
          raise FlightUnauthenticatedError("No credentials supplied")
  
      auth_type, _, value = auth_header.partition(" ")
  
      if auth_type == "Basic":
          decoded = base64.b64decode(value).decode("utf-8")
          username, _, password = decoded.partition(":")
          if not self.is_valid_user(username, password):
              raise FlightUnauthenticatedError("Invalid credentials")
          token = secrets.token_urlsafe(32)
          self.tokens[token] = username
          return BasicAuthServerMiddleware(token)
  
      raise FlightUnauthenticatedError("No credentials supplied")
  
file_path: TabPy/tabpy/tabpy_server/handlers/basic_auth_server_middleware_factory.py
imports: import base64
  import secrets
  from pyarrow.flight import ServerMiddlewareFactory, ServerMiddleware
  from pyarrow.flight import FlightUnauthenticatedError
  from tabpy.tabpy_server.handlers.util import hash_password
label_desc: Use image node_id 3 for calling the BasicAuthServerMiddlewareFactory obj's underlying member method code with example usage: obj.start_call(info, headers) and returns: BasicAuthServerMiddleware