HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/proc/thread-self/root/lib64/python2.7/site-packages/hgext/factotum.pyc
�
1�3\c@@sdZddlmZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
e
jZejZdZdaaaiZeje�Zedd	d
d�eddd
d
�eddd
d�d�Zd�Zd�Zee�d��Zd�ZdS(s�http authentication with factotum

This extension allows the factotum(4) facility on Plan 9 from Bell Labs
platforms to provide authentication information for HTTP access. Configuration
entries specified in the auth section as well as authentication information
provided in the repository URL are fully supported. If no prefix is specified,
a value of "*" will be assumed.

By default, keys are specified as::

  proto=pass service=hg prefix=<prefix> user=<username> !password=<password>

If the factotum extension is unable to read the required key, one will be
requested interactively.

A configuration section is available to customize runtime behavior. By
default, these entries are::

  [factotum]
  executable = /bin/auth/factotum
  mountpoint = /mnt/factotum
  service = hg

The executable entry defines the full path to the factotum binary. The
mountpoint entry defines the path to the factotum file service. Lastly, the
service entry controls the service name used when reading keys.

i(tabsolute_importN(t_(tprocutil(terrorthttpconnectiont	registrarturltutili�tfactotumt
executabletdefaults/bin/auth/factotumt
mountpoints
/mnt/factotumtservicethgcC@sn|jj�s'tjtd���nd|kr@d|}nd|}tjtjdt	|f��dS(Nsfactotum not interactivesuser=s%s user?s
%s !password?s
%s -g '%s'(
tuitinteractiveRtAbortRtostsystemRttonativestrt_executable(tselftparams((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pytauth_getkeySs

cC@sgd|}xVtrbtjdttj�}zy�tj|d|�tj|t�j�}|ddkrtj|d�tj|t�jdd�\}}}|dkr|j
d�r|jd�r�|d	d
!jdd�}qt
jtd���n||fSnWn,ttfk
r?t
jtd
���nXWdtj|�X|||�q
WdS(Ns
proto=pass %ss%s/rpcsstart %sitoktreadit'ii����s''smalformed password stringsfactotum not responding(tTrueRtopent_mountpointtO_RDWRtwriteRtERRMAXtsplittNonet
startswithtendswithtreplaceRRRtOSErrortIOErrortclose(RtgetkeyRtfdtltstatustusertpasswd((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pytauth_getuserpasswd[s(
	'c@s�fd�}|S(Nc@st�|j|�|S(N(tsetattrt__name__(tfunc(tcls(s4/usr/lib64/python2.7/site-packages/hgext/factotum.pyt	decoratorss((R3R4((R3s4/usr/lib64/python2.7/site-packages/hgext/factotum.pytmonkeypatch_methodrsc
C@sF|jj||�\}}|rA|rA|j||�||fSd}tj|j||�}|r�|\}}|jd�}|jd�|jd�}}n|s�|r|s�|jd�dj�}ndt	|f}	|r�d|	|f}	nt
|t|	�\}}n|j||||�|j||�||fS(	Nttprefixtusernametpasswordt isservice=%s prefix=%ss
%s user=%s(
tpasswddbtfind_user_passwordt_writedebugRtreadauthforuriRtgetR!tlowert_serviceR/Rtadd_password(
RtrealmtauthuriR-R.R7tresRtauthR((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pyR<xs(
"cC@s:|jdd�a|jdd�a|jdd�adS(NRR	RR(tconfigRRRA(R((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pytuisetup�s(t__doc__t
__future__RRtmercurial.i18nRtmercurial.utilsRt	mercurialRRRRRturlreqtpasswordmgrR R"RRRAtconfigtablet
configitemRR/R5R<RH(((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pyt<module>.s,(