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 __init__(self, request: Optional[Request]) -> None:
      self.cookie = request.headers.get("cookie") if request else None
      self.authorization = (
          request.headers.get("authorization") if request else None
      )
  
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 1 to create a new RequestAuth object from inherited base classes: httpx with example: obj = RequestAuth(request)