File tree Expand file tree Collapse file tree 7 files changed +24
-4
lines changed
test_api_gateway/test_rest Expand file tree Collapse file tree 7 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 3939* Add PostgreSQL database with SQLAlchemy dependency.
4040* Auth Rules for authentication.
4141* Administration section for rules management.
42+
43+ ## 0.3.0 (2022-02-04)
44+
45+ * Administration section BugFix getting index file.
46+ * Adjust default auth routes
Original file line number Diff line number Diff line change 1- __version__ = "0.2 .0"
1+ __version__ = "0.3 .0"
22
33from .config import (
44 ApiGatewayConfig ,
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 11[tool .poetry ]
22name = " minos_apigateway"
3- version = " 0.2 .0"
3+ version = " 0.3 .0"
44description = " Python Package containing the main API Gateway implementation used in Minos Microservices."
55readme = " README.md"
66repository = " https://github.com/clariteia/api_gateway"
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
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ async def test_auth_headers_3(self):
120120
121121 @unittest_run_loop
122122 async def test_default_auth_headers (self ):
123- url = "/auth"
123+ url = "/auth/token "
124124 headers = {"Authorization" : "Bearer credential-token-test" }
125125
126126 response = await self .client .request ("POST" , url , headers = headers )
You can’t perform that action at this time.
0 commit comments