MCPcopy Create free account
hub / github.com/saltstack/salt / _prep_auth_info

Method _prep_auth_info

salt/netapi/__init__.py:130–145  ·  view source on GitHub ↗
(self, clear_load)

Source from the content-addressed store, hash-verified

128 return os.path.exists(os.path.join(self.opts["sock_dir"], ipc_file))
129
130 def _prep_auth_info(self, clear_load):
131 sensitive_load_keys = []
132 key = None
133 if "token" in clear_load:
134 auth_type = "token"
135 err_name = "TokenAuthenticationError"
136 sensitive_load_keys = ["token"]
137 return auth_type, err_name, key, sensitive_load_keys
138 elif "eauth" in clear_load:
139 auth_type = "eauth"
140 err_name = "EauthAuthenticationError"
141 sensitive_load_keys = ["username", "password"]
142 return auth_type, err_name, key, sensitive_load_keys
143 raise salt.exceptions.EauthAuthenticationError(
144 "No authentication credentials given"
145 )
146
147 def _authorize_ssh(self, low):
148 auth_type, err_name, key, sensitive_load_keys = self._prep_auth_info(low)

Callers 1

_authorize_sshMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected