diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index c6a12bcf..7ecf90eb 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -666,7 +666,16 @@ class ActionsMapParser(BaseActionsMapParser): raise MoulinetteError("error_see_log") if self.get_conf(tid, "authenticate"): - return self.get_conf(tid, "authenticator") + authenticator = self.get_conf(tid, "authenticator") + + # If several authenticator, use the default one + if isinstance(authenticator, dict): + if 'default' in authenticator: + authenticator = 'default' + else: + # TODO which one should we use? + pass + return authenticator else: return False diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index 1d5b89ae..22aa9799 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -379,7 +379,16 @@ class ActionsMapParser(BaseActionsMapParser): tid = getattr(ret, "_tid", None) if self.get_conf(tid, "authenticate"): - return self.get_conf(tid, "authenticator") + authenticator = self.get_conf(tid, "authenticator") + + # If several authenticator, use the default one + if isinstance(authenticator, dict): + if 'default' in authenticator: + authenticator = 'default' + else: + # TODO which one should we use? + pass + return authenticator else: return False diff --git a/test/actionsmap/moulitest.yml b/test/actionsmap/moulitest.yml index 93833f1d..b44e0ff2 100644 --- a/test/actionsmap/moulitest.yml +++ b/test/actionsmap/moulitest.yml @@ -34,9 +34,6 @@ testauth: default: api: GET /test-auth/default - configuration: - authenticate: all - authenticator: default only-api: api: GET /test-auth/only-api @@ -67,9 +64,6 @@ testauth: default: api: GET /test-auth/subcat/default - configuration: - authenticate: all - authenticator: default post: api: POST /test-auth/subcat/post