003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/salt/runners
usr
/
local
/
lib
/
python3.8
/
site-packages
/
salt
/
runners
/
📁
..
📄
__init__.py
(26 B)
📁
__pycache__
📄
asam.py
(11.2 KB)
📄
auth.py
(1.69 KB)
📄
bgp.py
(17.5 KB)
📄
cache.py
(12.72 KB)
📄
cloud.py
(4.18 KB)
📄
config.py
(913 B)
📄
ddns.py
(8.89 KB)
📄
digicertapi.py
(21.63 KB)
📄
doc.py
(1.39 KB)
📄
drac.py
(5.29 KB)
📄
error.py
(545 B)
📄
event.py
(2.1 KB)
📄
f5.py
(9.58 KB)
📄
fileserver.py
(17.37 KB)
📄
git_pillar.py
(3.98 KB)
📄
http.py
(2.35 KB)
📄
jobs.py
(17.45 KB)
📄
launchd.py
(1.35 KB)
📄
lxc.py
(18.14 KB)
📄
manage.py
(25.84 KB)
📄
mattermost.py
(4.68 KB)
📄
mine.py
(1.68 KB)
📄
nacl.py
(8.15 KB)
📄
net.py
(38.97 KB)
📄
network.py
(2.42 KB)
📄
pagerduty.py
(4.5 KB)
📄
pillar.py
(5.14 KB)
📄
pkg.py
(1.35 KB)
📄
queue.py
(8.88 KB)
📄
reactor.py
(4.97 KB)
📄
salt.py
(4.69 KB)
📄
saltutil.py
(21.5 KB)
📄
sdb.py
(2.14 KB)
📄
smartos_vmadm.py
(11.73 KB)
📄
spacewalk.py
(9.8 KB)
📄
ssh.py
(771 B)
📄
state.py
(8.88 KB)
📄
survey.py
(5.84 KB)
📄
test.py
(1.75 KB)
📄
thin.py
(1.74 KB)
📄
vault.py
(10.09 KB)
📄
venafiapi.py
(6.68 KB)
📄
virt.py
(17.59 KB)
📄
vistara.py
(5.6 KB)
📄
winrepo.py
(8.57 KB)
Editing: auth.py
""" Authentication runner for creating, deleting, and managing eauth tokens. .. versionadded:: 2016.11.0 """ import os import salt.auth import salt.exceptions import salt.netapi def mk_token(**load): r""" 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) """ # This will hang if the master daemon is not running. netapi = salt.netapi.NetapiClient(__opts__) if not netapi._is_master_running(): raise salt.exceptions.SaltDaemonNotRunning("Salt Master must be running.") auth = salt.auth.Resolver(__opts__) return auth.mk_token(load) def del_token(token): """ Delete an eauth token by name CLI Example: .. code-block:: shell salt-run auth.del_token 6556760736e4077daa601baec2b67c24 """ token_path = os.path.join(__opts__["token_dir"], token) if os.path.exists(token_path): return os.remove(token_path) is None return False
Upload File
Create Folder