\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A ó 1è3\c@@sdZddlmZddlZddlmZddlmZddlm Z m Z m Z m Z m Z e jZe jZdZdaaaiZe jeƒ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= user= !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'( tuit interactiveRtAbortRtostsystemRt tonativestrt _executable(tselftparams((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pyt auth_getkeySs    cC@sgd|}xVtrbtjdttjƒ}zyâtj|d|ƒtj|tƒjƒ}|ddkrtj|dƒtj|tƒjddƒ\}}}|dkr|j dƒr|j dƒrë|d d !j d dƒ}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 R R (tconfigRRRA(R((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pytuisetup‘s(t__doc__t __future__RRtmercurial.i18nRtmercurial.utilsRt mercurialRRRRRturlreqt passwordmgrR R"RRRAt configtablet configitemRR/R5R<RH(((s4/usr/lib64/python2.7/site-packages/hgext/factotum.pyt.s, (