Ë
    Ö—Äj´I  ã                  ó,  — d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dlmZm	Z	m
Z
 d dlmZmZ d dlZd dlmZ d dlmZ d d	lmZ d d
lmZmZ erd dlmZ eg eeef   f   Zeegeeef   f   ZdZ e	e¬«      Z  G d„ dej
                  «      Z! G d„ de!ej
                  «      Z" G d„ de"«      Z# G d„ de!«      Z$ G d„ de!e«      Z% G d„ d«      Z& G d„ de%«      Z' G d„ de%«      Z( G d„ de!ed   «      Z) G d „ d!e!ed!   «      Z* G d"„ d#e"ed#   «      Z+y)$é    )ÚannotationsN)ÚABC)ÚCallable)ÚdatetimeÚ	timedeltaÚtimezone)ÚTYPE_CHECKINGÚUnion)Úutils)ÚConsts)ÚInstallationAuthorization)Ú	RequesterÚWithRequester©ÚGithubIntegrationé   )Úsecondsc                  ó’   — e Zd ZdZeej                  dd„«       «       Zeej                  dd„«       «       Zd	d„Z	d	d„Z
edd„«       Zy)
ÚAuthzS
    This class is the base class of all authentication methods for Requester.
    c                 ó   — y)zŠ
        The type of the auth token as used in the HTTP Authorization header, e.g. Bearer or Basic.

        :return: token type

        N© ©Úselfs    úPC:\Users\pivot\Documents\cueki\casual-preloader\Lib\site-packages\github/Auth.pyÚ
token_typezAuth.token_typeB   ó   � ó    c                 ó   — y)zc
        The auth token as used in the HTTP Authorization header.

        :return: token

        Nr   r   s    r   Útokenz
Auth.tokenL   r   r   c                ó@   — | j                   › d| j                  › �|d<   y)z3
        Add authorization to the headers.
        Ú ÚAuthorizationN)r   r   ©r   Úheaderss     r   ÚauthenticationzAuth.authenticationV   s"   € ð '+§o¡oÐ%6°a¸¿
¹
°|Ð#Dˆ�Ò r   c                ó"   — | j                   |d<   y)z0
        Mask header, e.g. for logging.
        r"   N)Ú_masked_tokenr#   s     r   Úmask_authenticationzAuth.mask_authentication\   s   € ð $(×#5Ñ#5ˆ�Ò r   c                 ó   — y)Nz(unknown auth removed)r   r   s    r   r'   zAuth._masked_tokenb   s   € à'r   N©ÚreturnÚstr)r$   Údictr+   ÚNone)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚpropertyÚabcÚabstractmethodr   r   r%   r(   r'   r   r   r   r   r   =   sj   „ ñð Ø×Ñòó ó ðð Ø×Ñòó ó ðóEó6ð ò(ó ñ(r   r   c                  ó¢   — e Zd Zeej
                  dd„«       «       Zeej
                  dd„«       «       Zedd„«       Zedd„«       Z	edd„«       Z
y)ÚHTTPBasicAuthc                 ó   — y)z
        The username.
        Nr   r   s    r   ÚusernamezHTTPBasicAuth.usernameh   r   r   c                 ó   — y)z
        The password.
        Nr   r   s    r   ÚpasswordzHTTPBasicAuth.passwordo   r   r   c                 ó   — y)NÚBasicr   r   s    r   r   zHTTPBasicAuth.token_typev   ó   € àr   c                ó¸   — t        j                  | j                  › d| j                  › �j	                  «       «      j                  d«      j                  dd«      S )NÚ:úutf-8Ú
Ú )Úbase64Ú	b64encoder9   r;   ÚencodeÚdecodeÚreplacer   s    r   r   zHTTPBasicAuth.tokenz   sJ   € ä×Ñ 4§=¡= /°°4·=±=°/Ð B× IÑ IÓ KÓL×SÑSÐT[Ó\×dÑdÐeiÐkmÓnÐnr   c                 ó   — y)Nz"Basic (login and password removed)r   r   s    r   r'   zHTTPBasicAuth._masked_token~   s   € à3r   Nr*   )r/   r0   r1   r3   r4   r5   r9   r;   r   r   r'   r   r   r   r7   r7   g   s‚   „ ØØ×Ñòó ó ðð
 Ø×Ñòó ó ðð
 òó ðð òoó ðoð ò4ó ñ4r   r7   c                  óN   — e Zd ZdZdd„Zedd„«       Zedd„«       Zedd„«       Zy)	ÚLoginzE
    This class is used to authenticate with login and password.
    c                ó¨   — t        |t        «      sJ ‚t        |«      dkD  sJ ‚t        |t        «      sJ ‚t        |«      dkD  sJ ‚|| _        || _        y ©Nr   )Ú
