Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6781
__init__re-ran OIDC discovery and assigned it toself.jwks_uri. Nothing reads that attribute._verify_bearer_tokentakes its signing key from the module leveljwks_client, which was built from the discovery that already ran at import, so the second lookup could never return anything the first one had not.The attribute now carries that same value. The second request is gone, and
jwks_uriis set toNonealongsidejwks_clientwhenAUTH0_DOMAINis unset so the name exists on both paths.It adds up.
get_auth_verifierbuilds a new verifier per call and sits in 190 route dependencies, which FastAPI evaluates at import, soAUTH_TYPE=AUTH0meant 190 discarded discovery requests at startup with a 10 second timeout apiece.Three tests. Import discovers exactly once, three constructions add no further requests, and the constructed verifier still carries the discovered URI. Only the middle one fails on the parent commit; the other two pass either way and are controls, not reproductions.
tests/test_auth0_authverifier.py: 3 passed.tests/test_auth.py tests/test_auth_new.py: 27 passed.ruff checkclean.This does not fix the
unit-teststimeouts on #6716. Those come from the import time call being unmocked forMULTI_TENANTintests/fixtures/client.py, which is a separate thing and I did not touch it here.