feat(generated): AdminPortal, Authorization, Webhooks, UserManagement, AuditLogs (batch 08085e9d)#683
Conversation
…ion, Webhooks, UserManagement, AuditLogs
There was a problem hiding this comment.
🟡 PKCE convenience wrapper silently drops the new re-authentication age limit parameter
The new re-authentication age limit is added to the authorization URL builder (max_age at src/workos/user_management/_resource.py:462) but is never accepted or forwarded by the PKCE convenience wrapper that delegates to it, so callers using the wrapper cannot force re-authentication.
Impact: Users relying on the PKCE helper cannot request re-authentication; they must bypass the helper and build the URL manually.
Hand-maintained wrapper omits new parameter added to auto-generated method
The PR adds max_age: Optional[int] = None to both the sync get_authorization_url (src/workos/user_management/_resource.py:462) and async version (src/workos/user_management/_resource.py:2593), and correctly includes it in the URL params dict.
However, the hand-maintained get_authorization_url_with_pkce (sync at line 2097, async at line 4228) calls get_authorization_url without passing max_age. Both wrappers are inside the @oagen-ignore-start / @oagen-ignore-end block so the code generator does not update them.
Sync wrapper call at src/workos/user_management/_resource.py:2140-2155:
url = self.get_authorization_url(
redirect_uri=redirect_uri,
code_challenge=pair.code_challenge,
code_challenge_method="S256",
state=state,
provider=provider,
connection_id=connection_id,
organization_id=organization_id,
domain_hint=domain_hint,
login_hint=login_hint,
screen_hint=screen_hint,
prompt=prompt,
provider_scopes=provider_scopes,
provider_query_params=provider_query_params,
invitation_token=invitation_token,
# max_age is missing here
)The same omission exists in the async wrapper at src/workos/user_management/_resource.py:4271-4286.
(Refers to lines 2097-2156)
Prompt for agents
The hand-maintained get_authorization_url_with_pkce method (both sync at line 2097 and async at line 4228) needs to be updated to accept and forward the new max_age parameter to get_authorization_url.
For both the sync version (UserManagement class) and async version (AsyncUserManagement class):
1. Add max_age: Optional[int] = None to the method signature of get_authorization_url_with_pkce
2. Pass max_age=max_age in the call to self.get_authorization_url inside the method body
3. Update the docstring to document the new parameter
The sync wrapper is at line 2097-2156 and the async wrapper is at line 4228-4287.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| from .._types import RequestOptions, enum_value | ||
| from .models import IntentOptions, PortalLinkResponse | ||
| from .models import PortalLinkResponse |
There was a problem hiding this comment.
🚩 Removal of intent_options is a breaking API change for existing callers
The intent_options parameter was removed from both AdminPortal.generate_link and AsyncAdminPortal.generate_link (src/workos/admin_portal/_resource.py:11,28-29), and from the GenerateLink model. The IntentOptions, SSOIntentOptions, and DomainVerificationIntentOptions classes still exist in src/workos/admin_portal/models/ and are still exported from __init__.py via wildcard imports. Any existing callers passing intent_options=... will get a TypeError at runtime. Since this is auto-generated and reflects an API spec change, it's presumably intentional, but it's a breaking change worth noting.
Was this helpful? React with 👍 or 👎 to provide feedback.
Greptile SummaryThis PR regenerates SDK models, fixtures, and resource methods from updated API specs. The main changes are:
Confidence Score: 4/5This PR has one contained compatibility bug that should be fixed before release. Most changes are generated model and endpoint additions with matching fixtures and tests.
What T-Rex did
Important Files Changed
|
| result["range_start"] = _format_datetime(self.range_start) | ||
| result["range_end"] = _format_datetime(self.range_end) |
There was a problem hiding this comment.
Preserve string dates
range_start and range_end were public ISO-8601 string fields before this regeneration, but to_dict() now unconditionally calls _format_datetime(). Existing callers that construct AuditLogExportCreation(range_start="2022-...Z", range_end="2022-...Z") now hit AttributeError: 'str' object has no attribute 'isoformat' during serialization, even though the resource method and docs still accept strings for export ranges.
Artifacts
Repro: minimal script constructing AuditLogExportCreation with string dates and calling to_dict
- Contains supporting evidence from the run (text/x-python; charset=utf-8).
Repro: command output and full traceback showing AttributeError from to_dict/_format_datetime
- Keeps the command output available without making the summary code-heavy.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/audit_logs/models/audit_log_export_creation.py
Line: 56-57
Comment:
**Preserve string dates**
`range_start` and `range_end` were public ISO-8601 string fields before this regeneration, but `to_dict()` now unconditionally calls `_format_datetime()`. Existing callers that construct `AuditLogExportCreation(range_start="2022-...Z", range_end="2022-...Z")` now hit `AttributeError: 'str' object has no attribute 'isoformat'` during serialization, even though the resource method and docs still accept strings for export ranges.
How can I resolve this? If you propose a fix, please make it concise.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@704603f