class_docstr: Attaches input Request authentication headers to the given Request object.
class_docstr_tok: ["Attaches","input","Request","authentication","headers","to","the","given","Request","object","."]
code: def auth_flow(
      self, request: httpx.Request
  ) -> Generator[httpx.Request, httpx.Response, None]:
      # modify and yield the request
      if self.cookie:
          request.headers["cookie"] = self.cookie
      if self.authorization:
          request.headers["authorization"] = self.authorization
      yield request
  
file_path: datasets-server/libs/libapi/src/libapi/authentication.py
imports: import logging
  from collections.abc import Generator
  from typing import Literal, Optional
  import httpx
  from libcommon.prometheus import StepProfiler
  from starlette.requests import Request
  from libapi.exceptions import AuthCheckHubRequestError, ExternalAuthenticatedError, ExternalUnauthenticatedError
  from libapi.jwt_token import validate_jwt
label_desc: Use image node_id 2 for calling the RequestAuth obj's underlying member method code with example usage: obj.auth_flow(request) without return types