ó
    Ö›‘h’   ã                   óä   • S r SSKrSSKJrJrJr  SSKJrJr  SSK	J
r
  SSKJr   " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      rSrS rS rS r " S S5      rg)z¨
Support for resolving command-line strings that represent different
checkers available to cred.

Examples:
 - passwd:/etc/passwd
 - memory:admin:asdf:user:lkj
 - unix
é    N)ÚOptionalÚSequenceÚType)Ú	AttributeÚ	Interface)Ú
getPlugins)Úusagec                   ó^   • \ rS rSrSr\" S5      r\" S5      r\" S5      r\" S5      r	S r
Srg	)
ÚICheckerFactoryé   zŠ
A factory for objects which provide
L{twisted.cred.checkers.ICredentialsChecker}.

It's implemented by twistd plugins creating checkers.
z0A tag that identifies the authentication method.zmA detailed (potentially multi-line) description of precisely what functionality this CheckerFactory provides.z=A short (one-line) description of the argument string format.z@A list of credentials interfaces that this factory will support.c                 ó   • g)ze
Return an L{twisted.cred.checkers.ICredentialsChecker} provider using the supplied
argument string.
N© )Ú	argstrings    ÚXC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/cred/strcred.pyÚgenerateCheckerÚICheckerFactory.generateChecker2   s   � ó    r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚauthTypeÚauthHelpÚargStringFormatÚcredentialInterfacesr   Ú__static_attributes__r   r   r   r   r      sG   † ññ ÐKÓL€Háð	;ó€Hñ
  ØGó€Oñ %ØJóÐõr   r   c                   ó   • \ rS rSrSrSrg)ÚStrcredExceptioné9   z#
Base exception class for strcred.
r   N©r   r   r   r   r   r   r   r   r   r   r   9   s   † ôr   r   c                   ó   • \ rS rSrSrSrg)ÚInvalidAuthTypeé?   zj
Raised when a user provides an invalid identifier for the
authentication plugin (known as the authType).
r   Nr!   r   r   r   r#   r#   ?   ó   † ôr   r#   c                   ó   • \ rS rSrSrSrg)ÚInvalidAuthArgumentStringéF   z`
Raised by an authentication plugin when the argument string
provided is formatted incorrectly.
r   Nr!   r   r   r   r'   r'   F   r%   r   r'   c                   ó   • \ rS rSrSrSrg)ÚUnsupportedInterfaceséM   z‡
Raised when an application is given a checker to use that does not
provide any of the application's supported credentials interfaces.
r   Nr!   r   r   r   r*   r*   M   r%   r   r*   z<WARNING: This authType is not supported by this application.c                  ó    • [        [        5      $ )z5
Find all objects that implement L{ICheckerFactory}.
)r   r   r   r   r   ÚfindCheckerFactoriesr-   Y   s   € ô ”oÓ&Ð&r   c                 ób   • [        5        H  nUR                  U :X  d  M  Us  $    [        U 5      e)zB
Find the first checker factory that supports the given authType.
)r-   r   r#   )r   Úfactorys     r   ÚfindCheckerFactoryr0   `   s1   € ô (Ö)ˆØ×Ñ˜xÕ'ØŠNñ *ô ˜(Ó
#Ð#r   c                 ót   • SU ;   a  U R                  SS5      u  pOU nSn[        U5      R                  U5      $ )z”
Returns an L{twisted.cred.checkers.ICredentialsChecker} based on the
contents of a descriptive string. Similar to
L{twisted.application.strports}.
Ú:é   Ú )Úsplitr0   r   )Údescriptionr   r   s      r   ÚmakeCheckerr7   j   sC   € ð ˆkÓØ)×/Ñ/°°QÓ7Ñˆ�)àˆØˆ	Ü˜hÓ'×7Ñ7¸	ÓBÐBr   c                   ó|   • \ rS rSr% SrSr\\\\	         \
S'   \R                  rS rS rS rS rS	 rS
 rS rSrg)ÚAuthOptionMixinéx   a+  
Defines helper methods that can be added on to any
L{usage.Options} subclass that needs authentication.

This mixin implements three new options methods:

