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

Method authenticate_token

salt/auth/__init__.py:498–510  ·  view source on GitHub ↗

Authenticate a user by the token specified in load. Return the token object or False if auth failed.

(self, load)

Source from the content-addressed store, hash-verified

496 self.cache.clean_expired("tokens")
497
498 def authenticate_token(self, load):
499 """
500 Authenticate a user by the token specified in load.
501 Return the token object or False if auth failed.
502 """
503 token = self.get_tok(load["token"])
504
505 # Bail if the token is empty or if the eauth type specified is not allowed
506 if not token or token["eauth"] not in self.opts["external_auth"]:
507 log.warning('Authentication failure of type "token" occurred.')
508 return False
509
510 return token
511
512 def authenticate_eauth(self, load):
513 """

Callers 1

check_authenticationMethod · 0.95

Calls 2

get_tokMethod · 0.95
warningMethod · 0.80

Tested by

no test coverage detected