mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
Add auth whitelist regular expression config (#738)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user