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

Method _authorize_ssh

salt/netapi/__init__.py:147–171  ·  view source on GitHub ↗
(self, low)

Source from the content-addressed store, hash-verified

145 )
146
147 def _authorize_ssh(self, low):
148 auth_type, err_name, key, sensitive_load_keys = self._prep_auth_info(low)
149 auth_check = self.loadauth.check_authentication(low, auth_type, key=key)
150 auth_list = auth_check.get("auth_list", [])
151 error = auth_check.get("error")
152 if error:
153 raise salt.exceptions.EauthAuthenticationError(error)
154 delimiter = low.get("kwargs", {}).get("delimiter", DEFAULT_TARGET_DELIM)
155 _res = self.ckminions.check_minions(
156 low["tgt"], low.get("tgt_type", "glob"), delimiter
157 )
158 minions = _res.get("minions", list())
159 missing = _res.get("missing", list())
160 authorized = self.ckminions.auth_check(
161 auth_list,
162 low["fun"],
163 low.get("arg", []),
164 low["tgt"],
165 low.get("tgt_type", "glob"),
166 minions=minions,
167 )
168 if not authorized:
169 raise salt.exceptions.EauthAuthenticationError(
170 "Authorization error occurred."
171 )
172
173 def run(self, low):
174 """

Callers 1

runMethod · 0.95

Calls 6

_prep_auth_infoMethod · 0.95
check_authenticationMethod · 0.80
auth_checkMethod · 0.80
listFunction · 0.50
getMethod · 0.45
check_minionsMethod · 0.45

Tested by

no test coverage detected