isinstancer,   ÚlenÚ_loginÚ	_password)r   Úloginr;   s      r   Ú__init__zLogin.__init__ˆ   sR   € Ü˜%¤Ô%Ð%Ð%Ü�5‹z˜AŠ~Ðˆ~Ü˜(¤CÔ(Ð(Ð(Ü�8‹}˜qÒ Ð Ð àˆŒØ!ˆ�r   c                ó   — | j                   S ©N©rP   r   s    r   rR   zLogin.login‘   ó   € à�{‰{Ðr   c                ó   — | j                   S rU   ©rR   r   s    r   r9   zLogin.username•   ó   € à�z‰zÐr   c                ó   — | j                   S rU   ©rQ   r   s    r   r;   zLogin.password™   s   € à�~‰~Ðr   N)rR   r,   r;   r,   r*   )	r/   r0   r1   r2   rS   r3   rR   r9   r;   r   r   r   rK   rK   ƒ   sH   „ ñó"ð òó ðð òó ðð òó ñr   rK   c                  óN   — e Zd ZdZdd„Zedd„«       Zedd„«       Zedd„«       Zy)	ÚTokenzJ
    This class is used to authenticate with a single constant token.
    c                óV   — t        |t        «      sJ ‚t        |«      dkD  sJ ‚|| _        y rM   ©rN   r,   rO   Ú_token©r   r   s     r   rS   zToken.__init__£   ó)   € Ü˜%¤Ô%Ð%Ð%Ü�5‹z˜AŠ~Ðˆ~Øˆ�r   c                 ó   — y©Nr   r   r   s    r   r   zToken.token_type¨   r>   r   c                ó   — | j                   S rU   ©ra   r   s    r   r   zToken.token¬   rW   r   c                 ó   — y©Nztoken (oauth token removed)r   r   s    r   r'   zToken._masked_token°   ó   € à,r   N©r   r,   r*   )	r/   r0   r1   r2   rS   r3   r   r   r'   r   r   r   r^   r^   ž   sH   „ ñóð
 òó ðð òó ðð ò-ó ñ-r   r^   c                  ó"   — e Zd ZdZedd„«       Zy)ÚJWTzà
    This class is the base class to authenticate with a JSON Web Token (JWT).

    https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app

    c                 ó   — y)NÚBearerr   r   s    r   r   zJWT.token_type½   s   € àr   Nr*   )r/   r0   r1   r2   r3   r   r   r   r   rm   rm   µ   s   „ ñð òó ñr   rm   c                  ó   — e Zd Zdd„Zdd„Zy)Ú	JwtSignerc                ó    — || _         || _        y rU   )Ú_private_key_or_funcÚ_jwt_algorithm)r   Úprivate_key_or_funcÚjwt_algorithms      r   rS   zJwtSigner.__init__Ã   s   € Ø$7ˆÔ!Ø+ˆÕr   c                óª   — t        | j                  «      r| j                  «       }n| j                  }t        j                  ||| j                  ¬«      S )N)ÚkeyÚ	algorithm)Úcallablers   ÚjwtrF   rt   )r   ÚpayloadÚprivate_keys      r   Újwt_signzJwtSigner.jwt_signÇ   sB   € Ü�D×-Ñ-Ô.Ø×3Ñ3Ó5‰Kà×3Ñ3ˆKÜ�z‰z˜' {¸d×>QÑ>QÔRÐRr   N)ru   ústr | PrivateKeyGeneratorrv   r,   )r|   r-   r+   zstr | bytes)r/   r0   r1   rS   r~   r   r   r   rq   rq   Â   s   „ ó,ôSr   rq   c                  ó¼   — e Zd ZdZed
d„«       Z	 ddej                  ej                  dœ	 	 	 	 	 	 	 	 	 dd„Z	e
dd„«       Ze
dd„«       Z	 	 d	 	 	 	 	 	 	 dd„Zddd	„Zy)ÚAppAuthz¸
    This class is used to authenticate as a GitHub App.

    https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app

    c                ó.   — t        | |«      j                  S rU   )rq   r~   )ru   rv   s     r   Úcreate_jwt_signzAppAuth.create_jwt_sign×   s   € äÐ,¨mÓ<×EÑEÐEr   N)Ú	sign_funcÚ
