Skip to content

Commit

Permalink
chore: tighten restrictions on auth passthrough for docs urls
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed May 3, 2024
1 parent 44495d4 commit f3e5d30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bento_authorization_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ async def permissions_enforcement(request: Request, call_next) -> Response:

# Allow pre-flight responses through
# Allow docs responses through in development mode
req_path = request.url.path
if request.method == "OPTIONS" or (
config_for_setup.bento_debug
and (request.url.path.startswith(DOCS_URL) or request.url.path.startswith(OPENAPI_URL))
and (req_path == DOCS_URL or req_path.startswith(f"{DOCS_URL}/") or req_path == OPENAPI_URL)
):
return await call_next(request)

Expand Down

0 comments on commit f3e5d30

Please sign in to comment.