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/runners/__pycache__/auth.cpython-310.pyc
o

�N�g��@s8dZddlZddlZddlZddlZdd�Zdd�ZdS)zh
Authentication runner for creating, deleting, and managing eauth tokens.

.. versionadded:: 2016.11.0

�NcKs6tj�t�}|��stj�d��tj�t�}|�	|�S)ah
    Create an eauth token using provided credentials

    Non-root users may specify an expiration date -- if allowed via the
    :conf_master:`token_expire_user_override` setting -- by passing an
    additional ``token_expire`` param. This overrides the
    :conf_master:`token_expire` setting of the same name in the Master config
    and is how long a token should live in seconds.

    CLI Example:

    .. code-block:: shell

        salt-run auth.mk_token username=saltdev password=saltdev eauth=auto

        # Create a token valid for three years.
        salt-run auth.mk_token username=saltdev password=saltdev eauth=auto \
            token_expire=94670856

        # Calculate the number of seconds using expr.
        salt-run auth.mk_token username=saltdev password=saltdev eauth=auto \
            token_expire=$(expr \( 365 \* 24 \* 60 \* 60 \) \* 3)
    zSalt Master must be running.)
�salt�netapiZNetapiClient�__opts__Z_is_master_running�
exceptionsZSaltDaemonNotRunning�authZResolver�mk_token)�loadrr�r	�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/auth.pyrs

rcCs0tj�td|�}tj�|�rt�|�duSdS)z�
    Delete an eauth token by name

    CLI Example:

    .. code-block:: shell

        salt-run auth.del_token 6556760736e4077daa601baec2b67c24
    Z	token_dirNF)�os�path�joinr�exists�remove)�tokenZ
token_pathr	r	r
�	del_token0s
r)�__doc__rZ	salt.authrZsalt.exceptionsZsalt.netapirrr	r	r	r
�<module>s!