2023-01-04 16:07:34 +01:00
|
|
|
diff --git a/tryton/trytond/trytond/protocols/dispatcher.py b/trytond/trytond/protocols/dispatcher.py
|
2022-12-30 12:38:07 +01:00
|
|
|
index 2e86f55e..799a58f4 100644
|
2023-01-04 16:07:34 +01:00
|
|
|
--- a/tryton/trytond/trytond/protocols/dispatcher.py
|
|
|
|
+++ b/tryton/trytond/trytond/protocols/dispatcher.py
|
2022-12-30 12:38:07 +01:00
|
|
|
@@ -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):
|