Skip to content

Commit b05b561

Browse files
fern-api[bot]fern-supporttstanmay13developerkunal
authored
feat: add retry support, FedCM login types, and error schemas (#841)
### Changes - Added configurable `max_retries` parameter to `Auth0` and `AsyncAuth0` clients (defaults to 2 with exponential backoff) - New error types: `BadRequestSchema`, `ForbiddenSchema`, `UnauthorizedSchema`, `TooManyRequestsSchema` - New types: `FedCmLogin`, `FedCmLoginGoogle`, `CredentialDeviceTypeEnum` - Extended `user_authentication_method` and `resource_server` response types with additional fields - Updated connection types with additional validation fields - Expanded `clients`, `refresh_tokens`, `resource_servers`, `tickets`, and `users/authentication_methods` endpoint parameters ### Testing - Wire tests cover new and updated endpoints - CI matrix runs on Python 3.10, 3.11, 3.12, 3.13 - [ ] This change adds unit test coverage - [x] This change has been tested on the latest version of the platform/language or why not ### Checklist - [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) - [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) - [x] All existing and new tests complete without errors --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Fern Support <126544928+fern-support@users.noreply.github.com> Co-authored-by: Tanmay Singh <tstanmay13@gmail.com> Co-authored-by: Kunal Dawar <35455566+developerkunal@users.noreply.github.com> Co-authored-by: Kunal Dawar <kunal.dawar@okta.com>
1 parent 18f283e commit b05b561

74 files changed

Lines changed: 1962 additions & 212 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: 900 additions & 24 deletions
Large diffs are not rendered by default.

.fernignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ tests/authentication/
2020
src/auth0/__init__.py
2121
src/auth0/py.typed
2222

23-
# Telemetry customization (Auth0 format with dynamic versioning)
24-
src/auth0/management/core/client_wrapper.py
25-
2623
# Files edited to incorporate both APIs
2724
pyproject.toml
2825
poetry.lock

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Python 3.9+
10+
- pip
11+
- poetry
12+
13+
### Installation
14+
15+
Install the project dependencies:
16+
17+
```bash
18+
poetry install
19+
```
20+
21+
### Building
22+
23+
Build the project:
24+
25+
```bash
26+
poetry build
27+
```
28+
29+
### Testing
30+
31+
Run the test suite:
32+
33+
```bash
34+
poetry run pytest
35+
```
36+
37+
### Linting and Formatting
38+
39+
Check code style:
40+
41+
```bash
42+
poetry run ruff check .
43+
poetry run ruff format .
44+
```
45+
46+
### Type Checking
47+
48+
Run the type checker:
49+
50+
```bash
51+
poetry run mypy .
52+
```
53+
54+
## About Generated Code
55+
56+
**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
57+
58+
### Generated Files
59+
60+
The following directories contain generated code:
61+
- `src/` - API client classes and types
62+
- Most Python files in the project
63+
64+
### How to Customize
65+
66+
If you need to customize the SDK, you have two options:
67+
68+
#### Option 1: Use `.fernignore`
69+
70+
For custom code that should persist across SDK regenerations:
71+
72+
1. Create a `.fernignore` file in the project root
73+
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
74+
3. Add your custom code to those files
75+
76+
Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
77+
78+
For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
79+
80+
#### Option 2: Contribute to the Generator
81+
82+
If you want to change how code is generated for all users of this SDK:
83+
84+
1. The Python SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
85+
2. Generator code is located at `generators/python-v2/`
86+
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
87+
4. Submit a pull request with your changes to the generator
88+
89+
This approach is best for:
90+
- Bug fixes in generated code
91+
- New features that would benefit all users
92+
- Improvements to code generation patterns
93+
94+
## Making Changes
95+
96+
### Workflow
97+
98+
1. Create a new branch for your changes
99+
2. Make your modifications
100+
3. Run tests to ensure nothing breaks: `poetry run pytest`
101+
4. Run linting and formatting: `poetry run ruff check .` and `poetry run ruff format .`
102+
5. Run type checking: `poetry run mypy .`
103+
6. Build the project: `poetry build`
104+
7. Commit your changes with a clear commit message
105+
8. Push your branch and create a pull request
106+
107+
### Commit Messages
108+
109+
Write clear, descriptive commit messages that explain what changed and why.
110+
111+
### Code Style
112+
113+
This project uses automated code formatting and linting. Run `poetry run ruff format .` and `poetry run ruff check .` before committing to ensure your code meets the project's style guidelines.
114+
115+
## Questions or Issues?
116+
117+
If you have questions or run into issues:
118+
119+
1. Check the [Fern documentation](https://buildwithfern.com)
120+
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
121+
3. Open a new issue if your question hasn't been addressed
122+
123+
## License
124+
125+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.

reference.md

Lines changed: 111 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,14 @@ client.clients.create(
19021902
<dl>
19031903
<dd>
19041904

1905+
**fedcm_login:** `typing.Optional[FedCmLogin]`
1906+
1907+
</dd>
1908+
</dl>
1909+
1910+
<dl>
1911+
<dd>
1912+
19051913
**refresh_token:** `typing.Optional[ClientRefreshTokenConfiguration]`
19061914

19071915
</dd>
@@ -2167,10 +2175,19 @@ client.clients.preview_cimd_metadata(
21672175
<dl>
21682176
<dd>
21692177

2178+
Idempotent registration for Client ID Metadata Document (CIMD) clients.
2179+
Uses external_client_id as the unique identifier for upsert operations.
2180+
2181+
<strong>Create:</strong> Returns 201 when a new client is created (requires <code>create:clients</code> scope).
2182+
<strong>Update:</strong> Returns 200 when an existing client is updated (requires <code>update:clients</code> scope).
21702183

2171-
Idempotent registration for Client ID Metadata Document (CIMD) clients.
2172-
Uses external_client_id as the unique identifier for upsert operations.
2173-
**Create:** Returns 201 when a new client is created (requires \
2184+
This endpoint automatically:
2185+
<ul>
2186+
<li>Fetches and validates the metadata document</li>
2187+
<li>Maps CIMD fields to Auth0 client configuration</li>
2188+
<li>Creates/rotates credentials from the JWKS</li>
2189+
<li>Enforces CIMD security policies (HTTPS-only, no shared secrets)</li>
2190+
</ul>
21742191
</dd>
21752192
</dl>
21762193
</dd>
@@ -2774,6 +2791,14 @@ client.clients.update(
27742791
<dl>
27752792
<dd>
27762793

2794+
**fedcm_login:** `typing.Optional[FedCmLogin]`
2795+
2796+
</dd>
2797+
</dl>
2798+
2799+
<dl>
2800+
<dd>
2801+
27772802
**refresh_token:** `typing.Optional[ClientRefreshTokenConfiguration]`
27782803

27792804
</dd>
@@ -10953,6 +10978,14 @@ client.refresh_tokens.revoke()
1095310978
<dl>
1095410979
<dd>
1095510980

10981+
**audience:** `typing.Optional[str]` — Resource server identifier (audience) to scope the revocation. Must be used with both `user_id` and `client_id`.
10982+
10983+
</dd>
10984+
</dl>
10985+
10986+
<dl>
10987+
<dd>
10988+
1095610989
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1095710990

1095810991
</dd>
@@ -11413,6 +11446,14 @@ client.resource_servers.create(
1141311446
<dl>
1141411447
<dd>
1141511448

11449+
**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false).
11450+
11451+
</dd>
11452+
</dl>
11453+
11454+
<dl>
11455+
<dd>
11456+
1141611457
**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint.
1141711458

1141811459
</dd>
@@ -11777,6 +11818,14 @@ client.resource_servers.update(
1177711818
<dl>
1177811819
<dd>
1177911820

11821+
**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false).
11822+
11823+
</dd>
11824+
</dl>
11825+
11826+
<dl>
11827+
<dd>
11828+
1178011829
**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint.
1178111830

1178211831
</dd>
@@ -14222,7 +14271,7 @@ client.tickets.change_password()
1422214271
<dl>
1422314272
<dd>
1422414273

14225-
**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.
14274+
**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using organization_id. May be specified together with client_id when the tenant has a custom password reset page enabled and a password-reset-post-challenge Action bound.
1422614275

1422714276
</dd>
1422814277
</dl>
@@ -34782,15 +34831,23 @@ client.users.authentication_methods.create(
3478234831
<dl>
3478334832
<dd>
3478434833

34785-
**key_id:** `typing.Optional[str]` — Applies to webauthn authentication methods only. The id of the credential.
34834+
**key_id:** `typing.Optional[str]` — Applies to webauthn/passkey authentication methods only. The id of the credential.
34835+
34836+
</dd>
34837+
</dl>
34838+
34839+
<dl>
34840+
<dd>
34841+
34842+
**public_key:** `typing.Optional[str]` — Applies to webauthn/passkey authentication methods only. The public key, which is encoded as base64.
3478634843

3478734844
</dd>
3478834845
</dl>
3478934846

3479034847
<dl>
3479134848
<dd>
3479234849

34793-
**public_key:** `typing.Optional[str]` — Applies to webauthn authentication methods only. The public key, which is encoded as base64.
34850+
**aaguid:** `typing.Optional[str]` — Applies to passkeys only. Authenticator Attestation Globally Unique Identifier
3479434851

3479534852
</dd>
3479634853
</dl>
@@ -34806,6 +34863,54 @@ client.users.authentication_methods.create(
3480634863
<dl>
3480734864
<dd>
3480834865

34866+
**credential_device_type:** `typing.Optional[CredentialDeviceTypeEnum]`
34867+
34868+
</dd>
34869+
</dl>
34870+
34871+
<dl>
34872+
<dd>
34873+
34874+
**credential_backed_up:** `typing.Optional[bool]` — Applies to passkeys only. Whether the credential was backed up.
34875+
34876+
</dd>
34877+
</dl>
34878+
34879+
<dl>
34880+
<dd>
34881+
34882+
**identity_user_id:** `typing.Optional[str]` — Applies to passkeys only. The ID of the user identity linked with the authentication method.
34883+
34884+
</dd>
34885+
</dl>
34886+
34887+
<dl>
34888+
<dd>
34889+
34890+
**user_agent:** `typing.Optional[str]` — Applies to passkeys only. The user-agent of the browser used to create the passkey.
34891+
34892+
</dd>
34893+
</dl>
34894+
34895+
<dl>
34896+
<dd>
34897+
34898+
**user_handle:** `typing.Optional[str]` — Applies to passkeys only. The user handle of the user identity.
34899+
34900+
</dd>
34901+
</dl>
34902+
34903+
<dl>
34904+
<dd>
34905+
34906+
**transports:** `typing.Optional[typing.List[str]]` — Applies to passkeys only. The transports used by clients to communicate with the authenticator.
34907+
34908+
</dd>
34909+
</dl>
34910+
34911+
<dl>
34912+
<dd>
34913+
3480934914
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
3481034915

3481134916
</dd>

0 commit comments

Comments
 (0)