o
    j                  	   @   sf   d dl Z d dlZd dlmZmZ d dlmZ ddedededefd	d
Z	dd Z
edkr1e
  dS dS )    N)KerberosClientFactorykerberos_url_help_epilog)KirbiFkerberos_url	kirbifile
ccachefilenopacc                    s   t | }| }td |j|dI d H  |d ur(|j| td|  t	
|j|j}tt| |d ur?|| td d S )NzGetting TGT)with_paczTGT stored in ccache file %szDone!)r   from_url
get_clientloggingdebugget_TGTccacheto_fileprintr   from_ticketdatakerberos_TGTkerberos_TGT_encpartstrinfo)r   r   r   r   cuclientkirbi r   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/minikerberos/examples/getTGT.pygetTGT   s   


r   c                  C   s   dd l } | jd| jtd}|jdddd |jdd	d
 |jddd
 |jddd
 |jddddd | }|jdkrDtjtj	d n|jdkrQtjtj
d ntjdd tt|j|j|j|j d S )Nr   z;Polls the kerberos service for a TGT for the sepcified user)descriptionformatter_classepilogz--nopacstore_falsezDon't request a PAC in the TGT)actionhelpz--ccachezQCCACHE file to store the TGT ticket in, otherwise kirbi will be printed to stdout)r"   z--kirbizPkirbi file to store the TGT ticket in, otherwise kirbi will be printed to stdoutr   zthe kerberos target string. z-vz	--verbosecount)r!   default)level   )argparseArgumentParserRawDescriptionHelpFormatterr   add_argument
parse_argsverboser   basicConfigINFODEBUGasynciorunr   r   r   r   r   )r'   parserargsr   r   r   main   s   

 r4   __main__)NNF)r   r0   minikerberos.common.factoryr   r   minikerberos.common.kirbir   r   boolr   r4   __name__r   r   r   r   <module>   s    
