
    &`i                     h    	 d dl mZmZmZ dZn# e$ r dZY nw xY wdefdZdedefdZ	dedefd	Z
d
S )    )AuthenticationModeget_authentication_modevalidate_authentication_tokenTFreturnc                  `    t           sdS t                      t          j        t          j        hv S )zCheck if token authentication is enabled.

    Returns:
        bool: True if AUTH_MODE is set to "token" or "k8s", False otherwise
    F)_RAYLET_AVAILABLEr   r   TOKENK8S     /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/_private/authentication/authentication_utils.pyis_token_auth_enabledr      s5      u"$$ )  r   auth_headerc                 6    t           r| sdS t          |           S )zValidate the Authorization header from an HTTP request.

    Args:
        auth_header: The Authorization header value (e.g., "Bearer <token>")

    Returns:
        bool: True if token is valid, False otherwise
    F)r   r   )r   s    r   validate_request_tokenr      s(      K u )555r   modec                 h    ddl m} |j        d|j        d|j        di}|                    | d          S )zConvert AuthenticationMode enum value to string name.

    Args:
        mode: AuthenticationMode enum value from ray._raylet

    Returns:
        String name: "disabled", "token", or "k8s"
    r   )r   disabledtokenk8sunknown)ray._rayletr   DISABLEDr	   r
   get)r   r   _MODE_NAMESs      r   get_authentication_mode_namer   .   sM     /..... 	#Z 'K
 ??4+++r   N)r   r   r   r   r   ImportErrorboolr   strr   r   r   r   r   <module>r       s   
             
t    6 6 6 6 6 6",'9 ,c , , , , , ,s    