try catch is magic

This commit is contained in:
Kay0u 2020-03-29 01:27:41 +01:00
parent 9929d21fdc
commit eb9ecb6451
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156
2 changed files with 5 additions and 5 deletions

View file

@ -259,10 +259,7 @@ class BaseActionsMapParser(object):
raise MoulinetteError("error_see_log")
# -- 'authenticator'
if "authenticator" in configuration:
auth = configuration["authenticator"]
else:
auth = "default"
auth = configuration.get("authenticator", "default")
if not is_global and isinstance(auth, str):
# Store needed authenticator profile
if auth not in self.global_conf["authenticator"]:

View file

@ -407,7 +407,10 @@ class _ActionsMapPlugin(object):
# We check that there's a (signed) session.hash available
# for additional security ?
# (An attacker could not craft such signed hashed ? (FIXME : need to make sure of this))
try:
s_secret = self.secrets[s_id]
except KeyError:
s_secret = {}
if profile not in request.get_cookie(
"session.tokens", secret=s_secret, default={}
):