File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,18 @@ async def authentication_default(request: web.Request) -> web.Response:
7272 return await authentication_call (request , url )
7373
7474
75+ async def login_default (request : web .Request ) -> web .Response :
76+ """ Orchestrate discovery and microservice call """
77+ auth_host = request .app ["config" ].rest .auth .host
78+ auth_port = request .app ["config" ].rest .auth .port
79+ auth_path = request .app ["config" ].rest .auth .path
80+ default_service = request .app ["config" ].rest .auth .default
81+
82+ url = URL (f"http://{ auth_host } :{ auth_port } { auth_path } /{ default_service } /login" )
83+
84+ return await authentication_call (request , url )
85+
86+
7587async def authentication (request : web .Request ) -> web .Response :
7688 """ Orchestrate discovery and microservice call """
7789
Original file line number Diff line number Diff line change 2828 AdminHandler ,
2929 authentication ,
3030 authentication_default ,
31+ login_default ,
3132 orchestrate ,
3233)
3334
@@ -57,8 +58,10 @@ async def create_application(self) -> web.Application:
5758 auth = self .config .rest .auth
5859 if auth is not None and auth .enabled :
5960 app .router .add_route ("*" , "/auth" , authentication_default )
61+ app .router .add_route ("*" , "/auth/login" , login_default )
6062 for service in auth .services :
6163 app .router .add_route ("*" , f"/auth/{ service .name } " , authentication )
64+ app .router .add_route ("POST" , f"/auth/{ service .name } /login" , authentication )
6265
6366 app .router .add_route ("POST" , "/admin/login" , AdminHandler .login )
6467 app .router .add_route ("GET" , "/admin/endpoints" , AdminHandler .get_endpoints )
Original file line number Diff line number Diff line change 1414 services :
1515 - name : token
1616 - name : credentials
17- default : token
17+ default : credentials
1818database :
1919 dbname : api_gateway_db
2020 user : minos
You can’t perform that action at this time.
0 commit comments