%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/samba/netcmd/domain/auth/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/samba/netcmd/domain/auth/__pycache__/silo.cpython-312.pyc

�

�I�d�:����ddlmZddlmZmZmZmZddlm	Z	m
Z
ddlmZddl
mZGd�de�ZGd	�d
e�ZGd�de�ZGd
�de�ZGd�de�ZGd�de�Zy)�N)�Command�CommandError�Option�SuperCommand)�AuthenticationPolicy�AuthenticationSilo)�
ModelError�)�cmd_domain_auth_silo_memberc��eZdZdZdZejejd�Ze	ddde
dd�	�e	d
ddd
d��gZ		dd�Zy)�cmd_domain_auth_silo_listz(List authentication silos on the domain.�%prog -H <URL> [options]��	sambaopts�credopts�-H�--URL�&LDB URL for database or target server.�URL�ldap_url��help�type�metavar�destz--jsonzOutput results in JSON format.�
output_format�store_const�json)rr�action�constNc�x�|j|||�}	tj|�D�cic]}|j|j	���}}|dk(r|j|�y|j�D] }|jj|�d���"ycc}w#t
$r}t
|��d}~wwxYw)Nr�
)�ldb_connectr�query�cn�as_dictr	r�
print_json�keys�outf�write)	�selfrrrr�ldb�silo�silos�es	         �?/usr/lib/python3/dist-packages/samba/netcmd/domain/auth/silo.py�runzcmd_domain_auth_silo_list.run0s������x��H�=��	"�!3�!9�!9�#�!>�@���W�W�d�l�l�n�,�@�E�@��F�"��O�O�E�"��
�
��
-���	�	���4�&���,�
-��@���	"��q�/�!��	"�s(�B �"B�B �B � 	B9�)B4�4B9�NNNN�
�__name__�
__module__�__qualname__�__doc__�synopsis�options�SambaOptions�CredentialsOptions�takes_optiongroupsr�str�
takes_optionsr1��r0r
r
sg��2�)�H��)�)��.�.���	�t�W�#K���Z�	9��x�>�#�M��	I��M�;?��-r@r
c��eZdZdZdZejejd�Ze	ddde
dd�	�e	d
ddd
e
��gZdd�Zy)�cmd_domain_auth_silo_viewz*View an authentication silo on the domain.rrrrrrrr�--namez/Name of authentication silo to view (required).�name�store�rrrrNc��|std��|j|||�}	tj||��}|�td|�d���|j|j
��y#t$r}t|��d}~wwxYw)N�Argument --name is required.�r%�Authentication silo � not found.)rr#r�getr	r'r&)r+rrrrDr,r-r/s        r0r1zcmd_domain_auth_silo_view.runVs�����=�>�>����x��H�=��	"�%�)�)�#�$�7�D�
�<��!5�d�V�;�G�H�H�	
�������'���	"��q�/�!��	"�s�A*�*	B�3A>�>Br2r3r?r@r0rBrBDs^��4�)�H��)�)��.�.���	�t�W�#K���Z�	9��x�E��7��	6��M�(r@rBc�l�eZdZdZdZejejd�Ze	ddde
dd�	�e	d
ddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	ddd d!�"�e	d#d$d%d!�"�e	d&d'd(d!�"�e	d)d*d+d!�"�gZed,��Z
				d/d.�Zy-)0�cmd_domain_auth_silo_createz/Create a new authentication silo on the domain.rrrrrrrrrC�'Name of authentication silo (required).rDrErF�
--description�-Optional description for authentication silo.�description�--policyz2Use single policy for all principals in this silo.�policy�
--user-policyzUser account policy.�user_policy�--service-policyzManaged Service Account policy.�service_policy�--computer-policyzComputer account policy.�computer_policy�	--protect�5Protect authentication silo from accidental deletion.�protect�
store_true�rrr�--unprotect�7Unprotect authentication silo from accidental deletion.�	unprotect�--audit�Only audit silo policies.�audit�	--enforce�Enforce silo policies.�enforcec�t�	tj||�S#ttf$r}t	|��d}~wwxYw�z�Helper function to fetch auth policy or raise CommandError.

        :param ldb: Ldb connection
        :param name: Either the DN or name of authentication policy
        N)r�lookup�LookupError�
