o
    Df                     @   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 )zAdd 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   Z/home/ubuntu/webapp/venv/lib/python3.10/site-packages/authlib/oauth2/rfc6750/parameters.py
add_to_uri   s   r	   Nc                 C   s   |pi }d|  |d< |S )zAdd a Bearer Token to the request URI.
    Recommended method of passing bearer tokens.

    Authorization: Bearer h480djs93hd8
    zBearer Authorizationr   )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   	placementr   r   r   add_bearer_token"   s   

r   )N)r   )authlib.common.urlsr   r   r	   r   r   r   r   r   r   r   <module>   s
    
	