jwt_expiryÚjwt_issued_atc               óh  — t        |t        t        f«      sJ |«       ‚t        |t        «      rt        |«      dkD  sJ d«       ‚|€	|€J d«       ‚|�	|�J d«       ‚|�ft        |t        «      st	        |«      sJ ‚t        |t        «      rt        |«      dkD  sJ d«       ‚t
        j                  |t        j                  «      }t        |t        «      sJ |«       ‚t        j                  |cxk  rt        j                  k  sJ |«       ‚ J |«       ‚t        |«      | _        || _        || _        || _        y )Nr   zapp_id must not be emptyz-either private_key or sign_func must be givenz-private_key or sign_func cannot both be givenzprivate_key must not be empty)rN   Úintr,   rO   rz   r�   rƒ   r   ÚDEFAULT_JWT_ALGORITHMÚMIN_JWT_EXPIRYÚMAX_JWT_EXPIRYÚ_app_idÚ
_sign_funcÚ_jwt_expiryÚ_jwt_issued_at)r   Úapp_idr}   r„   r…   r†   s         r   rS   zAppAuth.__init__Ü   s)  € ô ˜&¤3¬ *Ô-Ð5¨vÓ5Ð-Ü�fœcÔ"Ü�v“; ’?Ð>Ð$>Ó>�?ØÐ&¨)Ð*?ÐpÐApÓpÐ?ØÐ" iÐ&7ÐhÐ9hÓhÐ7ØÐ"Ü˜k¬3Ô/´8¸KÔ3HÐHÐHÜ˜+¤sÔ+Ü˜;Ó'¨!Ò+ÐLÐ-LÓLÐ+Ü×/Ñ/°¼V×=YÑ=YÓZˆIÜ˜*¤cÔ*Ð6¨JÓ6Ð*Ü×$Ñ$¨
ÔK´f×6KÑ6KÒKÐWÈZÓWÑKÐWÈZÓWÐKä˜6“{ˆŒØ#ˆŒØ%ˆÔØ+ˆÕr   c                ó   — | j                   S rU   )rŒ   r   s    r   r�   zAppAuth.app_id÷   s   € à�|‰|Ðr   c                ó"   — | j                  «       S rU   )Ú
create_jwtr   s    r   r   zAppAuth.tokenû   s   € à�‰Ó Ð r   c                ó   — t        | |||«      S )a  
        Creates a github.Auth.AppInstallationAuth instance for an installation.

        :param installation_id: installation id
        :param token_permissions: optional permissions
        :param requester: optional requester with app authentication
        :return:

        )ÚAppInstallationAuth)r   Úinstallation_idÚtoken_permissionsÚ	requesters       r   Úget_installation_authzAppAuth.get_installation_authÿ   s   € ô # 4¨Ð:KÈYÓWÐWr   c                óº  — |�Mt        |t        «      sJ |«       ‚t        j                  |cxk  rt        j                  k  sJ |«       ‚ J |«       ‚t        t        j
                  «       «      }|| j                  z   ||�|n| j                  z   | j                  dœ}| j                  €J ‚| j                  |«      }t        |t        «      r|j                  d«      S |S )zÉ
        Create a signed JWT
        https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app

        :return string: jwt
        )ÚiatÚexpÚissrA   )rN   rˆ   r   rŠ   r‹   Útimer�   rŽ   rŒ   r�   ÚbytesrG   )r   Ú