The opt_auth method (--auth) will write two new values to the
'self' dictionary: C{credInterfaces} (a dict of lists) and
C{credCheckers} (a list).

The opt_help_auth method (--help-auth) will search for all
available checker plugins and list them for the user; it will exit
when finished.

The opt_help_auth_type method (--help-auth-type) will display
detailed help for a particular checker plugin.

@cvar supportedInterfaces: An iterable object that returns
   credential interfaces which this application is able to support.

@cvar authOutput: A writeable object to which this options class
    will send all help-related output. Default: L{sys.stdout}
NÚsupportedInterfacesc                 óH   • U R                   SL =(       d    XR                   ;   $ )zB
Returns whether a particular credentials interface is supported.
N)r;   )ÚselfÚ	interfaces     r   ÚsupportsInterfaceÚ!AuthOptionMixin.supportsInterface”   s#   € ð ×'Ñ'¨4Ð/×X°9×@XÑ@XÑ3XÐXr   c                 óZ   • UR                    H  nU R                  U5      (       d  M    g   g)zo
Returns whether a checker factory will provide at least one of
the credentials interfaces that we care about.
TF)r   r?   ©r=   r/   r>   s      r   ÚsupportsCheckerFactoryÚ&AuthOptionMixin.supportsCheckerFactoryš   s-   € ð
 !×5Ô5ˆIØ×%Ñ% i×0Ó0Ùñ 6ð r   c                 óš  • / nU R                   c  UR                  nO<UR                   H,  nU R                  U5      (       d  M  UR                  U5        M.     U(       d  [	        UR                  5      eSU ;  a  0 U S'   SU ;  a  / U S'   U S   R                  U5        U H'  nU S   R                  U/ 5      R                  U5        M)     g)z=
Supply a supplied credentials checker to the Options class.
NÚcredInterfacesÚcredCheckers)r;   r   r?   Úappendr*   Ú
setdefault)r=   ÚcheckerÚ	supportedr>   s       r   Ú
addCheckerÚAuthOptionMixin.addChecker¤   sÈ   € ð
 ˆ	Ø×#Ñ#Ñ+Ø×4Ñ4‰Ià$×9Ô9�	Ø×)Ñ)¨)×4Ó4Ø×$Ñ$ YÖ/ñ :ö Ü'¨×(DÑ(DÓEÐEà 4Ó'Ø%'ˆDÐ!Ñ"Ø Ó%Ø#%ˆD�Ñ Øˆ^Ñ×#Ñ# GÔ,Û"ˆIØÐ!Ñ"×-Ñ-¨i¸Ó<×CÑCÀGÖLò #r   c                 ó\  •  U R                  [        U5      5        g! [         a+  n[        R                  " SUR
                  S   -  5      eSnAf[         a+  n[        R                  " SUR
                  S   -  5      eSnAf[         a  n[        R                  " SU-  5      eSnAff = f)z2
Specify an authentication method for the server.
zAuth plugin not supported: %sr   NzAuth plugin not recognized: %szUnexpected error: %s)rL   r7   r*   r	   Ú
UsageErrorÚargsr#   Ú	Exception)r=   r6   Úes      r   Úopt_authÚAuthOptionMixin.opt_auth»   s‘   € ð	?Ø�O‰OœK¨Ó4Õ5øÜ$ó 	PÜ×"Ò"Ð#BÀQÇVÁVÈAÁYÑ#NÓOÐOûÜó 	QÜ×"Ò"Ð#CÀaÇfÁfÈQÁiÑ#OÓPÐPûÜó 	?Ü×"Ò"Ð#9¸AÑ#=Ó>Ð>ûð	?ús,   ‚ �
B+§&AÁB+Á&B Â B+ÂB&Â&B+c              #   óŽ   #   • [        5        H3  nUR                   H   nU R                  U5      (       d  M  Uv •    M1     M5     g7f)zt
Return a list of which authTypes will be displayed by --help-auth.
This makes it a lot easier to test this module.
N)r-   r   r?   rB   s      r   Ú_checkerFactoriesForOptHelpAuthÚ/AuthOptionMixin._checkerFactoriesForOptHelpAuthÈ   s=   é € ô
 ,Ö-ˆGØ$×9Ô9�	Ø×)Ñ)¨)×4Ó4Ø!’MÚó :ò .ùs
   ‚1A·Ac                 ó˜  • U R                   R                  S5        U R                   R                  S5        U R                   R                  S5        SnU R                  5        H3  n[        UR                  5      U:”  d  M  [        UR                  5      nM5     SU-  nU R                   R                  US-  5        U R                   R                  US-  5        U R                  5        H6  nU R                   R                  X2R                  UR
                  4-  5        M8     U R                   R                  S5        [        S5      e)z,
Show all authentication methods available.
z#Usage: --auth AuthType[:ArgString]
z-For detailed help: --help-auth-type AuthType
Ú
r   z  %%-%is	%%s
)ÚAuthTypezArgString format)z========z================)Ú
authOutputÚwriterV   Úlenr   r   Ú
SystemExit)r=   ÚfirstLengthr/   ÚformatStrings       r   Úopt_help_authÚAuthOptionMixin.opt_help_authÓ   s  € ð 	�‰×ÑÐDÔEØ�‰×ÑÐNÔOØ�‰×Ñ˜dÔ#àˆØ×;Ñ;Ö=ˆGÜ�7×#Ñ#Ó$ {Õ2Ü! '×"2Ñ"2Ó3’ñ >ð )¨;Ñ6ˆØ�‰×Ñ˜lÐ-MÑMÔNØ�‰×Ñ˜lÐ-MÑMÔNØ×;Ñ;Ö=ˆGØ�O‰O×!Ñ!Ø× 0Ñ 0°'×2IÑ2IÐJÑJöñ >ð 	�‰×Ñ˜dÔ#Ü˜‹mÐr   c                 óÒ  •  [        U5      nU R                  R                  SU-  5        U R                  R                  SUR                  -  5        U R                  R                  S5        UR                  R                  5       R                  5        H/  nU R                  R                  SUR                  5       -  5        M1     U R                  R                  S5        U R                  U5      (       d=  U R                  R                  S[        -  5        U R                  R                  S5        [        S5      e! [         a    [        R                  " SU-  5      ef = f)z1
Show help for a particular authentication type.
zInvalid auth type: %szUsage: --auth %s[:ArgString]
zArgString format: %s
rY   z  %s
r   )r0   r#   r	   rO   r[   r\   r   r   ÚstripÚ
splitlinesÚrstriprC   ÚnotSupportedWarningr^   )r=   r   ÚcfÚlines       r   Úopt_help_auth_typeÚ"AuthOptionMixin.opt_help_auth_typeé   s  € ð	GÜ# HÓ-ˆBð 	�‰×ÑÐ>ÀÑIÔJØ�‰×ÑÐ6¸×9KÑ9KÑKÔLØ�‰×Ñ˜dÔ#Ø—K‘K×%Ñ%Ó'×2Ñ2Ö4ˆDØ�O‰O×!Ñ! (¨T¯[©[«]Ñ":Ö;ñ 5à�‰×Ñ˜dÔ#Ø×*Ñ*¨2×.Ñ.Ø�O‰O×!Ñ! (Ô-@Ñ"@ÔAØ�O‰O×!Ñ! $Ô'Ü˜‹mÐøô ó 	GÜ×"Ò"Ð#:¸XÑ#EÓFÐFð	Gús   ‚E Å$E&r   )r   r   r   r   r   r;   r   r   r   r   Ú__annotations__ÚsysÚstdoutr[   r?   rC   rL   rS   rV   ra   rj   r   r   r   r   r9   r9   x   sR   ‡ ñð0 @DÐ˜ (¨4°	©?Ñ";Ñ<ÓCØ—‘€JòYòòMò.?ò	òõ,r   r9   )r   rm   Útypingr   r   r   Úzope.interfacer   r   Útwisted.pluginr   Útwisted.pythonr	   r   rQ   r   r#   r'   r*   rg   r-   r0   r7   r9   r   r   r   Ú<module>rs      s‚   ðñó ß +Ñ +ç /å %Ý  ô�iô ô<�yô ôÐ&ô ôÐ 0ô ôÐ,ô ð XÐ ò'ò$òC÷Bò Br   