ValueErrorr�r,rDr/s   r0�
get_policyz&cmd_domain_auth_silo_create.get_policy�s9��	"�'�.�.�s�D�9�9���Z�(�	"��q�/�!��	"�s��7�2�7Nc��|std��|
r
|rtd��|r
|
rtd��|�|xs|}|xs|}|	xs|}	|j|||�}	tj||��}|�td|�d���t||��}|r!|j||�j|_|r!|j||�j|_|	r!|j||	�j|_	|
�|
|_
n||_
	|j|�|
r|j|�|jjd|�d	��y#t$r}t|��d}~wwxYw#t$r}t|��d}~wwxYw)
NrH�2--protect and --unprotect cannot be used together.�.--audit and --enforce cannot be used together.rIrJz already exists.)r%rRzCreated authentication silo: r")rr#rrLr	ro�dnrVrXrZ�enforced�saver]r)r*�r+rrrrDrRrTrVrXrZr]rbrerhr,r-r/s                 r0r1zcmd_domain_auth_silo_create.run�s���
��=�>�>��y��S�T�T��W��O�P�P���%�/��K�+�5�v�N�-�7��O����x��H�=��	"�%�)�)�#�$�7�D�
���!5�d�V�;K�L�M�M�"�T�{�C���#���s�K�@�C�C�D���"&�/�/�#�~�"F�"I�"I�D���#'�?�?�3��#H�#K�#K�D� ���#�D�M� %�I�D�M�	"��I�I�c�N�����S�!�
	
�	�	���7��v�R�@�A��O�	"��q�/�!��	"��F�	"��q�/�!��	"�s0�E	�$E%�		E"�E�E"�%	E>�.E9�9E>�
NNNNNNNNNNNNN�r4r5r6r7r8r9r:r;r<rr=r>�staticmethodror1r?r@r0rNrNjsD��9�)�H��)�)��.�.���	�t�W�#K���Z�	9��x�G��7��	6���C�!�'��	=�	�z�H��W�3�	8�	��*�!�'��	=�	�!�5�$�W�3�	@�	�"�.�%�g�C�	A�	�{�K��l�	4�	�}�M���	6�	�y�/��L�	2�	�{�,��l�	4�; �M�D�	"��	"�FJ�7;�?C�04�>Br@rNc�l�eZdZdZdZejejd�Ze	ddde
dd�	�e	d
ddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	dddd
e
��e	ddd d!�"�e	d#d$d%d!�"�e	d&d'd(d!�"�e	d)d*d+d!�"�gZed,��Z
				d/d.�Zy-)0�cmd_domain_auth_silo_modifyz,Modify an authentication silo on the domain.rrrrrrrrrCrOrDrErFrPrQrRrSz2Set single policy for all principals in this silo.rTrUzSet User account policy.rVrWz#Set Managed Service Account policy.rXrYzSet Computer Account policy.rZr[r\r]r^r_r`rarbrcrdrerfrgrhc�~�	tj||�S#tttf$r}t|��d}~wwxYwrj)rrkrlr	rmrrns   r0roz&cmd_domain_auth_silo_modify.get_policys;��	"�'�.�.�s�D�9�9���Z��4�	"��q�/�!��	"�s��<�7�<Nc�r�|std��|r