expirationÚnowr|   Ú	encrypteds        r   r“   zAppAuth.create_jwt  sÒ   € ð Ð!Ü˜j¬#Ô.Ð:°
Ó:Ð.Ü×(Ñ(¨JÔO¼&×:OÑ:OÒOÐ[ÐQ[Ó[ÑOÐ[ÐQ[Ó[ÐOä”$—)‘)“+Óˆà˜×,Ñ,Ñ,Ø¨
Ð(>™*ÀD×DTÑDTÑUØ—<‘<ñ
ˆð
 �‰Ð*Ð*Ð*Ø—O‘O GÓ,ˆ	ä�i¤Ô'Ø×#Ñ# GÓ,Ð,ØÐr   )ru   r   rv   r,   r+   ÚDictSignFunctionrU   )
r�   ú	int | strr}   z str | PrivateKeyGenerator | Noner„   zDictSignFunction | Noner…   rˆ   r†   rˆ   ©r+   r¤   r*   ©NN)r–   rˆ   r—   údict[str, str] | Noner˜   úRequester | Noner+   r•   )r    z
int | Noner+   r,   )r/   r0   r1   r2   Ústaticmethodrƒ   r   ÚDEFAULT_JWT_EXPIRYÚDEFAULT_JWT_ISSUED_ATrS   r3   r�   r   r™   r“   r   r   r   r�   r�   Ï   sØ   „ ñð òFó ðFð 9=ð,ð
 .2Ø ×3Ñ3Ø#×9Ñ9ñ,àð,ð 6ð,ð
 +ð,ð ð,ð ó,ð6 òó ðð ò!ó ð!ð 48Ø&*ð	XàðXð 1ðXð $ð	Xð
 
óXõ"r   r�   c                  ó*   — e Zd ZdZdd„Zedd„«       Zy)ÚAppAuthTokenzÓ
    This class is used to authenticate as a GitHub App with a single constant JWT.

    https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app

    c                óV   — t        |t        «      sJ ‚t        |«      dkD  sJ ‚|| _        y rM   r`   rb   s     r   rS   zAppAuthToken.__init__1  rc   r   c                ó   — | j                   S rU   rg   r   s    r   r   zAppAuthToken.token6  rW   r   Nrk   r*   )r/   r0   r1   r2   rS   r3   r   r   r   r   r­   r­   )  s    „ ñóð
 òó ñr   r­   c                  óè   ‡ — e Zd ZU dZdZded<   dZded<   	 	 d	 	 	 	 	 	 	 dˆ fd„Zdˆ fd„Ze	dd	„«       Z
e	dd
„«       Ze	dd„«       Ze	dd„«       Ze	dd„«       Ze	dd„«       Zdd„Ze	dd„«       Zˆ xZS )r•   zÒ
    This class is used to authenticate as a GitHub App Installation.

    https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation

    NzGithubIntegration | NoneÚ!_AppInstallationAuth__integrationz InstallationAuthorization | NoneÚ0_AppInstallationAuth__installation_authorizationc                ó4  •— t         ‰| �  «        t        |t        «      sJ |«       ‚t        |t        «      sJ |«       ‚|�t        |t
        «      sJ |«       ‚|�t        |t        «      sJ |«       ‚|| _        || _        || _	        |�| j                  |«       y y rU   )ÚsuperrS   rN   r�   rˆ   r-   r   Ú	_app_authÚ_installation_idÚ_token_permissionsÚwithRequester)r   Úapp_authr–   r—   r˜   Ú	__class__s        €r   rS   zAppInstallationAuth.__init__G  s    ø€ ô 	‰ÑÔä˜(¤GÔ,Ð6¨hÓ6Ð,Ü˜/¬3Ô/Ð@°Ó@Ð/Ø Ð(¬JÐ7HÌ$Ô,OÐbÐQbÓbÐOØÐ ¤J¨y¼)Ô$DÐOÀiÓOÐDà!ˆŒØ /ˆÔØ"3ˆÔàÐ Ø×Ñ˜yÕ)ð !r   c                óÔ   •— t        |t        «      sJ |«       ‚t        ‰| �  |j	                  | j
                  «      «       ddlm}  |di | j                  j                  ¤Ž| _
        | S )Nr   r   r   )rN   r   r´   r¸   ÚwithAuthrµ   Úgithub.GithubIntegrationr   r˜   Úkwargsr±   )r   r˜   r   rº   s      €r   r¸   z!AppInstallationAuth.withRequester\  sX   ø€ Ü˜)¤YÔ/Ð:°Ó:Ð/Ü‰Ñ˜i×0Ñ0°·±Ó@ÔAõ 	?á.ÑG°·±×1FÑ1FÑGˆÔàˆr   c                ó.   — | j                   j                  S rU   )rµ   r�   r   s    r   r�   zAppInstallationAuth.app_idg  s   € à�~‰~×$Ñ$Ð$r   c                ó   — | j                   S rU   )r¶   r   s    r   r–   z#AppInstallationAuth.installation_idk  s   € à×$Ñ$Ð$r   c                ó   — | j                   S rU   )r·   r   s    r   r—   z%AppInstallationAuth.token_permissionso  s   € à×&Ñ&Ð&r   c                 ó   — yre   r   r   s    r   r   zAppInstallationAuth.token_types  r>   r   c                óˆ   — | j                   �| j                  r| j                  «       | _         | j                   j                  S rU   )r²   Ú_is_expiredÚ_get_installation_authorizationr   r   s    r   r   zAppInstallationAuth.tokenw  s9   € à×,Ñ,Ð4¸×8HÒ8HØ04×0TÑ0TÓ0VˆDÔ-Ø×0Ñ0×6Ñ6Ð6r   c                ó¤   — | j                   €J ‚| j                   j                  t        z
  }|t        j                  t
        j                  «      k  S rU   )r²   Ú
expires_atÚ!TOKEN_REFRESH_THRESHOLD_TIMEDELTAr   r¡   r   Úutc)r   Útoken_expires_ats     r   rÄ   zAppInstallationAuth._is_expired}  sD   € à×0Ñ0Ð<Ð<Ð<Ø×<Ñ<×GÑGÔJkÑkÐØ¤(§,¡,¬x¯|©|Ó"<Ñ<Ð<r   c                óŠ   — | j                   €J d«       ‚| j                   j                  | j                  | j                  ¬«      S )Nú4Method withRequester(Requester) must be called first)Úpermissions)r±   Úget_access_tokenr¶   r·   r   s    r   rÅ   z3AppInstallationAuth._get_installation_authorizationƒ  sJ   € Ø×!Ñ!Ð-ÐeÐ/eÓeÐ-Ø×!Ñ!×2Ñ2Ø×!Ñ!Ø×/Ñ/ð 3ó 
ð 	
r   c                 ó   — yri   r   r   s    r   r'   z!AppInstallationAuth._masked_tokenŠ  rj   r   r¦   )r¹   r�   r–   rˆ   r—   r§   r˜   r¨   )r˜   r   r+   r•   r¥   )r+   rˆ   )r+   r§   r*   ©r+   Úbool)r+   r   )r/   r0   r1   r2   r±   Ú__annotations__r²   rS   r¸   r3   r�   r–   r—   r   r   rÄ   rÅ   r'   Ú__classcell__©rº   s   @r   r•   r•   ;  sê   ø… ñð /3€MÐ+Ó2ØEIÐ Ð"BÓIð 48Ø&*ð*àð*ð ð*ð 1ð	*ð
 $õ*õ*	ð ò%ó ð%ð ò%ó ð%ð ò'ó ð'ð òó ðð ò7ó ð7ð
 ò=ó ð=ó

ð ò-ó ô-r   r•   c                  óL  ‡ — e Zd ZU dZded<   ded<   ded<   ded<   ded<   d	ed
<   ded<   d	ed<   ddlmZ ded<   	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zedd„«       Z	edd„«       Z
dˆ fd„Zedd„«       Zd d„Zed!d„«       Zed"d„«       Zed!d„«       Zedd„«       Zˆ xZS )#ÚAppUserAuthzâ
    This class is used to authenticate as a GitHub App on behalf of a user.

    https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user

    r,   Ú
_client_idÚ_client_secretra   Ú_typeú
str | NoneÚ_scopeúdatetime | NoneÚ_expires_atÚ_refresh_tokenÚ_refresh_expires_atr   ©ÚApplicationOAuthrá   Ú_AppUserAuth__appc	                óœ  •— t         ‰	| �  «        t        |t        «      rt	        |«      dkD  sJ ‚t        |t        «      rt	        |«      dkD  sJ ‚t        |t        «      rt	        |«      dkD  sJ ‚|�%t        |t        «      rt	        |«      dkD  sJ |«       ‚|�t        |t
        «      sJ |«       ‚|� t        |t        «      rt	        |«      dkD  sJ ‚|�t        |t
        «      sJ |«       ‚|�t        |t        «      sJ |«       ‚|| _        || _        || _	        |xs d| _
        || _        || _        || _        |�| j                  |«       y y )Nr   Úbearer)r´   rS   rN   r,   rO   r   r   r×   rØ   ra   rÙ   rÝ   rÞ   rß   r¸   )
r   Ú	client_idÚclient_secretr   r   rÇ   Úrefresh_tokenÚrefresh_expires_atr˜   rº   s
            €r   rS   zAppUserAuth.__init__¥  sM  ø€ ô 	‰ÑÔä˜)¤SÔ)¬c°)«n¸qÒ.@Ð@Ð@Ü˜-¬Ô-´#°mÓ2DÀqÒ2HÐHÐHÜ˜%¤Ô%¬#¨e«*°qª.Ð8Ð8ØÐ!¤Z°
¼CÔ%@ÄSÈÃ_ÐWXÒEXÐdÐZdÓdÐXØÐ!¤Z°
¼HÔ%EÐQÀzÓQÐEØÐ$¬
°=Ä#Ô(FÌ3È}ÓK]Ð`aÒKaÐaÐaØ!Ð)¬ZÐ8JÌHÔ-UÐiÐWiÓiÐUØÐ ¤J¨y¼)Ô$DÐOÀiÓOÐDà#ˆŒØ+ˆÔØˆŒØÒ+ 8ˆŒ
Ø%ˆÔØ+ˆÔØ#5ˆÔ àÐ Ø×Ñ˜yÕ)ð !r   c                ó   — | j                   S rU   )rÙ   r   s    r   r   zAppUserAuth.token_typeÆ  rZ   r   c                óR   — | j                   r| j                  «        | j                  S rU   )rÄ   Ú_refreshra   r   s    r   r   zAppUserAuth.tokenÊ  s   € à×ÒØ�M‰MŒOØ�{‰{Ðr   c                óÜ   •— t        |t        «      sJ |«       ‚t        ‰| �  |j	                  d «      «       ddlm}  |t        ‰| �  i | j                  | j                  dœ¬«      | _
        | S )Nr   rà   )rå   ræ   )r$   Ú
