Add auth whitelist regular expression config (#738)

This commit is contained in:
Wu Clan
2025-07-24 21:34:24 +08:00
committed by GitHub
parent 00a781357b
commit 53e64bce37
5 changed files with 16 additions and 23 deletions
+3
View File
@@ -23,6 +23,9 @@ async def rbac_verify(request: Request, _token: str = DependsJwtAuth) -> None:
# API 鉴权白名单
if path in settings.TOKEN_REQUEST_PATH_EXCLUDE:
return
for pattern in settings.TOKEN_REQUEST_PATH_EXCLUDE_PATTERN:
if pattern.match(path):
return
# JWT 授权状态强制校验
if not request.auth.scopes: