workos 6.0.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +2 -2
  3. data/.github/workflows/ci.yml +1 -1
  4. data/.github/workflows/lint-pr-title.yml +20 -0
  5. data/.github/workflows/release-please.yml +25 -0
  6. data/.github/workflows/release.yml +7 -43
  7. data/.release-please-manifest.json +3 -0
  8. data/CHANGELOG.md +28 -0
  9. data/Gemfile.lock +1 -1
  10. data/lib/workos/organization_membership.rb +4 -1
  11. data/lib/workos/user_management.rb +27 -0
  12. data/lib/workos/version.rb +1 -1
  13. data/release-please-config.json +12 -0
  14. data/renovate.json +32 -0
  15. data/spec/lib/workos/user_management_spec.rb +140 -0
  16. data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +1 -1
  17. data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml +1 -1
  18. data/spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml +1 -1
  19. data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +1 -1
  20. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +1 -1
  21. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +1 -1
  22. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml +1 -1
  23. data/spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml +1 -1
  24. data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml +1 -1
  25. data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml +1 -1
  26. metadata +8 -4
  27. data/.github/renovate.json +0 -5
  28. data/.github/workflows/version-bump.yml +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f0ac87a768fc79fa7ffbc77d0bf4a1ba30cbf6c1f5b96f8574c40bd2b61d296
4
- data.tar.gz: eb05af387d9c1c40e5de4fb830e4ce83e7baf94a2d9bcb428d97032208688780
3
+ metadata.gz: c9c6ccd08e504b94efe3d05a9d17efdd7cb6aa51d6b967fc501795c8c3436ac7
4
+ data.tar.gz: 20387dad535d45bbb77f91fad656227ab22a7488c0450d96c7ef275ffdd5bbdd
5
5
  SHA512:
6
- metadata.gz: 5f82d97362d7063dcc970313794671ca7f8c2c8892ae9728179e3c22a980b1d7e3d238959eb875d4a20629f13c00a56053347a70dfcb2214cf769979fc704151
7
- data.tar.gz: 5954446fc2d3c6fbad2542c7d377bb7eb8361e514d1d099f01c052085aebc6952277fd15efe7e3cf9683fc2a9dbf4976240098d48e9305607ab3233978b23f21
6
+ metadata.gz: 19b1c44a201a6f7a991d140e05530807019b239d7781587aad85edae61a35cce2456c812b659ec75679f5667327fc42f64455b152b6ca3bcfcccedeb01431e36
7
+ data.tar.gz: dfcac436c3f95c90412a0122c241a5e48b90fdf1d5ec0bcfd2974b73819a9731cc2172e697861d9c14f9a5c66fcbc0d30bed3d56f62cd23a8782dc7effee46db
data/.github/CODEOWNERS CHANGED
@@ -1,5 +1,5 @@
1
1
  # See GitHub's docs for more details:
2
2
  # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3
3
 
4
- # Rubyist Team
5
- * @workos/ruby
4
+ # Rubyist and DX Teams
5
+ * @workos/ruby @workos/dx
@@ -20,7 +20,7 @@ jobs:
20
20
  - '3.1'
21
21
  - '3.2'
22
22
  steps:
23
- - uses: actions/checkout@v6
23
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24
24
  - uses: ruby/setup-ruby@675dd7ba1b06c8786a1480d89c384f5620a42647 # v1.281.0
25
25
  with:
26
26
  ruby-version: ${{ matrix.ruby }}
@@ -0,0 +1,20 @@
1
+ name: Lint PR Title
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ permissions:
11
+ pull-requests: read
12
+
13
+ jobs:
14
+ main:
15
+ name: Validate PR title
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,25 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Generate token
17
+ id: generate-token
18
+ uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
19
+ with:
20
+ app-id: ${{ vars.SDK_BOT_APP_ID }}
21
+ private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
22
+
23
+ - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
24
+ with:
25
+ token: ${{ steps.generate-token.outputs.token }}
@@ -1,68 +1,31 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- pull_request:
5
- types: [closed]
6
- branches: [main]
4
+ release:
5
+ types: [published]
7
6
 