attributes)rN   r   r´   r¸   r¼   Úgithub.ApplicationOAuthrá   r˜   r×   rØ   râ   )r   r˜   rá   rº   s      €r   r¸   zAppUserAuth.withRequesterÐ  sh   ø€ Ü˜)¤YÔ/Ð:°Ó:Ð/Ü‰Ñ˜i×0Ñ0°Ó6Ô7õ 	=á%ä‰GÑØà!Ÿ_™_Ø!%×!4Ñ!4ñô	
ˆŒ
ð ˆr   c                ó‚   — | j                   d uxr0 | j                   t        j                  t        j                  «      k  S rU   )rÝ   r   r¡   r   rÉ   r   s    r   rÄ   zAppUserAuth._is_expiredã  s3   € à×Ñ tÐ+Ò]°×0@Ñ0@Ä8Ç<Á<ÔPX×P\ÑP\ÓC]Ñ0]Ð]r   c                óÖ  — | j                   €t        d«      ‚| j                  �;| j                  t        j                  t
        j                  «      k  rt        d«      ‚| j                  j                  | j                   «      }|j                  | _
        |j                  | _        |j                  | _        |j                  | _        |j"                  | _         |j$                  | _        y )NzGCannot refresh expired token because no refresh token has been providedz?Cannot refresh expired token because refresh token also expired)rÞ   ÚRuntimeErrorrß   r   r¡   r   rÉ   râ   Úrefresh_access_tokenr   ra   ÚtyperÙ   ÚscoperÛ   rÇ   rÝ   rç   rè   rb   s     r   rë   zAppUserAuth._refreshç  s¸   € Ø×ÑÐ&ÜÐhÓiÐiØ×#Ñ#Ð/°D×4LÑ4LÌxÏ|É|Ô\d×\hÑ\hÓOiÒ4iÜÐ`ÓaÐað —
‘
×/Ñ/°×0CÑ0CÓDˆð —k‘kˆŒØ—Z‘ZˆŒ
Ø—k‘kˆŒØ ×+Ñ+ˆÔØ#×1Ñ1ˆÔØ#(×#;Ñ#;ˆÕ r   c                ó   — | j                   S rU   )rÝ   r   s    r   rÇ   zAppUserAuth.expires_atø  s   € à×ÑÐr   c                ó   — | j                   S rU   )rÞ   r   s    r   rç   zAppUserAuth.refresh_tokenü  s   € à×"Ñ"Ð"r   c                ó   — | j                   S rU   )rß   r   s    r   rè   zAppUserAuth.refresh_expires_at   s   € à×'Ñ'Ð'r   c                 ó   — y)NzBearer (jwt removed)r   r   s    r   r'   zAppUserAuth._masked_token  s   € à%r   )NNNNN)rå   r,   ræ   r,   r   r,   r   rÚ   rÇ   rÜ   rç   rÚ   rè   rÜ   r˜   r¨   r+   r.   r*   )r˜   r   r+   rÖ   rÐ   ©r+   r.   )r+   rÜ   )r+   rÚ   )r/   r0   r1   r2   rÒ   rî   rá   rS   r3   r   r   r¸   rÄ   rë   rÇ   rç   rè   r'   rÓ   rÔ   s   @r   rÖ   rÖ   �  sI  ø… ñð ƒOØÓØƒKØƒJØÓØ Ó ØÓØ(Ó(õ 9àÓð "&Ø&*Ø$(Ø.2Ø&*ð*àð*ð ð*ð ð	*ð
 ð*ð $ð*ð "ð*ð ,ð*ð $ð*ð 
