U
    ÔÉ>i  ã                   @   s¦   d dl mZmZmZmZ d dlmZ eeee eee  f ee edœdd„Z	d
edeee eee  eeeeee eee  f f f eee edœdd	„Z
dS )é    )ÚDictÚListÚOptionalÚUnion)ÚToken)ÚscopeÚgranted_scopeÚreturnc                    st   t | tƒr| ˆ kS t | tƒs t‚t| ƒdkr0dS t | d tƒrF| g}n| }|D ] }t‡ fdd„|D ƒƒrN dS qNdS )Nr   Tc                 3   s   | ]}|ˆ kV  qd S )N© )Ú.0Ús©r   r
   úC/tmp/pip-unpacked-wheel-upujnpc2/allauth/idp/oidc/internal/scope.pyÚ	<genexpr>   s     z$_is_scope_granted.<locals>.<genexpr>F)Ú
isinstanceÚstrÚlistÚ
ValueErrorÚlenÚall)r   r   Zlist_of_list_of_scopesZlist_of_scopesr
   r   r   Ú_is_scope_granted   s    

r   N)r   ÚtokenÚmethodr	   c                 C   sN   | d krdS t | tƒr(|sdS |  |¡} |r4| ¡ ng }| d k	sDt‚t| |ƒS )NTF)r   ÚdictÚgetZ
get_scopesÚAssertionErrorr   )r   r   r   r   r
   r
   r   Úis_scope_granted   s    

r   )N)Útypingr   r   r   r   Zallauth.idp.oidc.modelsr   r   Úboolr   r   r
   r
   r
   r   Ú<module>   s0   
þÿù" ÷
 üÿö