|
rtd��|
r
|rtd��|�|xs|}|xs|}|	xs|}	|j|||�}	tj||��}|�td|�d���|
rd|_n	|rd|_|�||_|d	k(rd|_n#|r!|j||�j|_|d	k(rd|_
n#|r!|j||�j|_
|	d	k(rd|_n#|	r!|j||	�j|_	|j|�|
r|j|�n|r|j|�|jj!d
|�d��y#t$r}t|��d}~wwxYw#t$r}t|��d}~wwxYw)NrHrrrqrIrJrKTF�zUpdated authentication silo: r")rr#rrLr	rtrRrVrorsrXrZrur]rbr)r*rvs                 r0r1zcmd_domain_auth_silo_modify.runs���
��=�>�>��W��O�P�P��y��S�T�T���%�/��K�+�5�v�N�-�7��O����x��H�=��	"�%�)�)�#�$�7�D�
�<��!5�d�V�;�G�H�H�� �D�M�
�!�D�M��"�*�D���"��#�D��
�#���s�K�@�C�C�D���R��"&�D��
�"&�/�/�#�~�"F�"I�"I�D���b� �#'�D� �
�#'�?�?�3��#H�#K�#K�D� �	"��I�I�c�N�����S�!�����s�#�
	
�	�	���7��v�R�@�A��_�	"��q�/�!��	"��V�	"��q�/�!��	"�s0�F�)8F�	F�
F�F�	F6�&F1�1F6rwrxr?r@r0r{r{�sE��6�)�H��)�)��.�.���	�t�W�#K���Z�	9��x�G��7��	6���C�!�'��	=�	�z�H��W�3�	8�	��.�!�'��	=�	�!�9�$�W�3�	@�	�"�2�%�g�C�	A�	�{�K��l�	4�	�}�M���	6�	�y�/��L�	2�	�{�,��l�	4�; �M�D�	"��	"�FJ�7;�?C�04�FBr@r{c��eZdZdZdZejejd�Ze	ddde
dd�	�e	d
ddd
e
��e	dddd��gZ		dd�Zy)�cmd_domain_auth_silo_deletez,Delete an authentication silo on the domain.rrrrrrrrrCrOrDrErFz--forcez+Force delete protected authentication silo.�forcer^r_Nc��|std��|j|||�}	tj||��}|�td|�d���	|r|j|�|j
|�|jjd|�d��y#t$r}t|��d}~wwxYw#t$r }|st|�d���t|��d}~wwxYw)NrHrIrJrKz6
Try --force to delete protected authentication silos.zDeleted authentication silo: r")	rr#rrLr	rb�deleter)r*)	r+rrrrDr�r,r-r/s	         r0r1zcmd_domain_auth_silo_delete.runws�����=�>�>����x��H�=��	"�%�)�)�#�$�7�D�
�<��!5�d�V�;�G�H�H�
	&�����s�#��K�K���	
�	�	���7��v�R�@�A��+�	"��q�/�!��	"���	&��"��c�P�Q�S�S�#�1�o�%��	&�s/�B�$B+�	B(�B#�#B(�+	C�4C�C)NNNNNr3r?r@r0r�r�ds{��6�)�H��)�)��.�.���	�t�W�#K���Z�	9��x�G��7��	6��y�L��L�	2��M�FJ��Br@r�c�^�eZdZdZe�e�e�e�e�e	�d�Z
y)�cmd_domain_auth_siloz*Manage authentication silos on the domain.)�list�view�create�modifyr��memberN)r4r5r6r7r
rBrNr{r�r�subcommandsr?r@r0r�r��s2��4�*�+�)�+�-�/�-�/�-�/�-�/�
�Kr@r�)�samba.getopt�getoptr9�samba.netcmdrrrr�samba.netcmd.domain.modelsrr�%samba.netcmd.domain.models.exceptionsr	�silo_memberrr
rBrNr{r�r�r?r@r0�<module>r�sp��.�D�D�O�<�4�"-��"-�J#(��#(�LvB�'�vB�r~B�'�~B�B2B�'�2B�j
�<�
r@

Zerion Mini Shell 1.0