Skip to content
Open
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
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47bcae12b5f6645e1a33184346e7e8d8df7b9ec8
e4da019bddceb527499ab7c8c290aebfae300751
162 changes: 160 additions & 2 deletions spec/open-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16164,6 +16164,8 @@ paths:
config:
instance_url: https://example.my.salesforce.com
state: connected
established_by_user_id: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason: null
created_at: '2024-01-16T14:20:00.000Z'
updated_at: '2024-01-16T14:20:00.000Z'
'400':
Expand Down Expand Up @@ -16372,6 +16374,8 @@ paths:
config:
instance_url: https://example.my.salesforce.com
state: connected
established_by_user_id: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason: null
created_at: '2024-01-16T14:20:00.000Z'
updated_at: '2024-01-16T14:20:00.000Z'
'401':
Expand Down Expand Up @@ -16633,6 +16637,8 @@ paths:
config:
instance_url: https://example.my.salesforce.com
state: connected
established_by_user_id: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason: null
created_at: '2024-01-16T14:20:00.000Z'
updated_at: '2024-01-16T14:20:00.000Z'
'400':
Expand Down Expand Up @@ -16802,6 +16808,8 @@ paths:
config:
instance_url: https://example.my.salesforce.com
state: connected
established_by_user_id: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason: null
created_at: '2024-01-16T14:20:00.000Z'
updated_at: '2024-01-16T14:20:00.000Z'
userlandUserId: null
Expand Down Expand Up @@ -34920,6 +34928,29 @@ components:
- needs_reauthorization
description: The state of the connected account.
example: connected
established_by_user_id:
type:
- string
- 'null'
description: >-
The ID of the User whose authorization established the connected
account, or null when it is developer-managed, its establisher is
unknown, or the establishing member left the organization.
Historical events may omit this field.
example: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason:
description: >-
Why WorkOS put the connected account in its current state, or null
when there is no WorkOS-recorded reason.
`establishing_member_membership_ended` means the member who
established an organization-owned connection is no longer an active
member. Additional values may be added. Historical events may omit
this field.
example: null
oneOf:
- type: string
const: establishing_member_membership_ended
- type: 'null'
created_at:
format: date-time
type: string
Expand Down Expand Up @@ -47078,9 +47109,40 @@ components:

- `needs_reauthorization`: The user needs to reauthorize the
connection, typically because required scopes have changed.
`state_reason` explains why when WorkOS invalidated the connection
itself.

- `disconnected`: The connection has been disconnected.
example: connected
established_by_user_id:
type:
- string
- 'null'
description: >-
The [User](/reference/authkit/user) whose authorization established
this connection. `null` when the connection is developer-managed or
its establisher is unknown, and when the establishing member lost
access to the organization — in which case `state_reason` is
`establishing_member_membership_ended`.
example: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason:
description: >-
Why WorkOS put the connection in its current `state`, or `null` when
there is no WorkOS-recorded reason:

- `establishing_member_membership_ended`: The member who established
this organization-owned connection is no longer an active member of
the organization, so its credentials were cleared. An organization
admin must provide new credentials.


Additional values may be added; treat an unrecognized value as an
unknown reason.
example: null
oneOf:
- type: string
const: establishing_member_membership_ended
- type: 'null'
Comment on lines +47142 to +47145

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Future reasons are rejected

The description says clients should accept new state_reason values as unknown, but this schema accepts only establishing_member_membership_ended or null. If WorkOS adds another reason, responses containing it will fail schema validation. The same restriction appears in the other connected-account schemas, so the field should allow other string values wherever it is defined.

Prompt To Fix With AI
This is a comment left during a code review.
Path: spec/open-api-spec.yaml
Line: 47142-47145

Comment:
**Future reasons are rejected**

The description says clients should accept new `state_reason` values as unknown, but this schema accepts only `establishing_member_membership_ended` or `null`. If WorkOS adds another reason, responses containing it will fail schema validation. The same restriction appears in the other connected-account schemas, so the field should allow other string values wherever it is defined.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

created_at:
type: string
description: The timestamp when the connection was created.
Expand Down Expand Up @@ -47372,11 +47434,44 @@ components:

- `needs_reauthorization`: The user needs to
reauthorize the connection, typically because required
scopes have changed.
scopes have changed. `state_reason` explains why when
WorkOS invalidated the connection itself.

- `disconnected`: The connection has been
disconnected.
example: connected
established_by_user_id:
type:
- string
- 'null'
description: >-
The [User](/reference/authkit/user) whose
authorization established this connection. `null` when
the connection is developer-managed or its establisher
is unknown, and when the establishing member lost
access to the organization — in which case
`state_reason` is
`establishing_member_membership_ended`.
example: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason:
description: >-
Why WorkOS put the connection in its current `state`,
or `null` when there is no WorkOS-recorded reason:

- `establishing_member_membership_ended`: The member
who established this organization-owned connection is
no longer an active member of the organization, so its
credentials were cleared. An organization admin must
provide new credentials.


Additional values may be added; treat an unrecognized
value as an unknown reason.
example: null
oneOf:
- type: string
const: establishing_member_membership_ended
- type: 'null'
created_at:
type: string
description: The timestamp when the connection was created.
Expand Down Expand Up @@ -47547,10 +47642,42 @@ components:

- `needs_reauthorization`: The user needs to reauthorize
the connection, typically because required scopes have
changed.
changed. `state_reason` explains why when WorkOS
invalidated the connection itself.

- `disconnected`: The connection has been disconnected.
example: connected
established_by_user_id:
type:
- string
- 'null'
description: >-
The [User](/reference/authkit/user) whose authorization
established this connection. `null` when the connection
is developer-managed or its establisher is unknown, and
when the establishing member lost access to the
organization — in which case `state_reason` is
`establishing_member_membership_ended`.
example: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason:
description: >-
Why WorkOS put the connection in its current `state`, or
`null` when there is no WorkOS-recorded reason:

- `establishing_member_membership_ended`: The member who
established this organization-owned connection is no
longer an active member of the organization, so its
credentials were cleared. An organization admin must
provide new credentials.


Additional values may be added; treat an unrecognized
value as an unknown reason.
example: null
oneOf:
- type: string
const: establishing_member_membership_ended
- type: 'null'
created_at:
type: string
description: The timestamp when the connection was created.
Expand Down Expand Up @@ -47747,9 +47874,40 @@ components:

- `needs_reauthorization`: The user needs to reauthorize the
connection, typically because required scopes have changed.
`state_reason` explains why when WorkOS invalidated the connection
itself.

- `disconnected`: The connection has been disconnected.
example: connected
established_by_user_id:
type:
- string
- 'null'
description: >-
The [User](/reference/authkit/user) whose authorization established
this connection. `null` when the connection is developer-managed or
its establisher is unknown, and when the establishing member lost
access to the organization — in which case `state_reason` is
`establishing_member_membership_ended`.
example: user_01EHZNVPK3SFK441A1RGBFSHRT
state_reason:
description: >-
Why WorkOS put the connection in its current `state`, or `null` when
there is no WorkOS-recorded reason:

- `establishing_member_membership_ended`: The member who established
this organization-owned connection is no longer an active member of
the organization, so its credentials were cleared. An organization
admin must provide new credentials.


Additional values may be added; treat an unrecognized value as an
unknown reason.
example: null
oneOf:
- type: string
const: establishing_member_membership_ended
- type: 'null'
created_at:
type: string
description: The timestamp when the connection was created.
Expand Down
Loading