mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-20 05:17:56 +00:00
Do not test authentication on docs endpoints
This commit is contained in:
parent
0ee73605c0
commit
eca502c49c
@ -31,6 +31,9 @@ ALLOWED_CONTROLLER_ENDPOINTS = [
|
||||
("/", "GET"),
|
||||
("/debug", "GET"),
|
||||
("/static/web-ui/{file_path:path}", "GET"),
|
||||
("/docs", "GET"),
|
||||
("/docs/oauth2-redirect", "GET"),
|
||||
("/redoc", "GET"),
|
||||
("/v3/version", "GET"),
|
||||
("/v3/version", "POST"),
|
||||
("/v3/access/users/login", "POST"),
|
||||
@ -49,6 +52,7 @@ async def test_controller_endpoints_require_authentication(app: FastAPI, unautho
|
||||
if isinstance(route, APIRoute):
|
||||
for method in list(route.methods):
|
||||
if (route.path, method) not in ALLOWED_CONTROLLER_ENDPOINTS:
|
||||
print(f"Testing {route.path} {method}")
|
||||
response = await getattr(unauthorized_client, method.lower())(route.path)
|
||||
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
||||
elif isinstance(route, APIWebSocketRoute):
|
||||
|
Loading…
Reference in New Issue
Block a user