
    !<i                     V    d dl mZ d dlmZ dedee         fdZ G d de          ZdS )	    )AuthlibHTTPError)add_params_to_uritextreturnc                 B    g dfdt          |           D             S )zCheck whether the string only contains characters from the restricted ASCII set defined in RFC6749 for errors.

    https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
    ))    !   )#   [   )]   ~   c                 L    g | ]t          fd D                        S )c              3   X   K   | ]$\  }}|t                    cxk    o|k    nc V  %d S N)ord).0startendchars      /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/authlib/oauth2/base.py	<genexpr>z6invalid_error_characters.<locals>.<listcomp>.<genexpr>   sI      LL5CII,,,,,,,,LLLLLL    )any)r   r   valid_rangess    @r   
<listcomp>z,invalid_error_characters.<locals>.<listcomp>   sM       LLLL|LLLLL  r   )set)r   r   s    @r   invalid_error_charactersr      sE    
  L   II   r   c                   D     e Zd Z	 	 	 	 	 	 	 d fd	Z fdZd fd	Z xZS )OAuth2ErrorNFc                     |r7t          |          x}r&t          dd                    |           d          t                                          ||||           || _        || _        || _        d S )Nz1Error description contains forbidden characters: z, .)r   
ValueErrorjoinsuper__init__stateredirect_uriredirect_fragment)
selfdescriptionuristatus_coder&   r'   r(   errorchars	__class__s
            r   r%   zOAuth2Error.__init__   s      	0===u  [		RWHXHX[[[   	S+>>>
(!2r   c                     t                                                      }| j        r|                    d| j        f           |S )zGet a list of body.r&   )r$   get_bodyr&   append)r)   r-   r/   s     r   r1   zOAuth2Error.get_body2   s@      "": 	0LL'4:.///r   c                     | j         r7|                                 }t          | j         || j                  }ddd|fgfS t	                                          |          S )Ni.   Location)r+   )r'   r1   r   r(   r$   __call__)r)   r+   paramslocr/   s       r   r6   zOAuth2Error.__call__9   sb     	0]]__F#D$5vt?UVVCj#.///wwC(((r   )NNNNNFNr   )__name__
__module____qualname__r%   r1   r6   __classcell__)r/   s   @r   r   r      s         3 3 3 3 3 34    ) ) ) ) ) ) ) ) ) )r   r   N)authlib.common.errorsr   authlib.common.urlsr   strlistr   r    r   r   <module>rB      s    2 2 2 2 2 2 1 1 1 1 1 13 49    $') ') ') ') ')" ') ') ') ') ')r   