workos 5.3.0 → 5.5.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/workos/organizations.rb +1 -1
- data/lib/workos/user_management.rb +3 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/organizations_spec.rb +15 -1
- data/spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml +85 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caccb989844cfe680efb2a990f90797e011c17ccf9f591d97c289bc5b87a8697
|
4
|
+
data.tar.gz: d02be4dd057488124b08ba1a305a5fde3faf3c2f8f7bdfc559a1a808a469027c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 392f9a8393e068074934f53a9414f7379f25ad88d9f029304dd44ee4e6d9873982a44f435875bf6fc5b7ebee5efabfa990d4ba86465170d20305cd83694af3f5
|
7
|
+
data.tar.gz: 92745e3a044a4e161753762de7b6c1eae1ceab2c2a939739ae1b4839b5cb8a89fd23e37fcdd5ced060c280f7e0e761928e5a440d77498231e406971629084c7d
|
data/Gemfile.lock
CHANGED
data/lib/workos/organizations.rb
CHANGED
@@ -318,6 +318,7 @@ module WorkOS
|
|
318
318
|
#
|
319
319
|
# @param [String] refresh_token The refresh token previously obtained from a successful authentication call
|
320
320
|
# @param [String] client_id The WorkOS client ID for the environment
|
321
|
+
# @param [String] organization_id The organization to issue the new access token for. (Optional)
|
321
322
|
# @param [String] ip_address The IP address of the request from the user who is attempting to authenticate.
|
322
323
|
# @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
|
323
324
|
#
|
@@ -325,6 +326,7 @@ module WorkOS
|
|
325
326
|
def authenticate_with_refresh_token(
|
326
327
|
refresh_token:,
|
327
328
|
client_id:,
|
329
|
+
organization_id: nil,
|
328
330
|
ip_address: nil,
|
329
331
|
user_agent: nil
|
330
332
|
)
|
@@ -338,6 +340,7 @@ module WorkOS
|
|
338
340
|
ip_address: ip_address,
|
339
341
|
user_agent: user_agent,
|
340
342
|
grant_type: 'refresh_token',
|
343
|
+
organization_id: organization_id,
|
341
344
|
},
|
342
345
|
),
|
343
346
|
)
|
data/lib/workos/version.rb
CHANGED
@@ -267,7 +267,7 @@ describe WorkOS::Organizations do
|
|
267
267
|
|
268
268
|
describe '.update_organization' do
|
269
269
|
context 'with valid payload' do
|
270
|
-
it '
|
270
|
+
it 'updates the organization' do
|
271
271
|
VCR.use_cassette 'organization/update' do
|
272
272
|
organization = described_class.update_organization(
|
273
273
|
organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV',
|
@@ -275,6 +275,20 @@ describe WorkOS::Organizations do
|
|
275
275
|
name: 'Test Organization',
|
276
276
|
)
|
277
277
|
|
278
|
+
expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
|
279
|
+
expect(organization.name).to eq('Test Organization')
|
280
|
+
expect(organization.domains.first[:domain]).to eq('example.me')
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
context 'without a name' do
|
285
|
+
it 'updates the organization' do
|
286
|
+
VCR.use_cassette 'organization/update_without_name' do
|
287
|
+
organization = described_class.update_organization(
|
288
|
+
organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV',
|
289
|
+
domains: ['example.me'],
|
290
|
+
)
|
291
|
+
|
278
292
|
expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
|
279
293
|
expect(organization.name).to eq('Test Organization')
|
280
294
|
expect(organization.domains.first[:domain]).to eq('example.me')
|
@@ -0,0 +1,85 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://api.workos.com/organizations/org_01F6Q6TFP7RD2PF6J03ANNWDKV
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"domains":["example.me"]}'
|
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.0.1; x86_64-darwin19; v1.4.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Mon, 09 Aug 2021 21:53:34 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Origin, Accept-Encoding
|
35
|
+
Access-Control-Allow-Credentials:
|
36
|
+
- "true"
|
37
|
+
Content-Security-Policy:
|
38
|
+
- "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
|
39
|
+
https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
|
40
|
+
'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
|
41
|
+
X-Dns-Prefetch-Control:
|
42
|
+
- "off"
|
43
|
+
Expect-Ct:
|
44
|
+
- max-age=0
|
45
|
+
X-Frame-Options:
|
46
|
+
- SAMEORIGIN
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=15552000; includeSubDomains
|
49
|
+
X-Download-Options:
|
50
|
+
- noopen
|
51
|
+
X-Content-Type-Options:
|
52
|
+
- nosniff
|
53
|
+
X-Permitted-Cross-Domain-Policies:
|
54
|
+
- none
|
55
|
+
Referrer-Policy:
|
56
|
+
- no-referrer
|
57
|
+
X-Xss-Protection:
|
58
|
+
- "0"
|
59
|
+
X-Request-Id:
|
60
|
+
- b8c5da9a-d1f7-470c-abbd-a2de3f2edf77
|
61
|
+
Etag:
|
62
|
+
- W/"11a-SLpC9UGp2O5SWQr5VJZSNCpOF/Q"
|
63
|
+
Via:
|
64
|
+
- 1.1 vegur
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Report-To:
|
68
|
+
- '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=jh1EtP1h1CwA2nWmx0cvFGD5NdEiga3dbTCmcQH%2BgrdDPGqko8R8mehU9ywQ%2BW1AKKTGWbmRNHiRXpVhaJTNrULEuLt9TpGVoDH0IrixJhVS4N0Czi7n2UfPL0m684giLJtD2t7EVEj1XeeLlQ%3D%3D"}],"group":"cf-nel","max_age":604800}'
|
69
|
+
Nel:
|
70
|
+
- '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
|
71
|
+
Server:
|
72
|
+
- cloudflare
|
73
|
+
Cf-Ray:
|
74
|
+
- 67c437cdde060bb8-DFW
|
75
|
+
Alt-Svc:
|
76
|
+
- h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443";
|
77
|
+
ma=86400
|
78
|
+
body:
|
79
|
+
encoding: ASCII-8BIT
|
80
|
+
string:
|
81
|
+
'{"object":"organization","id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Test
|
82
|
+
Organization","allow_profiles_outside_organization":false,"created_at":"2021-05-27T15:24:25.670Z","updated_at":"2021-08-09T21:53:34.525Z","domains":[{"object":"organization_domain","id":"org_domain_01FCPEG7BAYMQ4CHMG41Y2VNHF","domain":"example.me"}]}'
|
83
|
+
http_version:
|
84
|
+
recorded_at: Mon, 09 Aug 2021 21:53:34 GMT
|
85
|
+
recorded_with: VCR 5.0.0
|
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: 5.
|
4
|
+
version: 5.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
236
236
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
237
237
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
238
|
+
- spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml
|
238
239
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
239
240
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
240
241
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|
@@ -445,6 +446,7 @@ test_files:
|
|
445
446
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
446
447
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
447
448
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
449
|
+
- spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml
|
448
450
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml
|
449
451
|
- spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
|
450
452
|
- spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
|