workos 6.0.0 → 6.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f0ac87a768fc79fa7ffbc77d0bf4a1ba30cbf6c1f5b96f8574c40bd2b61d296
4
- data.tar.gz: eb05af387d9c1c40e5de4fb830e4ce83e7baf94a2d9bcb428d97032208688780
3
+ metadata.gz: 2c2b3e2f56e5f5ffc2d59d27eb6613c018b24ec57ff270ed9e95730a46aafdc6
4
+ data.tar.gz: 6e001f5af6046daf9b640f570cd7318767fc106e90cdf3c9e7f8a3b0c11d1b3b
5
5
  SHA512:
6
- metadata.gz: 5f82d97362d7063dcc970313794671ca7f8c2c8892ae9728179e3c22a980b1d7e3d238959eb875d4a20629f13c00a56053347a70dfcb2214cf769979fc704151
7
- data.tar.gz: 5954446fc2d3c6fbad2542c7d377bb7eb8361e514d1d099f01c052085aebc6952277fd15efe7e3cf9683fc2a9dbf4976240098d48e9305607ab3233978b23f21
6
+ metadata.gz: aa0bdfff2eb4de65c9bd5679be9f44b36df9eafd5eb8d3826f490d435825f61f3df32768e77b8954df538a3e3af2963aaba3fe23c89148b7f7619d83ea349c46
7
+ data.tar.gz: 6ae668143797a324cea0db2d9d779fe803c13f9defc62d707bb7b4419ba931a71d12ff5dd4bdc17da5c6c284623b1484a111817a1294e1f02f0e1e741dd15781
@@ -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@v6
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@v2
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@v4
24
+ with:
25
+ token: ${{ steps.generate-token.outputs.token }}
@@ -1,53 +1,16 @@
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
@@ -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.1.0"
3
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## [6.1.0](https://github.com/workos/workos-ruby/compare/workos-v6.0.0...workos/v6.1.0) (2026-02-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * add support for totp_secret ([#300](https://github.com/workos/workos-ruby/issues/300)) ([c0a26bf](https://github.com/workos/workos-ruby/commit/c0a26bf745fb49ebaac7c5241e99d51188b886bb))
9
+ * 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))
10
+ * **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))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 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.1.0)
5
5
  encryptor (~> 3.0)
6
6
  jwt (~> 3.1)
7
7
 
@@ -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
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '6.0.0'
4
+ VERSION = '6.1.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
+ }
@@ -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
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.1.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-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: encryptor
@@ -133,13 +133,16 @@ files:
133
133
  - ".github/pull_request_template.md"
134
134
  - ".github/renovate.json"
135
135
  - ".github/workflows/ci.yml"
136
+ - ".github/workflows/lint-pr-title.yml"
137
+ - ".github/workflows/release-please.yml"
136
138
  - ".github/workflows/release.yml"
137
- - ".github/workflows/version-bump.yml"
138
139
  - ".gitignore"
140
+ - ".release-please-manifest.json"
139
141
  - ".rspec"
140
142
  - ".rubocop.yml"
141
143
  - ".rubocop_todo.yml"
142
144
  - ".ruby-version"
145
+ - CHANGELOG.md
143
146
  - Gemfile
144
147
  - Gemfile.lock
145
148
  - LICENSE
@@ -207,6 +210,7 @@ files:
207
210
  - lib/workos/webhook.rb
208
211
  - lib/workos/webhooks.rb
209
212
  - lib/workos/widgets.rb
213
+ - release-please-config.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,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