File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -144,20 +144,25 @@ def test_oidc_in_openapi_spec_public_endpoints(
144144 for path , method_config in openapi ["paths" ].items ():
145145 for method , config in method_config .items ():
146146 security = config .get ("security" )
147+
147148 if method == "options" :
148- assert not security , "OPTIONS requests should not be authenticated"
149- elif security :
149+ assert (
150+ not security
151+ ), "OPTIONS requests should not require authentication"
152+ continue
153+
154+ if security :
150155 assert (
151156 path not in expected_required_auth
152157 ), f"Path { path } should not require authentication"
153- else :
154- assert (
155- path in expected_required_auth
156- ), f"Path { path } should require authentication"
157- assert any (
158- method . casefold () == m . casefold ()
159- for m in expected_required_auth [path ]
160- )
158+ continue
159+
160+ assert (
161+ path in expected_required_auth
162+ ), f"Path { path } should require authentication"
163+ assert any (
164+ method . casefold () == m . casefold () for m in expected_required_auth [path ]
165+ )
161166
162167
163168def test_auth_scheme_name_override (source_api : FastAPI , source_api_server : str ):
You can’t perform that action at this time.
0 commit comments