MCPcopy
hub / github.com/saltstack/salt / token_cli

Method token_cli

salt/auth/__init__.py:787–803  ·  view source on GitHub ↗

Create the token from the CLI and request the correct data to authenticate via the passed authentication mechanism

(self, eauth, load)

Source from the content-addressed store, hash-verified

785 return ret
786
787 def token_cli(self, eauth, load):
788 """
789 Create the token from the CLI and request the correct data to
790 authenticate via the passed authentication mechanism
791 """
792 load["cmd"] = "mk_token"
793 load["eauth"] = eauth
794 tdata = self._send_token_request(load)
795 if "token" not in tdata:
796 return tdata
797 try:
798 with salt.utils.files.set_umask(0o177):
799 with salt.utils.files.fopen(self.opts["token_file"], "w+") as fp_:
800 fp_.write(tdata["token"])
801 except OSError:
802 pass
803 return tdata
804
805 def mk_token(self, load):
806 """

Callers 4

runMethod · 0.95
_init_authMethod · 0.95
_runMethod · 0.95
_run_batchMethod · 0.95

Calls 2

_send_token_requestMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected