Skip to content

Commit

Permalink
Merge branch 'master' into 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslav-fenchak authored Feb 16, 2022
2 parents a769f75 + 0c1f760 commit 3caf72e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
* Administration section BugFix getting index file.
* Adjust default auth routes

## 0.3.1 (2022-02-04)

* Administration section BugFix getting index file.

## 0.4.0 (2022-02-16)

* Add authorization rules to administration section.
Expand Down

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions minos/api_gateway/rest/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ async def create_application(self) -> web.Application:
app.router.add_route("DELETE", "/admin/autz-rules/{id}", AdminHandler.delete_autz_rule)

# Administration routes
path = Path(Path.cwd())
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader(f"{path}/minos/api_gateway/rest/backend/templates"))
path = Path(__file__).parent
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader(f"{path}/backend/templates"))
app.router.add_route("*", "/administration{path:.*}", self.handler)
# app.router.add_route("GET", "/administration/{filename:.*}", self._serve_files)

Expand All @@ -100,10 +100,9 @@ async def create_database(self):
@aiohttp_jinja2.template("tmpl.jinja2")
async def handler(self, request): # pragma: no cover
try:
path = Path(Path.cwd())
self._directory = path.resolve()
path = Path(__file__).parent
filename = Path(request.match_info["path"].replace("/", "", 1))
filepath = self._directory.joinpath("minos", "api_gateway", "rest", "backend", "admin", filename).resolve()
filepath = path.joinpath("backend", "admin", filename).resolve()

if filepath.is_file():
return await self._get_file(filepath)
Expand Down

0 comments on commit 3caf72e

Please sign in to comment.