auth0-server-python 1.0.0b8__tar.gz → 1.0.0b9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/PKG-INFO +30 -2
  2. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/README.md +28 -0
  3. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/pyproject.toml +3 -3
  4. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_server/my_account_client.py +1 -0
  5. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_server/server_client.py +668 -111
  6. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_types/__init__.py +26 -0
  7. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/error/__init__.py +43 -0
  8. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/store/abstract.py +15 -2
  9. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/tests/test_my_account_client.py +1 -0
  10. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/tests/test_server_client.py +1860 -92
  11. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/utils/helpers.py +69 -0
  12. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/LICENSE +0 -0
  13. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_schemes/__init__.py +0 -0
  14. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_schemes/bearer_auth.py +0 -0
  15. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/auth_server/__init__.py +0 -0
  16. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/encryption/__init__.py +0 -0
  17. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/encryption/encrypt.py +0 -0
  18. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/store/__init__.py +0 -0
  19. {auth0_server_python-1.0.0b8 → auth0_server_python-1.0.0b9}/src/auth0_server_python/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: auth0-server-python
3
- Version: 1.0.0b8
3
+ Version: 1.0.0b9
4
4
  Summary: Auth0 server-side Python SDK
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.14
18
18
  Requires-Dist: authlib (>=1.2,<2.0)
19
19
  Requires-Dist: cryptography (>=43.0.1)
20
20
  Requires-Dist: httpx (>=0.28.1,<0.29.0)
21
- Requires-Dist: jwcrypto (>=1.5.6,<2.0.0)
21
+ Requires-Dist: jwcrypto (>=1.5.7,<2.0.0)
22
22
  Requires-Dist: pydantic (>=2.10.6,<3.0.0)
23
23
  Requires-Dist: pyjwt (>=2.8.0)
24
24
  Description-Content-Type: text/markdown
@@ -170,6 +170,34 @@ print(response.access_token)
170
170
 
171
171
  For more details and examples, see [examples/CustomTokenExchange.md](examples/CustomTokenExchange.md).
172
172
 
173
+ ### 5. Multiple Custom Domains (MCD)
174
+
175
+ For applications that use multiple custom domains on the same Auth0 tenant, pass a domain resolver function instead of a static domain string:
176
+
177
+ ```python
178
+ from auth0_server_python.auth_server.server_client import ServerClient
179
+ from auth0_server_python.auth_types import DomainResolverContext
180
+
181
+ async def domain_resolver(context: DomainResolverContext) -> str:
182
+ host = context.request_headers.get('host', '').split(':')[0]
183
+ domain_map = {
184
+ "acme.yourapp.com": "acme.auth0.com",
185
+ "globex.yourapp.com": "globex.auth0.com",
186
+ }
187
+ return domain_map.get(host, "default.auth0.com")
188
+
189
+ auth0 = ServerClient(
190
+ domain=domain_resolver, # Callable enables MCD mode
191
+ client_id='<AUTH0_CLIENT_ID>',
192
+ client_secret='<AUTH0_CLIENT_SECRET>',
193
+ secret='<AUTH0_SECRET>',
194
+ )
195
+ ```
196
+
197
+ The SDK handles per-domain OIDC discovery, JWKS fetching, issuer validation, and session isolation automatically. Static string domains continue to work unchanged.
198
+
199
+ For more details and examples, see [examples/MultipleCustomDomains.md](examples/MultipleCustomDomains.md).
200
+
173
201
  ## Feedback
174
202
 
175
203
  ### Contributing
@@ -145,6 +145,34 @@ print(response.access_token)
145
145
 
146
146
  For more details and examples, see [examples/CustomTokenExchange.md](examples/CustomTokenExchange.md).
147
147
 
148
+ ### 5. Multiple Custom Domains (MCD)
149
+
150
+ For applications that use multiple custom domains on the same Auth0 tenant, pass a domain resolver function instead of a static domain string:
151
+
152
+ ```python
153
+ from auth0_server_python.auth_server.server_client import ServerClient
154
+ from auth0_server_python.auth_types import DomainResolverContext
155
+
156
+ async def domain_resolver(context: DomainResolverContext) -> str:
157
+ host = context.request_headers.get('host', '').split(':')[0]
158
+ domain_map = {
159
+ "acme.yourapp.com": "acme.auth0.com",
160
+ "globex.yourapp.com": "globex.auth0.com",
161
+ }
162
+ return domain_map.get(host, "default.auth0.com")
163
+
164
+ auth0 = ServerClient(
165
+ domain=domain_resolver, # Callable enables MCD mode
166
+ client_id='<AUTH0_CLIENT_ID>',
167
+ client_secret='<AUTH0_CLIENT_SECRET>',
168
+ secret='<AUTH0_SECRET>',
169
+ )
170
+ ```
171
+
172
+ The SDK handles per-domain OIDC discovery, JWKS fetching, issuer validation, and session isolation automatically. Static string domains continue to work unchanged.
173
+
174
+ For more details and examples, see [examples/MultipleCustomDomains.md](examples/MultipleCustomDomains.md).
175
+
148
176
  ## Feedback
149
177
 
150
178
  ### Contributing
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "auth0-server-python"
3
- version = "1.0.0.b8"
3
+ version = "1.0.0b9"
4
4
  description = "Auth0 server-side Python SDK"
5
5
  readme = "README.md"
6
6
  authors = ["Auth0 <support@okta.com>"]
@@ -17,7 +17,7 @@ pyjwt = ">=2.8.0"
17
17
  authlib = "^1.2"
18
18
  httpx = "^0.28.1"
19
19
  pydantic = "^2.10.6"
20
- jwcrypto = "^1.5.6"
20
+ jwcrypto = "^1.5.7"
21
21
 
22
22
  [tool.poetry.group.dev.dependencies]
23
23
  pytest = "^7.2"
@@ -25,7 +25,7 @@ pytest-cov = "^4.0"
25
25
  pytest-asyncio = ">=0.20.3,<0.24.0"
26
26
  pytest-mock = "^3.14.0"
27
27
  twine = "^6.1.0"
28
- ruff = "^0.1.0"
28
+ ruff = ">=0.1"
29
29
 
30
30
  [tool.pytest.ini_options]
31
31
  addopts = "--cov=auth0_server_python --cov-report=term-missing:skip-covered --cov-report=xml"
@@ -2,6 +2,7 @@
2
2
  from typing import Optional
3
3
 
4
4
  import httpx
5
+
5
6
  from auth0_server_python.auth_schemes.bearer_auth import BearerAuth
6
7
  from auth0_server_python.auth_types import (
7
8
  CompleteConnectAccountRequest,