HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/mine.cpython-310.pyc
o

�N�g��@sHdZddlZddlZe�e�ZdZdZdZ	dd�Z
ddd	�Zd
d�ZdS)
z6
This module contains routines used for the salt mine
�NZ__saltmine_acl__�Z__data__cCs8|�|i��|g�}|o||v}|rt�d|||�|S)aH
    Helper function to determine if a ``req_minion`` is not allowed to retrieve
    ``mine_function``-data from the mine of ``mine_minion``.

    :param dict minion_acl_cache: Contains minion_id as first level key, and mine
        function as 2nd level key. Value of 2nd level is a list of minions that
        are allowed to retrieve the function from the mine of the minion.
    :param str mine_minion: The minion that the mine value originated from.
    :param str mine_function: The mine function that is requested.
    :param str req_minion: The minion that is requesting the mine data.

    :rtype: bool
    :return:
        False if no ACL has been defined for ``mine_minion``, ``mine_function``.
        False if an ACL has been defined and it grants access.
        True if an ACL has been defined and does not grant access.
    z>Salt mine request from %s for function %s on minion %s denied.)�get�log�debug)Zminion_acl_cacheZmine_minion�
mine_functionZ
req_minionZminion_acl_entry�ret�r�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/mine.py�minion_side_acl_denieds�r
cCs.t|tti}|r|�tjj�||d���|S)a�
    Helper function to convert an non-ACL mine entry into the new entry which
    includes ACL data.

    :param dict function_data: The function data to wrap.
    :param str allow_tgt: The targeting string that designates which minions can
        request this mine entry.
    :param str allow_tgt_type: The type of targeting string.
        .. seealso:: :ref:`targeting`

    :rtype: dict
    :return: Mine entry structured to include ACL data.
    ��	allow_tgt�allow_tgt_type)�MINE_ITEM_ACL_DATA�MINE_ITEM_ACL_ID�MINE_ITEM_ACL_VERSION�update�salt�utils�data�
filter_falsey)Z
function_datarr
�resrrr	�wrap_acl_structure.s���rcCs�d}g}i}i}t|t�r|�dd�}|}n t|t�r6|D]}t|t�r*|�|�q|�|�q|�dd�}tjj�	|�dd�|�dd�d��}||||fS)a@
    Helper function to parse the mine_function definition as provided in config,
    or pillar.

    :param function_definition: The function definition to parse.
    :type function_definition: list or dict

    :rtype: tuple
    :return: Tuple with function_name, function_args, function_kwargs, minion_acl (dict)
    Nrrr
r)
�
isinstance�dict�pop�listr�appendrrrr)Zfunction_definitionZ
function_nameZ
function_argsZfunction_kwargsZ
minion_acl�itemrrr	�parse_function_definitionJs&




��r)NN)
�__doc__�loggingZsalt.utils.datar�	getLogger�__name__rrrrr
rrrrrr	�<module>s