Skip to content

Commit e506d73

Browse files
feat+fix: Pagination fix, SDK logging, OAuth1/DPoP types (#785)
## Summary This Fern regeneration includes several significant changes across 61 files: ### Bug Fix: Pagination (Fixes #783) - Fixed incorrect page advancement in **64 paginated endpoints** across all `raw_client.py` files - **Before (broken):** `page = page + len(_items or [])` — skipped pages when `per_page > 1` - **After (fixed):** `page = page + 1` - correctly advances one page at a time ### New Feature: SDK Logging Infrastructure - Added configurable logging via new `logging` parameter on the `Auth0` client - New `core/logging.py` module with `ConsoleLogger`, `Logger`, `LogConfig`, and `ILogger` protocol - Supports log levels: `debug`, `info`, `warn`, `error` with a `silent` mode (default) - HTTP request/response logging at debug level with method, URL, status code - Sensitive header redaction (`Authorization`, `Cookie`, `X-Api-Key`, etc.) in log output - Custom logger support via `ILogger` protocol ### New Types: OAuth1 & DPoP Connection Support - 10 new connection type files for OAuth1 connections (`connection_access_token_url_oauth1`, `connection_client_id_oauth1`, `connection_scripts_oauth1`, etc.) - DPoP signing algorithm types (`connection_dpop_signing_alg_enum`, `connection_dpop_signing_alg_values_supported`) - OIDC metadata types (`connection_options_oidc_metadata`, `connection_options_common_oidc`) - New `client_token_exchange_type_enum` and `resource_server_proof_of_possession_required_for_enum` ### Other Changes - Self-service profiles: updated response types (`create`, `get`, `update`) and `self_service_profile` model - Removed `core/custom_pagination.py` (replaced by standard pagination) - Updated `reference.md` and test configuration (`conftest.py`) ### Manual Fixes (on top of Fern regeneration) - Fixed `client_wrapper.py` to accept and forward the `logging` parameter to `HttpClient`/`AsyncHttpClient` (was missing, causing `TypeError` at runtime) - Added `ManagementClient` and `AsyncManagementClient` to `TYPE_CHECKING` and `__all__` exports in `__init__.py` (Fixes #793) ## Breaking Changes - `custom_pagination.py` has been removed — any code importing from it will need to update ## Test Plan - [x] Pagination: Created 5 roles, paginated with `per_page=2`, verified 3 pages returned with all 5 roles - [x] Logging: Verified debug logging captures HTTP method/URL/status, header redaction works, level filtering suppresses lower levels, silent mode produces zero output - [x] Existing tests (auth, management, Issue #778) continue to pass --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Snehil Kishore <snehil.kishore@okta.com>
1 parent 2f4906d commit e506d73

File tree

63 files changed

+571
-344
lines changed

Some content is hidden

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

63 files changed

+571
-344
lines changed

reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ client.clients.update(
23442344
<dl>
23452345
<dd>
23462346

2347-
**allowed_logout_urls:** `typing.Optional[typing.Sequence[str]]` — URLs that are valid to redirect to after logout from Auth0.
2347+
**allowed_logout_urls:** `typing.Optional[typing.Sequence[str]]` — URLs that are valid to redirect to after logout from Auth0
23482348

23492349
</dd>
23502350
</dl>
@@ -11969,7 +11969,7 @@ client.self_service_profiles.create(
1196911969
<dl>
1197011970
<dd>
1197111971

11972-
**allowed_strategies:** `typing.Optional[typing.Sequence[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`]
11972+
**allowed_strategies:** `typing.Optional[typing.Sequence[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`]
1197311973

1197411974
</dd>
1197511975
</dl>
@@ -12227,7 +12227,7 @@ client.self_service_profiles.update(
1222712227
<dl>
1222812228
<dd>
1222912229

12230-
**allowed_strategies:** `typing.Optional[typing.Sequence[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`]
12230+
**allowed_strategies:** `typing.Optional[typing.Sequence[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`]
1223112231

1223212232
</dd>
1223312233
</dl>

