trytond-patches/issue11582.diff

40 lines
1.1 KiB
Diff

diff --git a/tryton/trytond/trytond/protocols/dispatcher.py b/trytond/trytond/protocols/dispatcher.py
index 2e86f55e..799a58f4 100644
--- a/tryton/trytond/trytond/protocols/dispatcher.py
+++ b/tryton/trytond/trytond/protocols/dispatcher.py
@@ -26,6 +26,8 @@ from trytond.wsgi import app
from .wrappers import with_pool
+__all__ = ['register_authentication_service']
+
logger = logging.getLogger(__name__)
ir_configuration = Table('ir_configuration')
@@ -82,6 +84,7 @@ def root(request, *args):
methods = {
'common.server.version': lambda *a: __version__,
'common.db.list': db_list,
+ 'common.authentication.services': authentication_services,
}
return methods[request.rpc_method](request, *request.rpc_params)
@@ -111,6 +114,17 @@ def db_list(request, *args):
return transaction.database.list(hostname=hostname)
+def authentication_services(request):
+ return _AUTHENTICATION_SERVICES
+
+
+def register_authentication_service(name, url):
+ _AUTHENTICATION_SERVICES.append((name, url))
+
+
+_AUTHENTICATION_SERVICES = []
+
+
@app.auth_required
@with_pool
def list_method(request, pool):