8
7
  defaults:
9
8
  run:
10
9
  shell: bash
11
10
 
12
11
  jobs:
13
- create-release:
14
- name: Create GitHub Release
15
- if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'version-bump')
16
- runs-on: ubuntu-latest
17
- permissions:
18
- contents: write
19
- outputs:
20
- version: ${{ steps.get-version.outputs.version }}
21
- steps:
22
- - name: Generate token
23
- id: generate-token
24
- uses: actions/create-github-app-token@v2
25
- with:
26
- app-id: ${{ vars.SDK_BOT_APP_ID }}
27
- private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
28
-
29
- - name: Checkout
30
- uses: actions/checkout@v6
31
- with:
32
- token: ${{ steps.generate-token.outputs.token }}
33
-
34
- - name: Get version from version.rb
35
- id: get-version
36
- run: |
37
- VERSION=$(grep "VERSION = " lib/workos/version.rb | sed "s/.*VERSION = '\(.*\)'/\1/")
38
- echo "version=$VERSION" >> $GITHUB_OUTPUT
39
-
40
- - name: Create Release
41
- uses: softprops/action-gh-release@v2
42
- with:
43
- tag_name: v${{ steps.get-version.outputs.version }}
44
- name: v${{ steps.get-version.outputs.version }}
45
- generate_release_notes: true
46
- token: ${{ steps.generate-token.outputs.token }}
47
-
48
12
  publish:
49
13
  name: Publish to RubyGems
50
- needs: create-release
51
14
  runs-on: ubuntu-latest
52
15
  permissions:
53
16
  id-token: write
54
17
  contents: read
55
18
  steps:
56
19
  - name: Configure RubyGems credentials
57
- uses: rubygems/configure-rubygems-credentials@main
20
+ uses: rubygems/configure-rubygems-credentials@88679b3ac821ffda0116bf098443db9ac7822e40
58
21
  with:
59
22
  role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka
60
23
 
61
24
  - name: Checkout
62
- uses: actions/checkout@v6
25
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
63
26
 
64
27
  - name: Setup Ruby
65
- uses: ruby/setup-ruby@v1
28
+ uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
66
29
  with:
67
30
  ruby-version: "3.2"
68
31
  bundler-cache: true
@@ -72,5 +35,6 @@ jobs:
72
35
 
73
36
  - name: Publish to RubyGems
74
37
  run: |
38
+ VERSION="${GITHUB_REF_NAME#v}"
75
39
  bundle exec rake build
