Return the token and set the cache data for use Do not call this directly! Use the time_auth method to overcome timing attacks
(self, load)
| 113 | return "" |
| 114 | |
| 115 | def __auth_call(self, load): |
| 116 | """ |
| 117 | Return the token and set the cache data for use |
| 118 | |
| 119 | Do not call this directly! Use the time_auth method to overcome timing |
| 120 | attacks |
| 121 | """ |
| 122 | if "eauth" not in load: |
| 123 | return False |
| 124 | fstr = "{}.auth".format(load["eauth"]) |
| 125 | if fstr not in self.auth: |
| 126 | return False |
| 127 | # When making auth calls, only username, password, auth, and token |
| 128 | # are valid, so we strip anything else out. |
| 129 | _valid = ["username", "password", "eauth", "token"] |
| 130 | _load = {key: value for (key, value) in load.items() if key in _valid} |
| 131 | |
| 132 | fcall = salt.utils.args.format_call( |
| 133 | self.auth[fstr], _load, expected_extra_kws=AUTH_INTERNAL_KEYWORDS |
| 134 | ) |
| 135 | try: |
| 136 | if "kwargs" in fcall: |
| 137 | return self.auth[fstr](*fcall["args"], **fcall["kwargs"]) |
| 138 | else: |
| 139 | return self.auth[fstr](*fcall["args"]) |
| 140 | except Exception as e: # pylint: disable=broad-except |
| 141 | log.debug("Authentication module threw %s", e) |
| 142 | return False |
| 143 | |
| 144 | def time_auth(self, load): |
| 145 | """ |