diff --git a/moulinette/interfaces/__init__.py b/moulinette/interfaces/__init__.py index 7a078df2..5c6a64cd 100644 --- a/moulinette/interfaces/__init__.py +++ b/moulinette/interfaces/__init__.py @@ -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"]: diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index cad9620b..98a95c1d 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -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)) - s_secret = self.secrets[s_id] + try: + s_secret = self.secrets[s_id] + except KeyError: + s_secret = {} if profile not in request.get_cookie( "session.tokens", secret=s_secret, default={} ):