76
- gem push pkg/workos-${{ needs.create-release.outputs.version }}.gem --host https://rubygems.org
40
+ gem push pkg/workos-${VERSION}.gem --host https://rubygems.org
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "6.2.0"
3
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ ## [6.2.0](https://github.com/workos/workos-ruby/compare/v6.1.0...v6.2.0) (2026-03-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **user-management:** add directory_managed to OrganizationMembership ([#446](https://github.com/workos/workos-ruby/issues/446)) ([914d824](https://github.com/workos/workos-ruby/commit/914d824668b70950905d5db666978e9609c9f706))
9
+ * **user-management:** add invitation accept endpoint ([#448](https://github.com/workos/workos-ruby/issues/448)) ([b5b4da1](https://github.com/workos/workos-ruby/commit/b5b4da1c031bc5f688562fdc33506e03b769f650))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update renovate rules ([#443](https://github.com/workos/workos-ruby/issues/443)) ([f156c79](https://github.com/workos/workos-ruby/commit/f156c799e88269493104628760f94b8abaebf542))
15
+
16
+ ## [6.1.0](https://github.com/workos/workos-ruby/compare/workos-v6.0.0...workos/v6.1.0) (2026-02-10)
17
+
18
+
19
+ ### Features
20
+
21
+ * add support for totp_secret ([#300](https://github.com/workos/workos-ruby/issues/300)) ([c0a26bf](https://github.com/workos/workos-ruby/commit/c0a26bf745fb49ebaac7c5241e99d51188b886bb))
22
+ * Include Feature Flags decoded from the JWT in the payload of a Session ([#386](https://github.com/workos/workos-ruby/issues/386)) ([31a0e79](https://github.com/workos/workos-ruby/commit/31a0e7901247652182dcaad95e131357b93d0d71))
23
+ * **workos-ruby:** Add `connection` to `authorization_url` ([#78](https://github.com/workos/workos-ruby/issues/78)) ([c3a0e8e](https://github.com/workos/workos-ruby/commit/c3a0e8e4031a3ee888d925c11f1fd2fb152f0a16))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * add `invitation_token` parameter to authentication methods ([#438](https://github.com/workos/workos-ruby/issues/438)) ([d24e3dc](https://github.com/workos/workos-ruby/commit/d24e3dc2995de26970415e4570a7ed810d432715))
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (6.0.0)
4
+ workos (6.2.0)
5
5
  encryptor (~> 3.0)
6
6
  jwt (~> 3.1)
7
7
 
@@ -7,7 +7,8 @@ module WorkOS
7
7
  class OrganizationMembership
8
8
  include HashProvider
9
9
 
10
- attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :custom_attributes, :created_at, :updated_at
10
+ attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :custom_attributes, :directory_managed,
11
+ :created_at, :updated_at
11
12
 
12
13
  def initialize(json)
13
14
  hash = JSON.parse(json, symbolize_names: true)
@@ -19,6 +20,7 @@ module WorkOS
19
20
  @role = hash[:role]
20
21
  @roles = hash[:roles]
21
22
  @custom_attributes = hash[:custom_attributes]
23
+ @directory_managed = hash[:directory_managed]
22
24
  @created_at = hash[:created_at]
23
25
  @updated_at = hash[:updated_at]
24
26
  end
@@ -32,6 +34,7 @@ module WorkOS
32
34
  role: role,
33
35
  roles: roles,
34
36
  custom_attributes: custom_attributes,
37
+ directory_managed: directory_managed,
35
38
  created_at: created_at,
36
39
  updated_at: updated_at,
37
40
  }
@@ -298,16 +298,19 @@ module WorkOS
298
298
  # @param [String] client_id The WorkOS client ID for the environment
299
299
  # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate.
300
300
  # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
301
+ # @param [String] invitation_token The token of an Invitation, if required.
301
302
  # @param [Hash] session An optional hash that determines whether the session should be sealed and
302
303
  # the optional cookie password.
303
304
  #
304
305
  # @return WorkOS::AuthenticationResponse
306
+ # rubocop:disable Metrics/ParameterLists
305
307
  def authenticate_with_password(
306
308
  email:,
307
309
  password:,
308
310
  client_id:,
309
311
  ip_address: nil,
310
312
  user_agent: nil,
313
+ invitation_token: nil,
311
314
  session: nil
312
315
  )
313
316
  validate_session(session)
@@ -322,6 +325,7 @@ module WorkOS
322
325
  password: password,
323
326
  ip_address: ip_address,
324
327
  user_agent: user_agent,
328
+ invitation_token: invitation_token,
325
329
  grant_type: 'password',
326
330
  },
327
331
  ),
@@ -329,6 +333,7 @@ module WorkOS
329
333
 
330
334
  WorkOS::AuthenticationResponse.new(response.body, session)
331
335
  end
336
+ # rubocop:enable Metrics/ParameterLists
332
337
 
333
338
  # Authenticate a user using OAuth or an organization's SSO connection.
334
339
  #
@@ -337,6 +342,7 @@ module WorkOS
337
342
  # @param [String] client_id The WorkOS client ID for the environment
338
343
  # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate.
339
344
  # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
345
+ # @param [String] invitation_token The token of an Invitation, if required.
340
346
  # @param [Hash] session An optional hash that determines whether the session should be sealed and
341
347
  # the optional cookie password.
342
348
  #
@@ -346,6 +352,7 @@ module WorkOS
346
352
  client_id:,
347
353
  ip_address: nil,
348
354
  user_agent: nil,
355
+ invitation_token: nil,
349
356
  session: nil
350
357
  )
351
358
  validate_session(session)
@@ -359,6 +366,7 @@ module WorkOS
359
366
  client_secret: WorkOS.config.key!,
360
367
  ip_address: ip_address,
361
368
  user_agent: user_agent,
369
+ invitation_token: invitation_token,
362
370
  grant_type: 'authorization_code',
363
371
  },
364
372
  ),
@@ -415,6 +423,7 @@ module WorkOS
415
423
  # @param [String] link_authorization_code Used to link an OAuth profile to an existing user,
416
424
  # after having completed a Magic Code challenge.
417
425
  # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
426
+ # @param [String] invitation_token The token of an Invitation, if required.
418
427
  # @param [Hash] session An optional hash that determines whether the session should be sealed and
419
428
  # the optional cookie password.
420
429
  #
@@ -427,6 +436,7 @@ module WorkOS
427
436
  ip_address: nil,
428
437
  user_agent: nil,
429
438
  link_authorization_code: nil,
439
+ invitation_token: nil,
430
440
  session: nil
431
441
  )
432
442
  validate_session(session)
@@ -443,6 +453,7 @@ module WorkOS
443
453
  user_agent: user_agent,
444
454
  grant_type: 'urn:workos:oauth:grant-type:magic-auth:code',
445
455
  link_authorization_code: link_authorization_code,
456
+ invitation_token: invitation_token,
446
457
  },
