workos 4.2.0 → 4.2.1

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: 7010166c9732e20f33a78674e669c1f583fda9695ddbce0b998b666166cbb60b
4
- data.tar.gz: 642d0e92afe77f1aec7404fffdfec5af386d05807ee43c6bfa3201c11fe45cd7
3
+ metadata.gz: f18e38578e2afcc1a18b6141954b28c4c58a7ea9ae46baa58eed157a452c1a8b
4
+ data.tar.gz: 5e5036dfbad3f0fd25f1cb2368144692cd40f18d3668ea43be442ffa62f7b3d7
5
5
  SHA512:
6
- metadata.gz: b65ccc5817fc14633a235b12e2f3c25be1b04b6f1c07d9b781fd5d131cad89d7528dd0ab6326f100d542425261de9d1a81d28e89c1e30158a7e2a05291cdb8dd
7
- data.tar.gz: 94b2b2d3e59882de00b1ff7c01d2a0c5284357d52fa4e8418f86eff9ea37b0c0d0ef2c197b88ad0497ca56b872f2ab3309a4598feab6a80aa6b1f55114bc57e4
6
+ metadata.gz: 50833c139a6ad2f9dcfffb74a74e38b7add1edfb3b76b63b0b1e7d2cd5673cc837a9abc35ba05998392aea10907acf80c65c9144abde217b1671aa3c65557a23
7
+ data.tar.gz: c4ad2de56c7fd7b5da14b849295e2e9d4921b33c0ad6080d47387ff09e4a91c973e7a42ba648869a14280bad15eab3640736652d1b9916d333b24c842ef0c136
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (4.2.0)
4
+ workos (4.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -510,14 +510,17 @@ module WorkOS
510
510
  # @param [String] session_id The session ID can be found in the `sid`
511
511
  # claim of the access token
512
512
  def revoke_session(session_id:)
513
- execute_request(
513
+ response = execute_request(
514
514
  request: post_request(
515
515
  path: '/user_management/sessions/revoke',
516
516
  body: {
517
517
  session_id: session_id,
518
518
  },
519
+ auth: true,
519
520
  ),
520
521
  )
522
+
523
+ response.is_a? Net::HTTPSuccess
521
524
  end
522
525
 
523
526
  # Get the JWKS URL
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '4.2.0'
4
+ VERSION = '4.2.1'
5
5
  end
@@ -1145,4 +1145,33 @@ describe WorkOS::UserManagement do
1145
1145
  end
1146
1146
  end
1147
1147
  end
1148
+
1149
+ describe '.revoke_session' do
1150
+ context 'with valid payload' do
1151
+ it 'revokes session' do
1152
+ VCR.use_cassette 'user_management/revoke_session/valid' do
1153
+ result = described_class.revoke_session(
1154
+ session_id: 'session_01HRX85ATNADY1GQ053AHRFFN6',
1155
+ )
1156
+
1157
+ expect(result).to be true
1158
+ end
1159
+ end
1160
+ end
1161
+
1162
+ context 'with a non-existant session' do
1163
+ it 'returns an error' do
1164
+ VCR.use_cassette 'user_management/revoke_session/not_found' do
1165
+ expect do
1166
+ described_class.revoke_session(
1167
+ session_id: 'session_01H5JQDV7R7ATEYZDEG0W5PRYS',
1168
+ )
1169
+ end.to raise_error(
1170
+ WorkOS::APIError,
1171
+ /Session not found/,
1172
+ )
1173
+ end
1174
+ end
1175
+ end
1176
+ end
1148
1177
  end
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/sessions/revoke
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"session_id":"session_01H5JQDV7R7ATEYZDEG0W5PRYS"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin22; v4.2.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Date:
26
+ - Thu, 11 Apr 2024 22:36:42 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 872e74fd9ed6db9e-LAX
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"91-9u3slgvENRDVFp/62vKalhPzVuw"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - bc0771a4-8d66-4b34-809c-d3d8976af390
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=iJMFbMBT_gDvh2ZbVYwAWHii9wrMPSJJeFQ3sXKSNNw-1712875002-1.0.1.1-d0033NtW0ShwCrgulDZg60Nw0yfEROthaCZQWVIAnWbbmaoa5HDqSkl4DsECxoAaZNdoLWqOxi9YXtZx9FqVSA;
69
+ path=/; expires=Thu, 11-Apr-24 23:06:42 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=c2a61e4869ba7669d8dd1d11a8e59bba189e21ba-1712875002; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"message":"Session not found: ''session_01H5JQDV7R7ATEYZDEG0W5PRYS''.","code":"entity_not_found","entity_id":"session_01H5JQDV7R7ATEYZDEG0W5PRYS"}'
78
+ http_version:
79
+ recorded_at: Thu, 11 Apr 2024 22:36:42 GMT
80
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,76 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/sessions/revoke
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"session_id":"session_01HRX85ATNADY1GQ053AHRFFN6"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - WorkOS; ruby/3.1.4; arm64-darwin22; v4.2.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Thu, 11 Apr 2024 22:36:42 GMT
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Cf-Ray:
32
+ - 872e74fc2ee3092d-LAX
33
+ Cf-Cache-Status:
34
+ - DYNAMIC
35
+ Strict-Transport-Security:
36
+ - max-age=15552000; includeSubDomains
37
+ Vary:
38
+ - Origin, Accept-Encoding
39
+ Access-Control-Allow-Credentials:
40
+ - 'true'
41
+ Content-Security-Policy:
42
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
43
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
44
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
45
+ Expect-Ct:
46
+ - max-age=0
47
+ Referrer-Policy:
48
+ - no-referrer
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ X-Dns-Prefetch-Control:
52
+ - 'off'
53
+ X-Download-Options:
54
+ - noopen
55
+ X-Frame-Options:
56
+ - SAMEORIGIN
57
+ X-Permitted-Cross-Domain-Policies:
58
+ - none
59
+ X-Request-Id:
60
+ - 1b04e560-4438-40ba-97d2-05ae571aeedf
61
+ X-Xss-Protection:
62
+ - '0'
63
+ Set-Cookie:
64
+ - __cf_bm=lXssAzjuk1ajbWnDLtD_SUYIufESNBd9WVxCY8MCxJU-1712875002-1.0.1.1-oBbEhifco.kAMIrc30VrsrzW8tP4OpouniBD3jTd.5UowyS_IWs6ah59yKeFO9X6IqMLjlJt6n5O9lTpN0.2fw;
65
+ path=/; expires=Thu, 11-Apr-24 23:06:42 GMT; domain=.workos.com; HttpOnly;
66
+ Secure; SameSite=None
67
+ - __cfruid=c2a61e4869ba7669d8dd1d11a8e59bba189e21ba-1712875002; path=/; domain=.workos.com;
68
+ HttpOnly; Secure; SameSite=None
69
+ Server:
70
+ - cloudflare
71
+ body:
72
+ encoding: UTF-8
73
+ string: ''
74
+ http_version:
75
+ recorded_at: Thu, 11 Apr 2024 22:36:42 GMT
76
+ recorded_with: VCR 5.0.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
@@ -292,6 +292,8 @@ files:
292
292
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml
293
293
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml
294
294
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml
295
+ - spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml
296
+ - spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml
295
297
  - spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml
296
298
  - spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml
297
299
  - spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml
@@ -480,6 +482,8 @@ test_files:
480
482
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml
481
483
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml
482
484
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml
485
+ - spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml
486
+ - spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml
483
487
  - spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml
484
488
  - spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml
485
489
  - spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml