Skip to content

Commit 45a1a99

Browse files
committed
✨ Add authentication setup to application initialization
1 parent ddd9ee9 commit 45a1a99

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

services/web/server/src/simcore_service_webserver/application.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ async def _finished_banner(app: web.Application):
7272
print(info.get_finished_banner(), flush=True) # noqa: T201
7373

7474

75+
def create_application_auth() -> web.Application:
76+
app = create_safe_application()
77+
setup_settings(app)
78+
79+
setup_db(app)
80+
setup_session(app)
81+
setup_security(app)
82+
setup_rest(app)
83+
84+
# NOTE: *last* events
85+
app.on_startup.append(_welcome_banner)
86+
app.on_shutdown.append(_finished_banner)
87+
88+
_logger.debug("Routes in app: \n %s", pformat(app.router.named_resources()))
89+
90+
return app
91+
92+
7593
def create_application() -> web.Application:
7694
"""
7795
Initializes service

0 commit comments

Comments
 (0)