447
458
  ),
448
459
  )
@@ -1161,6 +1172,22 @@ module WorkOS
1161
1172
  WorkOS::Invitation.new(response.body)
1162
1173
  end
1163
1174
 
1175
+ # Accepts an existing Invitation.
1176
+ #
1177
+ # @param [String] id The unique ID of the Invitation.
1178
+ #
1179
+ # @return WorkOS::Invitation
1180
+ def accept_invitation(id:)
1181
+ request = post_request(
1182
+ path: "/user_management/invitations/#{id}/accept",
1183
+ auth: true,
1184
+ )
1185
+
1186
+ response = execute_request(request: request)
1187
+
1188
+ WorkOS::Invitation.new(response.body)
1189
+ end
1190
+
1164
1191
  # Revokes an existing Invitation.
1165
1192
  #
1166
1193
  # @param [String] id The unique ID of the Invitation.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '6.0.0'
4
+ VERSION = '6.2.0'
5
5
  end
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "ruby",
6
+ "package-name": "workos",
7
+ "version-file": "lib/workos/version.rb",
8
+ "changelog-path": "CHANGELOG.md",
9
+ "include-component-in-tag": false
10
+ }
11
+ }
12
+ }
data/renovate.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "extends": [
3
+ "config:recommended"
4
+ ],
5
+ "schedule": [
6
+ "on the 15th day of the month before 12pm"
7
+ ],
8
+ "timezone": "UTC",
9
+ "rebaseWhen": "conflicted",
10
+ "packageRules": [
11
+ {
12
+ "matchUpdateTypes": [
13
+ "minor",
14
+ "patch"
15
+ ],
16
+ "automerge": true,
17
+ "groupName": "minor and patch updates"
18
+ },
19
+ {
20
+ "matchUpdateTypes": [
21
+ "major"
22
+ ],
23
+ "automerge": false
24
+ },
25
+ {
26
+ "matchUpdateTypes": [
27
+ "digest"
28
+ ],
29
+ "automerge": false
30
+ }
31
+ ]
32
+ }
@@ -588,6 +588,28 @@ describe WorkOS::UserManagement do
588
588
  end
589
589
  end
590
590
  end
591
+
592
+ context 'with an invitation_token' do
593
+ it 'includes invitation_token in the request body' do
594
+ expect(described_class).to receive(:post_request) do |options|
595
+ body = options[:body]
596
+ expect(body[:invitation_token]).to eq('invitation_token_123')
597
+
598
+ double('request')
599
+ end.and_return(double('request'))
600
+
601
+ expect(described_class).to receive(:execute_request).and_return(
602
+ double('response', body: '{"user": {"id": "user_123"}, "access_token": "token", "refresh_token": "refresh"}'),
603
+ )
604
+
605
+ described_class.authenticate_with_password(
606
+ email: 'test@workos.app',
607
+ password: 'password123',
608
+ client_id: 'client_123',
609
+ invitation_token: 'invitation_token_123',
610
+ )
611
+ end
612
+ end
591
613
  end
592
614
 
593
615
  describe '.authenticate_with_code' do
@@ -671,6 +693,27 @@ describe WorkOS::UserManagement do
671
693
  end
672
694
  end
673
695
  end
696
+
697
+ context 'with an invitation_token' do
698
+ it 'includes invitation_token in the request body' do
699
+ expect(described_class).to receive(:post_request) do |options|
700
+ body = options[:body]
701
+ expect(body[:invitation_token]).to eq('invitation_token_123')
702
+
703
+ double('request')
704
+ end.and_return(double('request'))
705
+
706
+ expect(described_class).to receive(:execute_request).and_return(
707
+ double('response', body: '{"user": {"id": "user_123"}, "access_token": "token", "refresh_token": "refresh"}'),
708
+ )
709
+
710
+ described_class.authenticate_with_code(
711
+ code: '01H93ZZHA0JBHFJH9RR11S83YN',
712
+ client_id: 'client_123',
713
+ invitation_token: 'invitation_token_123',
714
+ )
715
+ end
716
+ end
674
717
  end
675
718
 
676
719
  describe '.authenticate_with_refresh_token' do
@@ -735,6 +778,28 @@ describe WorkOS::UserManagement do
735
778
  end
736
779
  end
737
780
  end
781
+
782
+ context 'with an invitation_token' do
783
+ it 'includes invitation_token in the request body' do
784
+ expect(described_class).to receive(:post_request) do |options|
785
+ body = options[:body]
786
+ expect(body[:invitation_token]).to eq('invitation_token_123')
787
+
788
+ double('request')
789
+ end.and_return(double('request'))
790
+
791
+ expect(described_class).to receive(:execute_request).and_return(
792
+ double('response', body: '{"user": {"id": "user_123"}, "access_token": "token", "refresh_token": "refresh"}'),
793
+ )
794
+
795
+ described_class.authenticate_with_magic_auth(
796
+ code: '452079',
797
+ client_id: 'client_123',
798
+ email: 'test@workos.com',
799
+ invitation_token: 'invitation_token_123',
800
+ )
801
+ end
802
+ end
738
803
  end
739
804
 
740
805
  describe '.authenticate_with_organization_selection' do
@@ -1663,6 +1728,81 @@ describe WorkOS::UserManagement do
1663
1728
  end
1664
1729
  end
1665
1730
 
1731
+ describe '.accept_invitation' do
1732
+ context 'with a valid id' do
1733
+ it 'accepts invitation' do
1734
+ expect(described_class).to receive(:post_request) do |options|
1735
+ expect(options[:path]).to eq('/user_management/invitations/invitation_123/accept')
1736
+ expect(options[:auth]).to be true
1737
+
1738
+ double('request')
1739
+ end.and_return(double('request'))
1740
+
1741
+ response_body = {
1742
+ id: 'invitation_123',
1743
+ email: 'test@workos.com',
1744
+ state: 'accepted',
1745
+ }.to_json
1746
+
1747
+ expect(described_class).to receive(:execute_request).and_return(
1748
+ double('response', body: response_body),
1749
+ )
1750
+
1751
+ invitation = described_class.accept_invitation(
1752
+ id: 'invitation_123',
1753
+ )
1754
+
1755
+ expect(invitation.id).to eq('invitation_123')
1756
+ expect(invitation.email).to eq('test@workos.com')
1757
+ expect(invitation.state).to eq('accepted')
1758
+ end
1759
+ end
1760
+
1761
+ context 'with an invalid id' do
1762
+ it 'returns an error' do
1763
+ expect(described_class).to receive(:post_request) do |options|
1764
+ expect(options[:path]).to eq('/user_management/invitations/invalid_id/accept')
1765
+ expect(options[:auth]).to be true
1766
+
1767
+ double('request')
1768
+ end.and_return(double('request'))
1769
+
1770
+ expect(described_class).to receive(:execute_request).and_raise(
1771
+ WorkOS::NotFoundError.new(message: 'Invitation not found'),
1772
+ )
1773
+
1774
+ expect do
1775
+ described_class.accept_invitation(id: 'invalid_id')
1776
+ end.to raise_error(
1777
+ WorkOS::NotFoundError,
1778
+ /Invitation not found/,
1779
+ )
1780
+ end
1781
+ end
1782
+
1783
+ context 'when invitation has already been accepted' do
1784
+ it 'returns an error' do
1785
+ expect(described_class).to receive(:post_request) do |options|
1786
+ expect(options[:path]).to eq('/user_management/invitations/invitation_123/accept')
1787
+ expect(options[:auth]).to be true
1788
+
1789
+ double('request')
1790
+ end.and_return(double('request'))
1791
+
1792
+ expect(described_class).to receive(:execute_request).and_raise(
1793
+ WorkOS::InvalidRequestError.new(message: 'Invite has already been accepted'),
1794
+ )
1795
+
1796
+ expect do
1797
+ described_class.accept_invitation(id: 'invitation_123')
1798
+ end.to raise_error(
1799
+ WorkOS::InvalidRequestError,
1800
+ /Invite has already been accepted/,
1801
+ )
1802
+ end
1803
+ end
1804
+ end
1805
+
1666
1806
  describe '.revoke_invitation' do
