From d8142f3990f88aa94b26944aaaa25f3b88cbb818 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 27 Aug 2024 09:26:32 -0400 Subject: [PATCH] refact(authz): build authz middleware using FastAPI-specific fn --- bento_reference_service/authz.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bento_reference_service/authz.py b/bento_reference_service/authz.py index 2caf6dd..90c2e63 100644 --- a/bento_reference_service/authz.py +++ b/bento_reference_service/authz.py @@ -1,4 +1,3 @@ -import re from bento_lib.auth.middleware.fastapi import FastApiAuthMiddleware from .config import get_config from .logger import get_logger @@ -9,11 +8,4 @@ # Non-standard middleware setup so that we can import the instance and use it for dependencies too config = get_config() # TODO: Find a way to DI this -authz_middleware = FastApiAuthMiddleware.build_from_pydantic_config( - config, - get_logger(config), - exempt_request_patterns=( - (r"GET", re.escape(config.service_docs_path)), - (r"GET", re.escape(config.service_openapi_path)), - ), -) +authz_middleware = FastApiAuthMiddleware.build_from_fastapi_pydantic_config(config, get_logger(config))