-
Notifications
You must be signed in to change notification settings - Fork 1
feat(generated): OrganizationMembership (batch e471ddef) #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| * [#113](https://github.com/workos/workos-rust/pull/113) fix(generated): regenerate from spec | ||
|
|
||
| **Fixes** | ||
| * **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: | ||
| * Added `roles` to organization membership models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| b6a68da8bd60c1478e0a86ca97c75448677e8871 | ||
| 1a2f47b20f63f2c8f0eb56bbd2adb3b5947d693a |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| mod audit_log_schema_target; | ||
| mod audit_log_schema_target_input; | ||
| mod audit_logs_retention; | ||
| mod auth_method_mismatch_error; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Prompt To Fix With AIThis is a comment left during a code review.
Path: src/models/mod.rs
Line: 43
Comment:
**Missing Generated Model Files**
This `mod` declaration requires a matching Rust source file, but the generated model file is not present. The same missing-file pattern applies to the newly declared pipes and session reauthentication model modules in this file, so the crate can fail to compile with `file not found for module` before SDK consumers can use it.
How can I resolve this? If you propose a fix, please make it concise. |
||
| mod authenticate_response; | ||
| mod authenticate_response_impersonator; | ||
| mod authenticate_response_oauth_token; | ||
|
|
@@ -337,7 +338,6 @@ | |
| mod organization_domain_data; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing Prompt To Fix With AIThis is a comment left during a code review.
Path: src/models/mod.rs
Line: 338
Comment:
**Removed Export Still Returned**
Removing `organization_domain_stand_alone` from the model module tree leaves the organization domain resource methods returning a type that is no longer exported through `crate::models::*`. Calls like `get_organization_domain` and `verify_organization_domain` still return `OrganizationDomainStandAlone`, so the crate can fail to compile with that type unresolved.
How can I resolve this? If you propose a fix, please make it concise. |
||
| mod organization_domain_deleted; | ||
| mod organization_domain_deleted_data; | ||
| mod organization_domain_stand_alone; | ||
| mod organization_domain_updated; | ||
| mod organization_domain_updated_data; | ||
| mod organization_domain_verification_failed; | ||
|
|
@@ -380,6 +380,8 @@ | |
| mod permission_updated_data; | ||
| mod pipe_connected_account; | ||
| mod pipes_connected_account_connected; | ||
| mod pipes_connected_account_connection_failed; | ||
| mod pipes_connected_account_connection_failed_data; | ||
| mod pipes_connected_account_disconnected; | ||
| mod pipes_connected_account_reauthorization_needed; | ||
| mod portal_link_response; | ||
|
|
@@ -413,6 +415,9 @@ | |
| mod session_created; | ||
| mod session_created_data; | ||
| mod session_created_data_impersonator; | ||
| mod session_reauthenticated; | ||
| mod session_reauthenticated_data; | ||
| mod session_reauthenticated_data_impersonator; | ||
| mod session_revoked; | ||
| mod session_revoked_data; | ||
| mod session_revoked_data_impersonator; | ||
|
|
@@ -554,6 +559,7 @@ | |
| pub use audit_log_schema_target::*; | ||
| pub use audit_log_schema_target_input::*; | ||
| pub use audit_logs_retention::*; | ||
| pub use auth_method_mismatch_error::*; | ||
| pub use authenticate_response::*; | ||
| pub use authenticate_response_impersonator::*; | ||
| pub use authenticate_response_oauth_token::*; | ||
|
|
@@ -851,7 +857,6 @@ | |
| pub use organization_domain_data::*; | ||
| pub use organization_domain_deleted::*; | ||
| pub use organization_domain_deleted_data::*; | ||
| pub use organization_domain_stand_alone::*; | ||
| pub use organization_domain_updated::*; | ||
| pub use organization_domain_updated_data::*; | ||
| pub use organization_domain_verification_failed::*; | ||
|
|
@@ -894,6 +899,8 @@ | |
| pub use permission_updated_data::*; | ||
| pub use pipe_connected_account::*; | ||
| pub use pipes_connected_account_connected::*; | ||
| pub use pipes_connected_account_connection_failed::*; | ||
| pub use pipes_connected_account_connection_failed_data::*; | ||
| pub use pipes_connected_account_disconnected::*; | ||
| pub use pipes_connected_account_reauthorization_needed::*; | ||
| pub use portal_link_response::*; | ||
|
|
@@ -927,6 +934,9 @@ | |
| pub use session_created::*; | ||
| pub use session_created_data::*; | ||
| pub use session_created_data_impersonator::*; | ||
| pub use session_reauthenticated::*; | ||
| pub use session_reauthenticated_data::*; | ||
| pub use session_reauthenticated_data_impersonator::*; | ||
| pub use session_revoked::*; | ||
| pub use session_revoked_data::*; | ||
| pub use session_revoked_data_impersonator::*; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,8 @@ pub struct OrganizationMembership { | |||||||||||
| pub updated_at: String, | ||||||||||||
| /// The primary role assigned to the user within the organization. | ||||||||||||
| pub role: SlimRole, | ||||||||||||
| /// The list of roles assigned to the user within the organization. | ||||||||||||
| pub roles: Vec<SlimRole>, | ||||||||||||
|
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This makes
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/models/organization_membership.rs
Line: 34-35
Comment:
**Missing Roles Rejects Responses**
This makes `roles` required during deserialization. If the API returns an organization membership with the existing `role` field but omits the new `roles` array, create or deactivate membership calls can receive a successful HTTP response and still fail with a serde `missing field 'roles'` error.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||
| /// The user that belongs to the organization through this membership. | ||||||||||||
| pub user: User, | ||||||||||||
| } | ||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,8 @@ pub struct UserOrganizationMembership { | |||||||||||
| pub updated_at: String, | ||||||||||||
| /// The primary role assigned to the user within the organization. | ||||||||||||
| pub role: SlimRole, | ||||||||||||
| /// The list of roles assigned to the user within the organization. | ||||||||||||
| pub roles: Vec<SlimRole>, | ||||||||||||
|
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This field is required for every user organization membership response. If list, get, update, or reactivate returns a membership with
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/models/user_organization_membership.rs
Line: 34-35
Comment:
**Missing Roles Rejects Memberships**
This field is required for every user organization membership response. If list, get, update, or reactivate returns a membership with `role` but without `roles`, deserialization fails instead of returning the membership to the caller.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||
| /// The user that belongs to the organization through this membership. | ||||||||||||
| pub user: User, | ||||||||||||
| } | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "code": "auth_method_mismatch", | ||
| "message": "This installation uses oauth authentication. Use the POST /:slug/token endpoint instead." | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "object": "event", | ||
| "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "event": "pipes.connected_account.connection_failed", | ||
| "data": { | ||
| "object": "connection_failed", | ||
| "data_integration_id": "data_integration_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "provider_slug": "github", | ||
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "error_code": "authorization_code_exchange_error", | ||
| "error_reason": "The authorization code has expired.", | ||
| "provider_error": "access_denied", | ||
| "provider_error_description": "The user denied the authorization request.", | ||
| "created_at": "2026-01-15T12:00:00.000Z" | ||
| }, | ||
| "created_at": "2026-01-15T12:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "object": "connection_failed", | ||
| "data_integration_id": "data_integration_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "provider_slug": "github", | ||
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "error_code": "authorization_code_exchange_error", | ||
| "error_reason": "The authorization code has expired.", | ||
| "provider_error": "access_denied", | ||
| "provider_error_description": "The user denied the authorization request.", | ||
| "created_at": "2026-01-15T12:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "object": "event", | ||
| "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "event": "session.reauthenticated", | ||
| "data": { | ||
| "object": "session", | ||
| "id": "session_01H93ZY4F80QPBEZ1R5B2SHQG8", | ||
| "ip_address": "198.51.100.42", | ||
| "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", | ||
| "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", | ||
| "auth_method": "sso", | ||
| "status": "active", | ||
| "expires_at": "2026-01-15T12:00:00.000Z", | ||
| "ended_at": "2023-01-01T00:00:00.000Z", | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z" | ||
| }, | ||
| "created_at": "2026-01-15T12:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "object": "session", | ||
| "id": "session_01H93ZY4F80QPBEZ1R5B2SHQG8", | ||
| "ip_address": "198.51.100.42", | ||
| "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", | ||
| "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", | ||
| "auth_method": "sso", | ||
| "status": "active", | ||
| "expires_at": "2026-01-15T12:00:00.000Z", | ||
| "ended_at": "2023-01-01T00:00:00.000Z", | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "email": "admin@foocorp.com", | ||
| "reason": "Investigating an issue with the customer's account." | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new enum module declarations require matching files under
src/enums/, but the generated enum files are not present. Building the crate can fail immediately withfile not found for modulefor the session reauthentication auth method and status enums.Prompt To Fix With AI