1667
1807
  context 'with valid payload' do
1668
1808
  it 'revokes invitation' do
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"},"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Thu, 17 Aug 2023 14:20:07 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -71,6 +71,6 @@ http_interactions:
71
71
  path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
72
72
  body:
73
73
  encoding: UTF-8
74
- string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"}, "roles":[{"slug":"member"}, {"slug":"admin"}], "created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
74
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"}, "roles":[{"slug":"member"}, {"slug":"admin"}], "directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
75
75
  recorded_at: Mon, 06 Oct 2025 19:57:34 GMT
76
76
  recorded_with: VCR 6.3.1
@@ -58,7 +58,7 @@ http_interactions:
58
58
  - "0"
59
59
  body:
60
60
  encoding: ASCII-8BIT
61
- string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"inactive","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.259Z"}'
61
+ string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"inactive","role":{"slug":"member"},"directory_managed":false,"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.259Z"}'
62
62
  http_version:
63
63
  recorded_at: Wed, 15 May 2024 19:13:06 GMT
64
64
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "role": {"slug": "member"}, "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "role": {"slug": "member"}, "directory_managed": false, "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Mon, 14 Aug 2023 21:42:04 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
79
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}'
80
80
  http_version:
81
81
  recorded_at: Tue, 15 Aug 2023 14:12:43 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
79
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","role":{"slug":"member"},"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
80
  http_version:
81
81
  recorded_at: Tue, 15 Aug 2023 16:37:20 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -58,7 +58,7 @@ http_interactions:
58
58
  - "0"
59
59
  body:
60
60
  encoding: ASCII-8BIT
61
- string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}],"list_metadata":{"before":null,"after":null}}'
61
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"directory_managed":false,"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}],"list_metadata":{"before":null,"after":null}}'
62
62
  http_version:
63
63
  recorded_at: Wed, 15 May 2024 19:14:44 GMT
64
64
  recorded_with: VCR 5.0.0
@@ -58,7 +58,7 @@ http_interactions:
58
58
  - "0"
59
59
  body:
60
60
  encoding: ASCII-8BIT
61
- string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}'
61
+ string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"directory_managed":false,"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}'
62
62
  http_version:
63
63
  recorded_at: Wed, 15 May 2024 19:13:06 GMT
64
64
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Wed, 15 May 2024 19:13:06 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -71,6 +71,6 @@ http_interactions:
71
71
  path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
72
72
  body:
73
73
  encoding: UTF-8
74
- string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"roles":[{"slug":"admin"},{"slug":"editor"}],"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
74
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"roles":[{"slug":"admin"},{"slug":"editor"}],"directory_managed":false,"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
75
75
  recorded_at: Tue, 07 Oct 2025 14:22:26 GMT
76
76
  recorded_with: VCR 6.3.1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-04 00:00:00.000000000 Z
