Skip to content

Commit 336aff1

Browse files
authored
feat!: add portals, consent signing keys, resource server type, and connection OTP settings (#905)
### Summary Adds the Portals client, user consent signing key management, and database connection OTP settings to the Management API client, extends resource servers and clients, and removes the CAPTCHA policies client and its models. ### Breaking Changes ⚠️ - **CAPTCHA policies**: `client.attack_protection.captcha_policies` is removed, along with its policy, match, and action models and the per-provider action settings for Arkose, hCaptcha, Friendly CAPTCHA, reCAPTCHA Enterprise, reCAPTCHA v2, Simple CAPTCHA, and auth challenge. Code that accesses it now raises `AttributeError`. This release provides no replacement. - **Experiments**: `client.experimentation.experiments.create()` now requires `allocation_strategy`. Calls that leave it out raise `TypeError`. Pass the strategy explicitly, for example `allocation_strategy="percentage"`. ### Added - **Portals**: create and manage portals with `client.portals.list()`, `create()`, `get()`, `update()`, and `delete()`. A portal has a client, sidebar navigation links, pages built from typed components, and custom `<head>` code. `update()` clears navigation, pages, or custom code when you pass `None` for it. - **Consent signing keys**: list, read, and remove a user's consent signing keys with `client.users.list_consent_signing_keys()`, `get_consent_signing_key()`, and `delete_consent_signing_key()`. - **Client OIDC support in responses**: `oidc_support` is now returned on client responses from get, create, update, list, search, and secret rotation. Client profiles accept and return `oidc_support` in their client configuration. - **Resource server type**: `client.resource_servers.create()` and `update()` accept a `type`, and resource server responses return it. Resource servers also expose `agent_subject_claims`. - **Database connection OTP settings**: set one-time password length and expiry separately for email and phone with `options.otp_settings` on `client.connections.create()` and `update()`. - **SAML connections**: configure a cross-app access requesting app, and the client credentials and token endpoint settings that go with it. Connection key management documentation now covers SAML connections. - **Segment filtering**: `client.experimentation.segments.list()` accepts a `status` filter. - **Smaller additions**: a `transaction` context on event stream cloud events, `agent_id` on client search results, and a typed model for internal server error bodies. ### Changed - **Experiment validity**: `is_valid` on experiment responses is now documented as the state at the last update, which can lag later changes. - **Variation overrides**: `UpdateVariationOverridesMap` now accepts `None`. Top-level keys merge into stored overrides, a `null` value removes a key, and `None` or `{}` clears all overrides. - **Tenant settings flags**: the `dashboard_insights_view` flag is documented as deprecated with no effect. ### Removed - `client.attack_protection.captcha_policies` and the CAPTCHA policy models listed under Breaking Changes.
2 parents 9aae3e5 + 5d23539 commit 336aff1

146 files changed

Lines changed: 5739 additions & 2202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.fern/replay.lock‎

Lines changed: 209 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,212 @@ generations:
1212
cli_version: unknown
1313
generator_versions:
1414
fernapi/fern-python-sdk: 5.26.0
15-
current_generation: ca6941ebe04b306e94f3315865d5fd06e3b2f233
16-
patches: []
15+
- commit_sha: a3eace9354ccf8d76cc4439d44363b0a08e6f1d7
16+
tree_hash: 8346a548a76aec81e3452ef7d1d86eb1df4866c9
17+
timestamp: 2026-11-04T03:51:04.113Z
18+
cli_version: unknown
19+
generator_versions:
20+
fernapi/fern-python-sdk: 5.26.0
21+
current_generation: a3eace9354ccf8d76cc4439d44363b0a08e6f1d7
22+
patches:
23+
- id: patch-3bac717a
24+
content_hash: sha256:f4ad3ba43b0430fa3dfb54bfcf588cb697efe8185eb30350f9955849f831083f
25+
original_commit: 3bac717acae703868197afb75fc26d296957a4fd
26+
original_message: Restore Auth0 telemetry headers and keep UPGRADING.md (#900)
27+
original_author: Kunal Dawar <35455566+developerkunal@users.noreply.github.com>
28+
base_generation: a3eace9354ccf8d76cc4439d44363b0a08e6f1d7
29+
files:
30+
- src/auth0/management/core/client_wrapper.py
31+
patch_content: |
32+
diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py
33+
index abce2c81..fd991f52 100644
34+
--- a/src/auth0/management/core/client_wrapper.py
35+
+++ b/src/auth0/management/core/client_wrapper.py
36+
@@ -1,6 +1,11 @@
37+
# This file was auto-generated by Fern from our API Definition.
38+
+# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning
39+
40+
+import base64
41+
+import platform
42+
+import sys
43+
import typing
44+
+from json import dumps
45+
46+
import httpx
47+
from .http_client import AsyncHttpClient, HttpClient
48+
@@ -30,7 +35,18 @@ class BaseClientWrapper:
49+
self._logging = logging
50+
51+
def get_headers(self) -> typing.Dict[str, str]:
52+
+ py_version = platform.python_version()
53+
+ version = sys.modules["auth0"].__version__
54+
+
55+
+ auth0_client = dumps({
56+
+ "name": "auth0-python",
57+
+ "version": version,
58+
+ "env": {"python": py_version}
59+
+ }).encode("utf-8")
60+
+
61+
headers: typing.Dict[str, str] = {
62+
+ "User-Agent": f"Python/{py_version}",
63+
+ "Auth0-Client": base64.b64encode(auth0_client).decode(),
64+
**(self.get_custom_headers() or {}),
65+
}
66+
headers["Authorization"] = f"Bearer {self._get_token()}"
67+
theirs_snapshot:
68+
src/auth0/management/core/client_wrapper.py: |
69+
# This file was auto-generated by Fern from our API Definition.
70+
# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning
71+
72+
import base64
73+
import platform
74+
import sys
75+
import typing
76+
from json import dumps
77+
78+
import httpx
79+
from .http_client import AsyncHttpClient, HttpClient
80+
from .logging import LogConfig, Logger
81+
82+
83+
class BaseClientWrapper:
84+
def __init__(
85+
self,
86+
*,
87+
token: typing.Union[str, typing.Callable[[], str]],
88+
headers: typing.Optional[typing.Dict[str, str]] = None,
89+
base_url: str,
90+
timeout: typing.Optional[float] = None,
91+
max_retries: int = 2,
92+
stream_reconnection_enabled: typing.Optional[bool] = None,
93+
max_stream_reconnection_attempts: typing.Optional[int] = None,
94+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
95+
):
96+
self._token = token
97+
self._headers = headers
98+
self._base_url = base_url
99+
self._timeout = timeout
100+
self._max_retries = max_retries
101+
self._stream_reconnection_enabled = stream_reconnection_enabled
102+
self._max_stream_reconnection_attempts = max_stream_reconnection_attempts
103+
self._logging = logging
104+
105+
def get_headers(self) -> typing.Dict[str, str]:
106+
py_version = platform.python_version()
107+
version = sys.modules["auth0"].__version__
108+
109+
auth0_client = dumps({
110+
"name": "auth0-python",
111+
"version": version,
112+
"env": {"python": py_version}
113+
}).encode("utf-8")
114+
115+
headers: typing.Dict[str, str] = {
116+
"User-Agent": f"Python/{py_version}",
117+
"Auth0-Client": base64.b64encode(auth0_client).decode(),
118+
**(self.get_custom_headers() or {}),
119+
}
120+
headers["Authorization"] = f"Bearer {self._get_token()}"
121+
return headers
122+
123+
def _get_token(self) -> str:
124+
if isinstance(self._token, str):
125+
return self._token
126+
else:
127+
return self._token()
128+
129+
def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]:
130+
return self._headers
131+
132+
def get_base_url(self) -> str:
133+
return self._base_url
134+
135+
def get_timeout(self) -> typing.Optional[float]:
136+
return self._timeout
137+
138+
def get_max_retries(self) -> int:
139+
return self._max_retries
140+
141+
def get_stream_reconnection_enabled(self) -> bool:
142+
return self._stream_reconnection_enabled if self._stream_reconnection_enabled is not None else True
143+
144+
def get_max_stream_reconnection_attempts(self) -> typing.Optional[int]:
145+
return self._max_stream_reconnection_attempts
146+
147+
148+
class SyncClientWrapper(BaseClientWrapper):
149+
def __init__(
150+
self,
151+
*,
152+
token: typing.Union[str, typing.Callable[[], str]],
153+
headers: typing.Optional[typing.Dict[str, str]] = None,
154+
base_url: str,
155+
timeout: typing.Optional[float] = None,
156+
max_retries: int = 2,
157+
stream_reconnection_enabled: typing.Optional[bool] = None,
158+
max_stream_reconnection_attempts: typing.Optional[int] = None,
159+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
160+
httpx_client: httpx.Client,
161+
):
162+
super().__init__(
163+
token=token,
164+
headers=headers,
165+
base_url=base_url,
166+
timeout=timeout,
167+
max_retries=max_retries,
168+
stream_reconnection_enabled=stream_reconnection_enabled,
169+
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
170+
logging=logging,
171+
)
172+
self.httpx_client = HttpClient(
173+
httpx_client=httpx_client,
174+
base_headers=self.get_headers,
175+
base_timeout=self.get_timeout,
176+
base_url=self.get_base_url,
177+
base_max_retries=self.get_max_retries(),
178+
logging_config=self._logging,
179+
)
180+
181+
182+
class AsyncClientWrapper(BaseClientWrapper):
183+
def __init__(
184+
self,
185+
*,
186+
token: typing.Union[str, typing.Callable[[], str]],
187+
headers: typing.Optional[typing.Dict[str, str]] = None,
188+
base_url: str,
189+
timeout: typing.Optional[float] = None,
190+
max_retries: int = 2,
191+
stream_reconnection_enabled: typing.Optional[bool] = None,
192+
max_stream_reconnection_attempts: typing.Optional[int] = None,
193+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
194+
async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
195+
httpx_client: httpx.AsyncClient,
196+
):
197+
super().__init__(
198+
token=token,
199+
headers=headers,
200+
base_url=base_url,
201+
timeout=timeout,
202+
max_retries=max_retries,
203+
stream_reconnection_enabled=stream_reconnection_enabled,
204+
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
205+
logging=logging,
206+
)
207+
self._async_token = async_token
208+
self.httpx_client = AsyncHttpClient(
209+
httpx_client=httpx_client,
210+
base_headers=self.get_headers,
211+
base_timeout=self.get_timeout,
212+
base_url=self.get_base_url,
213+
base_max_retries=self.get_max_retries(),
214+
async_base_headers=self.async_get_headers,
215+
logging_config=self._logging,
216+
)
217+
218+
async def async_get_headers(self) -> typing.Dict[str, str]:
219+
headers = self.get_headers()
220+
if self._async_token is not None:
221+
token = await self._async_token()
222+
headers["Authorization"] = f"Bearer {token}"
223+
return headers

0 commit comments

Comments
 (0)