-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
Ì\,Tc @ s¥ d Z d d l m Z d d l m Z d d l m Z m Z d d l Z d d l Z d Z
d a a
a d „ Z d „ Z d „ Z e e ƒ d
„ ƒ Z d „ Z d S( 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ÿÿÿÿ( t _( t passwordmgr( t httpconnectiont utilNi€ c C se | j j ƒ s' t j t d ƒ ƒ ‚ n d | k r@ d | } n d | } t j d t | f ƒ d S( Ns factotum not interactives user=s %s user?s
%s !password?s
%s -g '%s'( t uit interactiveR t AbortR t ost systemt _executable( t selft params( ( s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyt auth_getkey9 s
c C s d | } x÷ t rt j d t t j ƒ } z¶ yƒ t j | d | ƒ t j | t ƒ j ƒ } | d d k r± t j | d ƒ t j | t ƒ j ƒ } | d d k r± | d Sn Wn, t t
f k
rà t j t
d ƒ ƒ ‚ n XWd t j | ƒ X| | | ƒ q
Wd S( Ns
proto=pass %ss %s/rpcs start %si t okt readi s factotum not responding( t TrueR t opent _mountpointt O_RDWRt writeR t ERRMAXt splitt OSErrort IOErrorR R R t close( R
t getkeyR t fdt l( ( s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyt auth_getuserpasswdA s
c s ‡ f d † } | S( Nc s t ˆ | j | ƒ | S( N( t setattrt __name__( t func( t cls( s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyt decoratorU s ( ( R R! ( ( R s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyt monkeypatch_methodT s c
C sI t j j | | | ƒ \ } } | rD | rD | j | | ƒ | | f Sd } t j | j | | ƒ } | r¥ | \ } } | j d ƒ } | j d ƒ | j d ƒ } } n | s³ | r| sÕ | j d ƒ d j ƒ } n d t
| f } | rþ d | | f } n t | t | ƒ \ } } n | j
| | | | ƒ | j | | ƒ | | f S( Nt t prefixt usernamet passwordt i s service=%s prefix=%ss
%s user=%s( t urllib2t HTTPPasswordMgrWithDefaultRealmt find_user_passwordt _writedebugR t readauthforuriR t getR t lowert _serviceR R t add_password(
R
t realmt authurit usert passwdR$ t resR t authR ( ( s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyR* Z s*
"c C sC | j d d d ƒ a | j d d d ƒ a | j d d d ƒ a d S( Nt factotumt
executables /bin/auth/factotumt
mountpoints
/mnt/factotumt servicet hg( t configR R R/ ( R ( ( s2 /usr/lib/python2.7/dist-packages/hgext/factotum.pyt uisetupt s ( t __doc__t mercurial.i18nR t
mercurial.urlR t mercurialR R R R( R t NoneR R R/ R R R"