11
+ date: 2026-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: encryptor
@@ -131,15 +131,17 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".github/CODEOWNERS"
133
133
  - ".github/pull_request_template.md"
134
- - ".github/renovate.json"
135
134
  - ".github/workflows/ci.yml"
135
+ - ".github/workflows/lint-pr-title.yml"
136
+ - ".github/workflows/release-please.yml"
136
137
  - ".github/workflows/release.yml"
137
- - ".github/workflows/version-bump.yml"
138
138
  - ".gitignore"
139
+ - ".release-please-manifest.json"
139
140
  - ".rspec"
140
141
  - ".rubocop.yml"
141
142
  - ".rubocop_todo.yml"
142
143
  - ".ruby-version"
144
+ - CHANGELOG.md
143
145
  - Gemfile
144
146
  - Gemfile.lock
145
147
  - LICENSE
@@ -207,6 +209,8 @@ files:
207
209
  - lib/workos/webhook.rb
208
210
  - lib/workos/webhooks.rb
209
211
  - lib/workos/widgets.rb
212
+ - release-please-config.json
213
+ - renovate.json
210
214
  - spec/lib/workos/audit_logs_spec.rb
211
215
  - spec/lib/workos/cache_spec.rb
212
216
  - spec/lib/workos/client.rb
@@ -1,5 +0,0 @@
1
- {
2
- "extends": [
3
- "config:base"
4
- ]
5
- }
@@ -1,80 +0,0 @@
1
- name: Version Bump
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- bump_type:
7
- description: "Version bump type"
8
- required: true
9
- type: choice
10
- options:
11
- - patch
12
- - minor
13
- - major
14
-
15
- jobs:
16
- bump-version:
17
- runs-on: ubuntu-latest
18
- permissions:
19
- contents: write
20
- pull-requests: write
21
- steps:
22
- - name: Generate token
23
- id: generate-token
24
- uses: actions/create-github-app-token@v2
25
- with:
26
- app-id: ${{ vars.SDK_BOT_APP_ID }}
27
- private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
28
-
29
- - name: Checkout
30
- uses: actions/checkout@v6
31
- with:
32
- token: ${{ steps.generate-token.outputs.token }}
33
-
34
- - name: Configure Git
35
- run: |
36
- git config user.name "workos-bot[bot]"
37
- git config user.email "workos-bot[bot]@users.noreply.github.com"
38
-
39
- - name: Read current version
40
- id: current-version
41
- run: |
42
- CURRENT_VERSION=$(grep "VERSION = " lib/workos/version.rb | sed "s/.*VERSION = '\(.*\)'/\1/")
43
- echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
44
-
45
- - name: Bump version
46
- id: bump-version
47
- run: |
48
- CURRENT_VERSION="${{ steps.current-version.outputs.version }}"
49
- IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
50
-
51
- case "${{ github.event.inputs.bump_type }}" in
52
- major)
53
- NEW_VERSION="$((MAJOR + 1)).0.0"
54
- ;;
55
- minor)
56
- NEW_VERSION="$MAJOR.$((MINOR + 1)).0"
57
- ;;
58
- patch)
59
- NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
60
- ;;
61
- esac
62
-
63
- echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
64
-
65
- - name: Update version in version.rb
66
- run: |
67
- sed -i "s/VERSION = '.*'/VERSION = '${{ steps.bump-version.outputs.new_version }}'/" lib/workos/version.rb
68
-
69
- - name: Create Pull Request
70
- uses: peter-evans/create-pull-request@v8
71
- with:
72
- token: ${{ steps.generate-token.outputs.token }}
73
- commit-message: "v${{ steps.bump-version.outputs.new_version }}"
74
- title: "v${{ steps.bump-version.outputs.new_version }}"
75
- body: |
76
- Bumps version from ${{ steps.current-version.outputs.version }} to ${{ steps.bump-version.outputs.new_version }}.
77
-
78
- This PR was automatically created by the version-bump workflow.
79
- branch: version-bump-${{ steps.bump-version.outputs.new_version }}
80
- labels: version-bump