Open
Conversation
| @@ -1,5 +1,18 @@ | |||
| from typing import Dict, List | |||
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 days ago
To fix the problem, remove the unused symbol Dict from the typing import while keeping the used symbol List. This eliminates the unnecessary dependency and clarifies which types are actually needed.
Concretely, in tests/conftest.py, on line 1, change from typing import Dict, List to from typing import List. No other lines need modification, as List remains in use for the domains parameter annotation of setup_mcd_mocks. No additional methods, imports, or definitions are required.
Suggested changeset
1
tests/conftest.py
| @@ -1,4 +1,4 @@ | ||
| from typing import Dict, List | ||
| from typing import List | ||
|
|
||
| from pytest_httpx import HTTPXMock | ||
| from .test_utils import PUBLIC_DPOP_JWK, PRIVATE_JWK |
Copilot is powered by AI and may make mistakes. Always verify output.
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.
📋 Changes
This PR implements Multiple Custom Domain (MCD) support for auth0-fastapi-api, enabling FastAPI APIs to accept tokens from multiple Auth0 custom domains with static lists, dynamic resolvers, and hybrid mode for zero-downtime domain migrations.
✨ Features
domainsparameter (static list or callable resolver) onAuth0FastAPIinitializationDomainsResolvercallable with request context (DomainsResolverContext)domainanddomainstogether for migration scenarios -domaindrives client-initiated flows (token exchange, connection tokens),domainsdrives token verificationauth0-api-pythoncore SDKCacheAdapterinterface with defaultInMemoryCacheimplementation🔧 API Changes
Auth0FastAPIconstructor with MCD parameters:domains,cache_ttl_seconds,cache_max_entries,cache_adapterauth0-api-pythonSDK'sApiClientOptionsfastapi_plugin:DomainsResolverContext,DomainsResolver,ConfigurationError,DomainsResolverError,CacheAdapter,InMemoryCacheverify_request()for resolver support📖 Documentation
README.mdwith comprehensive MCD section showing static lists, dynamic resolvers, hybrid mode, and cache configurationEXAMPLES.mdwith detailed MCD examples:🧪 Testing
Manual Integration Testing
Requires an Auth0 tenant with multiple custom domains configured and a machine-to-machine application with client credentials grant enabled.
Expected: All three domains succeed. Each token's
issmatches its issuing domain and verification passes.Contributor Checklist