Skip to content

Commit

Permalink
remove auth tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Apr 9, 2024
1 parent 4b1cfe8 commit 14c9632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/app/auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AuthMiddleware(BaseHTTPMiddleware):
"""Generic auth middleware."""

async def dispatch(self, request: Request, call_next): # noqa: D102
if request.url.path == "/docs" or request.url.path == "/openapi.json" or request.url.path == "/health" or request.method == "OPTIONS":
if request.url.path == "/docs" or request.url.path == "/openapi.json" or request.url.path == "/health":
return await call_next(request)
request_token = request.headers.get("Authorization")
if request_token and request_token.startswith("Bearer "):
Expand Down
2 changes: 1 addition & 1 deletion api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def path_params(raster_filename: Annotated[str, Query(description="Raster filena
# Use ORJSONResponse to handle serialization of NaN values. Normal Json fails to serialize NaN values.
app = FastAPI(title="Amazonia360 API", default_response_class=ORJSONResponse)
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
app.add_middleware(AuthMiddleware)
# app.add_middleware(AuthMiddleware)

routes = ZonalTilerFactory(path_dependency=path_params)
app.include_router(routes.router)
Expand Down

0 comments on commit 14c9632

Please sign in to comment.