mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
default use global conf
This commit is contained in:
parent
0be1d74e4a
commit
3abde9c008
3 changed files with 20 additions and 8 deletions
|
@ -666,7 +666,16 @@ class ActionsMapParser(BaseActionsMapParser):
|
||||||
raise MoulinetteError("error_see_log")
|
raise MoulinetteError("error_see_log")
|
||||||
|
|
||||||
if self.get_conf(tid, "authenticate"):
|
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:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,16 @@ class ActionsMapParser(BaseActionsMapParser):
|
||||||
|
|
||||||
tid = getattr(ret, "_tid", None)
|
tid = getattr(ret, "_tid", None)
|
||||||
if self.get_conf(tid, "authenticate"):
|
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:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,6 @@ testauth:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
api: GET /test-auth/default
|
api: GET /test-auth/default
|
||||||
configuration:
|
|
||||||
authenticate: all
|
|
||||||
authenticator: default
|
|
||||||
|
|
||||||
only-api:
|
only-api:
|
||||||
api: GET /test-auth/only-api
|
api: GET /test-auth/only-api
|
||||||
|
@ -67,9 +64,6 @@ testauth:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
api: GET /test-auth/subcat/default
|
api: GET /test-auth/subcat/default
|
||||||
configuration:
|
|
||||||
authenticate: all
|
|
||||||
authenticator: default
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
api: POST /test-auth/subcat/post
|
api: POST /test-auth/subcat/post
|
||||||
|
|
Loading…
Reference in a new issue