õ*ðB òó ðð òó ðõ
ð& ò^ó ð^ó<ð" ò ó ð ð ò#ó ð#ð ò(ó ð(ð ò&ó ô&r   rÖ   c                  óf   ‡ — e Zd ZdZdˆ fd„Zedd„«       Zedd„«       Zedd„«       Zd	ˆ fd„Z	ˆ xZ
S )
Ú	NetrcAuthz8
    This class is used to authenticate via .netrc.
    c                ó>   •— t         ‰| �  «        d | _        d | _        y rU   )r´   rS   rP   rQ   )r   rº   s    €r   rS   zNetrcAuth.__init__  s   ø€ Ü‰ÑÔà"&ˆŒØ%)ˆ�r   c                ó   — | j                   S rU   rY   r   s    r   r9   zNetrcAuth.username  rZ   r   c                ó@   — | j                   €J d«       ‚| j                   S ©NrÌ   rV   r   s    r   rR   zNetrcAuth.login  s"   € à�{‰{Ð&Ð^Ð(^Ó^Ð&Ø�{‰{Ðr   c                ó@   — | j                   €J d«       ‚| j                   S rÿ   r\   r   s    r   r;   zNetrcAuth.password  s"   € à�~‰~Ð)ÐaÐ+aÓaÐ)Ø�~‰~Ðr   c                óè   •— t        |t        «      sJ |«       ‚t        ‰| �  |«       t	        j
                  |j                  d¬«      }|€t        d|j                  › �«      ‚|\  | _	        | _
        | S )NT)Úraise_errorsz.Could not get credentials from netrc for host )rN   r   r´   r¸   r   Úget_netrc_authÚbase_urlrñ   ÚhostnamerP   rQ   )r   r˜   Úauthrº   s      €r   r¸   zNetrcAuth.withRequester"  sp   ø€ Ü˜)¤YÔ/Ð:°Ó:Ð/Ü‰Ñ˜iÔ(ä×#Ñ# I×$6Ñ$6ÀTÔJˆØˆ<ÜÐ!OÐPY×PbÑPbÐOcÐdÓeÐeà&*Ñ#ˆŒ�T”^àˆr   rù   r*   )r˜   r   r+   rû   )r/   r0   r1   r2   rS   r3   r9   rR   r;   r¸   rÓ   rÔ   s   @r   rû   rû   	  sS   ø„ ñõ*ð òó ðð òó ðð òó ð÷
ñ 
r   rû   ),Ú
__future__r   r4   rD   rž   r   Úcollections.abcr   r   r   r   Útypingr	   r
   r{   Úrequestsr   Úgithubr   Ú github.InstallationAuthorizationr   Úgithub.Requesterr   r   r½   r   r,   rŸ   ÚPrivateKeyGeneratorr-   r£   Ú&ACCESS_TOKEN_REFRESH_THRESHOLD_SECONDSrÈ   r   r7   rK   r^   rm   rq   r�   r­   r•   rÖ   rû   r   r   r   Ú<module>r     s0  ðõ@ #ã 
Û Û Ý Ý $ß 2Ñ 2ß 'ã 
Ý å Ý Fß 5áÝ:à˜r 5¨¨e¨Ñ#4Ð4Ñ5Ð Ø˜T˜F E¨#¨u¨*Ñ$5Ð5Ñ6Ð ð *,Ð &Ù$-Ð6\Ô$]Ð !ô'(ˆ3�7‰7ô '(ôT4�D˜#Ÿ'™'ô 4ô8ˆMô ô6-ˆDô -ô.
ˆ$�ô 
÷
Sñ 
SôWˆcô Wôt�3ô ô$Q-˜$ Ð.CÑ Dô Q-ôhw&�$˜ mÑ4ô w&ôt#�˜}¨[Ñ9õ #r   