diff --git a/backend/pilotwings.py b/backend/pilotwings.py index 6095c6d..8bb7109 100644 --- a/backend/pilotwings.py +++ b/backend/pilotwings.py @@ -42,20 +42,6 @@ async def check_auth( return credentials -class AuthStaticFiles(StaticFiles): - async def __call__( - self, scope: types.Scope, receive: types.Receive, send: types.Send - ) -> None: - request = Request(scope, receive) - credentials = await security(request) - - if not credentials: - raise http_401() - - await check_auth(credentials) - await super().__call__(scope, receive, send) - - app = FastAPI(dependencies=[Depends(check_auth)]) @@ -66,7 +52,6 @@ class SerializedContainer(BaseModel): labels: dict[str, str] status: str health: str - ports: dict[str, str] owner: str | None environment: list[str] @@ -79,7 +64,6 @@ def serialize_container(container: Container) -> SerializedContainer: labels=container.labels, status=container.status, health=container.health, - ports=container.ports, owner=container.labels.get("owner"), environment=container.attrs["Config"]["Env"], ) @@ -182,6 +166,20 @@ def update_container( ) +class AuthStaticFiles(StaticFiles): + async def __call__( + self, scope: types.Scope, receive: types.Receive, send: types.Send + ) -> None: + request = Request(scope, receive) + credentials = await security(request) + + if not credentials: + raise http_401() + + await check_auth(credentials) + await super().__call__(scope, receive, send) + + app.mount( "/", AuthStaticFiles( diff --git a/frontend/components/Loading.vue b/frontend/components/Loading.vue index 56e91b6..2790c7a 100644 --- a/frontend/components/Loading.vue +++ b/frontend/components/Loading.vue @@ -6,7 +6,7 @@