Skip to content

Commit

Permalink
add authentication middleware to FastAPI App
Browse files Browse the repository at this point in the history
  • Loading branch information
Chats committed Apr 30, 2024
1 parent 6992565 commit 1df15ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from src.utils.middleware.case_sens_middleware import case_sens_middleware
from src.utils.middleware.rate_limit import cutoff
from src.utils.middleware.metrics import instrumentator
from src.utils.middleware.authentication import authenticate

# Routes Import
from src.routes import base, admin, raw, v1
Expand All @@ -33,6 +34,7 @@
app.add_middleware(BrotliMiddleware)
app.add_middleware(BaseHTTPMiddleware, dispatch=case_sens_middleware)
app.add_middleware(BaseHTTPMiddleware, dispatch=cutoff)
app.add_middleware(BaseHTTPMiddleware, dispatch=authenticate)
instrumentator.instrument(app=app).expose(
app, include_in_schema=False, should_gzip=True
)
Expand Down

0 comments on commit 1df15ee

Please sign in to comment.