Skip to content

Commit

Permalink
Fix public paths for api-key protection
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Apr 6, 2024
1 parent 8713710 commit 8f9e8ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ async def custom_app_exception_handler(request, e):
os.environ["PYGEOAPI_KEY_GLOBAL"] = cfg.PYGEOAPI_KEY_GLOBAL

PYGEOAPI_APP.add_middleware(
AuthorizerMiddleware, public_paths=["/openapi"], key_pattern="PYGEOAPI_KEY_"
AuthorizerMiddleware,
public_paths=[f"{cfg.FASTGEOAPI_CONTEXT}/openapi"],
key_pattern="PYGEOAPI_KEY_",
)

security_schemes = [
Expand Down

0 comments on commit 8f9e8ac

Please sign in to comment.