mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #42709 from whiteinge/doc-token_expire_user_override
Add token_expire_user_override link to auth runner docstring
This commit is contained in:
commit
d2b6ce327a
@ -17,16 +17,28 @@ import salt.netapi
|
|||||||
|
|
||||||
|
|
||||||
def mk_token(**load):
|
def mk_token(**load):
|
||||||
'''
|
r'''
|
||||||
Create an eauth token using provided credentials
|
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:
|
CLI Example:
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
salt-run auth.mk_token username=saltdev password=saltdev eauth=auto
|
salt-run auth.mk_token username=saltdev password=saltdev eauth=auto
|
||||||
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
|
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.
|
# This will hang if the master daemon is not running.
|
||||||
netapi = salt.netapi.NetapiClient(__opts__)
|
netapi = salt.netapi.NetapiClient(__opts__)
|
||||||
|
Loading…
Reference in New Issue
Block a user