Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b6a68da8bd60c1478e0a86ca97c75448677e8871
1a2f47b20f63f2c8f0eb56bbd2adb3b5947d693a
8 changes: 7 additions & 1 deletion .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"language": "rust",
"generatedAt": "2026-06-17T20:55:36.966Z",
"generatedAt": "2026-06-25T13:50:49.546Z",
"files": [
"src/enums/audit_log_configuration_log_stream_state.rs",
"src/enums/audit_log_configuration_log_stream_type.rs",
Expand Down Expand Up @@ -717,6 +717,7 @@
"tests/fixtures/audit_log_schema_target.json",
"tests/fixtures/audit_log_schema_target_input.json",
"tests/fixtures/audit_logs_retention.json",
"tests/fixtures/auth_method_mismatch_error.json",
"tests/fixtures/authenticate_response.json",
"tests/fixtures/authenticate_response_impersonator.json",
"tests/fixtures/authenticate_response_oauth_token.json",
Expand Down Expand Up @@ -1055,6 +1056,8 @@
"tests/fixtures/permission_updated_data.json",
"tests/fixtures/pipe_connected_account.json",
"tests/fixtures/pipes_connected_account_connected.json",
"tests/fixtures/pipes_connected_account_connection_failed.json",
"tests/fixtures/pipes_connected_account_connection_failed_data.json",
"tests/fixtures/pipes_connected_account_disconnected.json",
"tests/fixtures/pipes_connected_account_reauthorization_needed.json",
"tests/fixtures/portal_link_response.json",
Expand Down Expand Up @@ -1088,6 +1091,9 @@
"tests/fixtures/session_created.json",
"tests/fixtures/session_created_data.json",
"tests/fixtures/session_created_data_impersonator.json",
"tests/fixtures/session_reauthenticated.json",
"tests/fixtures/session_reauthenticated_data.json",
"tests/fixtures/session_reauthenticated_data_impersonator.json",
"tests/fixtures/session_revoked.json",
"tests/fixtures/session_revoked_data.json",
"tests/fixtures/session_revoked_data_impersonator.json",
Expand Down
8 changes: 4 additions & 4 deletions src/enums/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
pub mod organization_domain_data_state;
pub mod organization_domain_deleted_data_state;
pub mod organization_domain_deleted_data_verification_strategy;
pub mod organization_domain_stand_alone_state;
pub mod organization_domain_stand_alone_verification_strategy;
pub mod organization_domain_state;
pub mod organization_domain_updated_data_state;
pub mod organization_domain_updated_data_verification_strategy;
Expand Down Expand Up @@ -97,6 +95,8 @@
pub mod role_type;
pub mod session_created_data_auth_method;
pub mod session_created_data_status;
pub mod session_reauthenticated_data_auth_method;

Check failure on line 98 in src/enums/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `session_reauthenticated_data_auth_method`
pub mod session_reauthenticated_data_status;

Check failure on line 99 in src/enums/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `session_reauthenticated_data_status`
Comment on lines +98 to +99

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Missing Generated Enum Files

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 with file not found for module for the session reauthentication auth method and status enums.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/enums/mod.rs
Line: 98-99

Comment:
**Missing Generated Enum Files**

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 with `file not found for module` for the session reauthentication auth method and status enums.

How can I resolve this? If you propose a fix, please make it concise.

pub mod session_revoked_data_auth_method;
pub mod session_revoked_data_status;
pub mod sso_provider;
Expand Down Expand Up @@ -193,8 +193,6 @@
pub use organization_domain_data_state::*;
pub use organization_domain_deleted_data_state::*;
pub use organization_domain_deleted_data_verification_strategy::*;
pub use organization_domain_stand_alone_state::*;
pub use organization_domain_stand_alone_verification_strategy::*;
pub use organization_domain_state::*;
pub use organization_domain_updated_data_state::*;
pub use organization_domain_updated_data_verification_strategy::*;
Expand Down Expand Up @@ -224,6 +222,8 @@
pub use role_type::*;
pub use session_created_data_auth_method::*;
pub use session_created_data_status::*;
pub use session_reauthenticated_data_auth_method::*;
pub use session_reauthenticated_data_status::*;
pub use session_revoked_data_auth_method::*;
pub use session_revoked_data_status::*;
pub use sso_provider::*;
Expand Down
14 changes: 12 additions & 2 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
mod audit_log_schema_target;
mod audit_log_schema_target_input;
mod audit_logs_retention;
mod auth_method_mismatch_error;

Check failure on line 43 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `auth_method_mismatch_error`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 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.

Prompt To Fix With AI
This 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;
Expand Down Expand Up @@ -337,7 +338,6 @@
mod organization_domain_data;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 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.

Prompt To Fix With AI
This 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;
Expand Down Expand Up @@ -380,6 +380,8 @@
mod permission_updated_data;
mod pipe_connected_account;
mod pipes_connected_account_connected;
mod pipes_connected_account_connection_failed;

Check failure on line 383 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `pipes_connected_account_connection_failed`
mod pipes_connected_account_connection_failed_data;

Check failure on line 384 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `pipes_connected_account_connection_failed_data`
mod pipes_connected_account_disconnected;
mod pipes_connected_account_reauthorization_needed;
mod portal_link_response;
Expand Down Expand Up @@ -413,6 +415,9 @@
mod session_created;
mod session_created_data;
mod session_created_data_impersonator;
mod session_reauthenticated;

Check failure on line 418 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `session_reauthenticated`
mod session_reauthenticated_data;

Check failure on line 419 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `session_reauthenticated_data`
mod session_reauthenticated_data_impersonator;

Check failure on line 420 in src/models/mod.rs

View workflow job for this annotation

GitHub Actions / Test Rust

file not found for module `session_reauthenticated_data_impersonator`
mod session_revoked;
mod session_revoked_data;
mod session_revoked_data_impersonator;
Expand Down Expand Up @@ -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::*;
Expand Down Expand Up @@ -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::*;
Expand Down Expand Up @@ -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::*;
Expand Down Expand Up @@ -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::*;
Expand Down
2 changes: 2 additions & 0 deletions src/models/organization_membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Suggested change
/// The list of roles assigned to the user within the organization.
pub roles: Vec<SlimRole>,
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
Prompt To Fix With AI
This 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,
}
2 changes: 2 additions & 0 deletions src/models/user_organization_membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Suggested change
/// The list of roles assigned to the user within the organization.
pub roles: Vec<SlimRole>,
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
Prompt To Fix With AI
This 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,
}
4 changes: 4 additions & 0 deletions tests/fixtures/auth_method_mismatch_error.json
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."
}
7 changes: 6 additions & 1 deletion tests/fixtures/organization_membership.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"last_sign_in_at": "2025-06-25T19:07:33.155Z",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
}
},
"roles": [
{
"slug": "admin"
}
]
}
18 changes: 18 additions & 0 deletions tests/fixtures/pipes_connected_account_connection_failed.json
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"
}
12 changes: 12 additions & 0 deletions tests/fixtures/pipes_connected_account_connection_failed_data.json
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"
}
19 changes: 19 additions & 0 deletions tests/fixtures/session_reauthenticated.json
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"
}
13 changes: 13 additions & 0 deletions tests/fixtures/session_reauthenticated_data.json
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"
}
4 changes: 4 additions & 0 deletions tests/fixtures/session_reauthenticated_data_impersonator.json
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."
}
7 changes: 6 additions & 1 deletion tests/fixtures/user_organization_membership.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"last_sign_in_at": "2025-06-25T19:07:33.155Z",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
}
},
"roles": [
{
"slug": "admin"
}
]
}
5 changes: 5 additions & 0 deletions tests/fixtures/user_organization_membership_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"role": {
"slug": "admin"
},
"roles": [
{
"slug": "admin"
}
],
"user": {
"object": "user",
"id": "user_01E4ZCR3C56J083X43JQXF3JK5",
Expand Down
Loading