src/auth0/management/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,7 @@
12151215
from .client import AsyncAuth0, Auth0
12161216
from .environment import Auth0Environment
12171217
from .event_streams import EventStreamsCreateRequest
1218+
from .management_client import AsyncManagementClient, ManagementClient
12181219
from .version import __version__
12191220
_dynamic_imports: typing.Dict[str, str] = {
12201221
"Action": ".types",
@@ -3340,6 +3341,8 @@ def __dir__():
33403341
"LogStreamSumoEnum",
33413342
"LogStreamSumoResponseSchema",
33423343
"LogStreamSumoSink",
3344+
"ManagementClient",
3345+
"AsyncManagementClient",
33433346
"MdlPresentationProperties",
33443347
"MdlPresentationRequest",
33453348
"MdlPresentationRequestProperties",

src/auth0/management/actions/modules/raw_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def list(
8686
_items = _parsed_response.modules
8787
_has_next = True
8888
_get_next = lambda: self.list(
89-
page=page + len(_items or []),
89+
page=page + 1,
9090
per_page=per_page,
9191
request_options=request_options,
9292
)
@@ -649,7 +649,7 @@ def list_actions(
649649
_has_next = True
650650
_get_next = lambda: self.list_actions(
651651
id,
652-
page=page + len(_items or []),
652+
page=page + 1,
653653
per_page=per_page,
654654
request_options=request_options,
655655
)
@@ -885,7 +885,7 @@ async def list(
885885

886886
async def _get_next():
887887
return await self.list(
888-
page=page + len(_items or []),
888+
page=page + 1,
889889
per_page=per_page,
890890
request_options=request_options,
891891
)
@@ -1453,7 +1453,7 @@ async def list_actions(
14531453
async def _get_next():
14541454
return await self.list_actions(
14551455
id,
1456-
page=page + len(_items or []),
1456+
page=page + 1,
14571457
per_page=per_page,
14581458
request_options=request_options,
14591459
)

src/auth0/management/actions/modules/versions/raw_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def list(
8181
_has_next = True
8282
_get_next = lambda: self.list(
8383
id,
84-
page=page + len(_items or []),
84+
page=page + 1,
8585
per_page=per_page,
8686
request_options=request_options,
8787
)
@@ -409,7 +409,7 @@ async def list(
409409
async def _get_next():
410410
return await self.list(
411411
id,
412-
page=page + len(_items or []),
412+
page=page + 1,
413413
per_page=per_page,
414414
request_options=request_options,
415415
)

src/auth0/management/actions/raw_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def list(
110110
trigger_id=trigger_id,
111111
action_name=action_name,
112112
deployed=deployed,
113-
page=page + len(_items or []),
113+
page=page + 1,
114114
per_page=per_page,
115115
installed=installed,
116116
request_options=request_options,
@@ -887,7 +887,7 @@ async def _get_next():
887887
trigger_id=trigger_id,
888888
action_name=action_name,
889889
deployed=deployed,
890-
page=page + len(_items or []),
890+
page=page + 1,
891891
per_page=per_page,
892892
installed=installed,
893893
request_options=request_options,

src/auth0/management/actions/triggers/bindings/raw_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def list(
8383
_has_next = True
8484
_get_next = lambda: self.list(
8585
trigger_id,
86-
page=page + len(_items or []),
86+
page=page + 1,
8787
per_page=per_page,
8888
request_options=request_options,
8989
)
@@ -297,7 +297,7 @@ async def list(
297297
async def _get_next():
298298
return await self.list(
299299
trigger_id,
300-
page=page + len(_items or []),
300+
page=page + 1,
301301
per_page=per_page,
302302
request_options=request_options,
303303
)

src/auth0/management/actions/versions/raw_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def list(
8484
_has_next = True
8585
_get_next = lambda: self.list(
8686
action_id,
87-
page=page + len(_items or []),
87+
page=page + 1,
8888
per_page=per_page,
8989
request_options=request_options,
9090
)
@@ -396,7 +396,7 @@ async def list(
396396
async def _get_next():
397397
return await self.list(
398398
action_id,
399-
page=page + len(_items or []),
399+
page=page + 1,
400400
per_page=per_page,
401401
request_options=request_options,
402402
)

src/auth0/management/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import httpx
88
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9+
from .core.logging import LogConfig, Logger
910
from .environment import Auth0Environment
1011

1112
if typing.TYPE_CHECKING:
@@ -88,6 +89,9 @@ class Auth0:
8889
httpx_client : typing.Optional[httpx.Client]
8990
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
9091
92+
logging : typing.Optional[typing.Union[LogConfig, Logger]]
93+
Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
94+
9195
Examples
9296
--------
9397
from auth0 import Auth0
@@ -108,6 +112,7 @@ def __init__(
108112
timeout: typing.Optional[float] = None,
109113
follow_redirects: typing.Optional[bool] = True,
110114
httpx_client: typing.Optional[httpx.Client] = None,
115+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
111116
):
112117
_defaulted_timeout = (
113118
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
@@ -125,6 +130,7 @@ def __init__(
125130
if follow_redirects is not None
126131
else httpx.Client(timeout=_defaulted_timeout),
127132
timeout=_defaulted_timeout,
133+
logging=logging,
128134
)
129135
self._actions: typing.Optional[ActionsClient] = None
130136
self._branding: typing.Optional[BrandingClient] = None
@@ -549,6 +555,9 @@ class AsyncAuth0:
549555
httpx_client : typing.Optional[httpx.AsyncClient]
550556
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
551557
558+
logging : typing.Optional[typing.Union[LogConfig, Logger]]
559+
Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
560+
552561
Examples
553562
--------
554563
from auth0 import AsyncAuth0
@@ -569,6 +578,7 @@ def __init__(
569578
timeout: typing.Optional[float] = None,
570579
follow_redirects: typing.Optional[bool] = True,
571580
httpx_client: typing.Optional[httpx.AsyncClient] = None,
581+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
572582
):
573583
_defaulted_timeout = (
574584
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
@@ -586,6 +596,7 @@ def __init__(
586596
if follow_redirects is not None
587597
else httpx.AsyncClient(timeout=_defaulted_timeout),
588598
timeout=_defaulted_timeout,
599+
logging=logging,
589600
)
590601
self._actions: typing.Optional[AsyncActionsClient] = None
591602
self._branding: typing.Optional[AsyncBrandingClient] = None

src/auth0/management/clients/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ def update(
696696
Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients
697697
698698
allowed_logout_urls : typing.Optional[typing.Sequence[str]]
699-
URLs that are valid to redirect to after logout from Auth0.
699+
URLs that are valid to redirect to after logout from Auth0
700700
701701
jwt_configuration : typing.Optional[ClientJwtConfiguration]
702702
@@ -1589,7 +1589,7 @@ async def update(
15891589
Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients
15901590
15911591
allowed_logout_urls : typing.Optional[typing.Sequence[str]]
1592-
URLs that are valid to redirect to after logout from Auth0.
1592+
URLs that are valid to redirect to after logout from Auth0
15931593
15941594
jwt_configuration : typing.Optional[ClientJwtConfiguration]
15951595

src/auth0/management/clients/raw_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def list(
185185
_get_next = lambda: self.list(
186186
fields=fields,
187187
include_fields=include_fields,
188-
page=page + len(_items or []),
188+
page=page + 1,
189189
per_page=per_page,
190190
include_totals=include_totals,
191191
is_global=is_global,
@@ -949,7 +949,7 @@ def update(
949949
Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients
950950
951951
allowed_logout_urls : typing.Optional[typing.Sequence[str]]
952-
URLs that are valid to redirect to after logout from Auth0.
952+
URLs that are valid to redirect to after logout from Auth0
953953
954954
jwt_configuration : typing.Optional[ClientJwtConfiguration]
955955
@@ -1447,7 +1447,7 @@ async def _get_next():
14471447
return await self.list(
14481448
fields=fields,
14491449
include_fields=include_fields,
1450-
page=page + len(_items or []),
1450+
page=page + 1,
14511451
per_page=per_page,
14521452
include_totals=include_totals,
14531453
is_global=is_global,
@@ -2214,7 +2214,7 @@ async def update(
22142214
Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients
22152215
22162216
allowed_logout_urls : typing.Optional[typing.Sequence[str]]
2217-
URLs that are valid to redirect to after logout from Auth0.
2217+
URLs that are valid to redirect to after logout from Auth0
22182218
22192219
jwt_configuration : typing.Optional[ClientJwtConfiguration]
22202220

0 commit comments

Comments
 (0)