o
    ÿÑÐb¼  ã                   @   s:   d dl mZmZ dd„ Zddd„Zddd„Zdd
d„ZdS )é    )Úadd_params_to_qsÚadd_params_to_uric                 C   s   t |d| fgƒS )z¶Add a Bearer Token to the request URI.
    Not recommended, use only if client can't use authorization header or body.

    http://www.example.com/path?access_token=h480djs93hd8
    Úaccess_token)r   )ÚtokenÚuri© r   ú`/var/www/secure340b-portal/env/lib/python3.10/site-packages/authlib/oauth2/rfc6750/parameters.pyÚ
add_to_uri   s   r	   Nc                 C   s   |pi }d  | ¡|d< |S )z„Add a Bearer Token to the request URI.
    Recommended method of passing bearer tokens.

    Authorization: Bearer h480djs93hd8
    z	Bearer {}ÚAuthorization)Úformat)r   Úheadersr   r   r   Úadd_to_headers   s   r   c                 C   s   |du rd}t |d| fgƒS )zKAdd a Bearer Token to the request body.

    access_token=h480djs93hd8
    NÚ r   )r   )r   Úbodyr   r   r   Úadd_to_body   s   r   Úheaderc                 C   sD   |dv r
t | |ƒ}n|dv rt| |ƒ}n	|dkrt| |ƒ}|||fS )N)r   ÚurlÚquery)r   r   r   )r	   r   r   )r   r   r   r   Z	placementr   r   r   Úadd_bearer_token"   s   

r   )N)r   )Zauthlib.common.urlsr   r   r	   r   r   r   r   r   r   r   Ú<module>   s
    
	

