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

Method _allow_custom_expire

salt/auth/__init__.py:222–237  ·  view source on GitHub ↗

Return bool if requesting user is allowed to set custom expire

(self, load)

Source from the content-addressed store, hash-verified

220 return None
221
222 def _allow_custom_expire(self, load):
223 """
224 Return bool if requesting user is allowed to set custom expire
225 """
226 expire_override = self.opts.get("token_expire_user_override", False)
227
228 if expire_override is True:
229 return True
230
231 if isinstance(expire_override, Mapping):
232 expire_whitelist = expire_override.get(load["eauth"], [])
233 if isinstance(expire_whitelist, Iterable):
234 if load.get("username") in expire_whitelist:
235 return True
236
237 return False
238
239 def mk_token(self, load):
240 """

Callers 1

mk_tokenMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected