ó
    pyüiÄ  ã            	       ó  • S r SSKrSSKrSSKJr  SSKJrJr  \R                  " S\R                  \R                  -  \R                  -  S9rSS	\S-  S
\\   4S jjrSS\S\S	\S-  S
S4S jjrSS\S	\S-  S
S4S jjrS\S
\\   4S jrg)z-Contains utilities to manage Git credentials.é    Né   )ÚENDPOINTé   )Úrun_interactive_subprocessÚrun_subprocesszß
        ^\s* # start of line
        credential\.helper # credential.helper value
        \s*=\s* # separator
        ([\w\-\/]+) # the helper name or absolute path (group 1)
        (\s|$) # whitespace or end of line
    )ÚflagsÚfolderÚreturnc                 ó¨   •  [        SU S9R                  n[        U5      nU$ ! [        R                   a  n[        UR                  5      eSnAff = f)aw  Return the list of git credential helpers configured.

See https://git-scm.com/docs/gitcredentials.

Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

Args:
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit config --list©r	   N)r   ÚstdoutÚ_parse_credential_outputÚ
subprocessÚCalledProcessErrorÚOSErrorÚstderr)r	   ÚoutputÚparsedÚexcs       Úb/home/mande/repo/quber/.venv/lib/python3.13/site-packages/huggingface_hub/utils/_git_credential.pyÚlist_credential_helpersr   #   sN   € ð"ÜÐ 3¸FÑC×JÑJˆÜ)¨&Ó1ˆØˆøÜ×(Ñ(ó "Ü�c—j‘jÓ!Ð!ûð"ús   ‚ # £A·AÁAÚtokenÚusernamec           
      óÌ   • [        SUS9 u  nnUR                  S[         SUR                  5        SU  S35        UR	                  5         SSS5        g! , (       d  f       g= f)a  Save a username/token pair in git credential for HF Hub registry.

Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

Args:
    username (`str`, defaults to `"hf_user"`):
        A git username. Defaults to `"hf_user"`, the default user used in the Hub.
    token (`str`, defaults to `"hf_user"`):
        A git password. In practice, the User Access Token for the Hub.
        See https://huggingface.co/settings/tokens.
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit credential approver   úurl=z

username=z

password=z

N)r   Úwriter   ÚlowerÚflush)r   r   r	   ÚstdinÚ_s        r   Úset_git_credentialr!   7   s[   € ô 
$Ð$<ÀVÒ	Lñ QØØ	à�‰�dœ8˜* K°·±Ó0@Ð/AÀÈUÈGÐSWÐXÔYØ�‰Œ÷ 
M×	LÖ	Lús   ‹AAÁ
A#c                 óæ   • [        SUS9 u  nnS[         S3nU b  USU R                  5        S3-  nUS-  nUR                  U5        UR	                  5         SSS5        g! , (       d  f       g= f)a1  Erase credentials from git credential for HF Hub registry.

Credentials are erased from the configured helpers (store, cache, macOS
keychain,...), if any. If `username` is not provided, any credential configured for
HF Hub endpoint is erased.
Calls "`git credential erase`" internally. See https://git-scm.com/docs/git-credential.

Args:
    username (`str`, defaults to `"hf_user"`):
        A git username. Defaults to `"hf_user"`, the default user used in the Hub.
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit credential rejectr   r   Ú
Nz	username=)r   r   r   r   r   )r   r	   r   r    Ústandard_inputs        r   Úunset_git_credentialr%   N   sv   € ô 
$Ð$;ÀFÒ	Kñ PØØ	à¤˜z¨Ð,ˆØÑØ 	¨(¯.©.Ó*:Ð);¸2Ð>Ñ>ˆNØ˜$Ñˆà�‰�NÔ#Ø�‰Œ÷ 
L×	KÖ	Kús   ‹AA"Á"
A0r   c                 ón   • [        [        R                  U 5       Vs1 s H  oS   iM	     sn5      $ s  snf )z‹Parse the output of `git credential fill` to extract the password.

Args:
    output (`str`):
        The output of `git credential fill`.
r   )ÚsortedÚGIT_CREDENTIAL_REGEXÚfindall)r   Úmatchs     r   r   r   i   s;   € ô ä"6×">Ñ">¸vÔ"Fó	
Ú"F˜�!ŒHÑ"Fñ	
óð ùò	
s   �2)N)Úhf_userN)Ú__doc__Úrer   Ú	constantsr   Ú_subprocessr   r   ÚcompileÚ	MULTILINEÚ
IGNORECASEÚVERBOSEr(   ÚstrÚlistr   r!   r%   r   © ó    r   Ú<module>r8      s¾   ðñ 4ã 	Û å  ß Cð —z’zðð �,‰,˜Ÿ™Ñ
&¨¯©Ñ
3ñ	Ð ñ" C¨$¡Jð "¸$¸s¹)õ "ñ(˜cð ¨Sð ÀcÈDÁjð Ð\`õ ñ. 3ð ¸CÀ$¹Jð ÐRVõ ð6 Sð ¨T°#©Yõ r7   