workos 5.2.1 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/workos/organizations.rb +1 -1
- data/lib/workos/sso.rb +2 -2
- data/lib/workos/types/provider.rb +1 -0
- data/lib/workos/user_management.rb +3 -1
- 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: e96a33bee882eb21d22726513aac5a488ff88a0bd4cf3229dff028d942f167c5
|
4
|
+
data.tar.gz: ec682c61ba49d5fa28304cf7eff937c9f418db588708a923f361e1a7fde38bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a0013b9cfa1e87d48fc05e367fb0042f36d3495d0c3bd57d6dfcde18b268cc76892ba3129340c72f8719ea5dc2796fad8879737b498cffcb48346b09eb697e3
|
7
|
+
data.tar.gz: 6b581232dcfd75bab0d54b9915fa38a514c2cb9d059110a74aecd20170f78111819629a269d4b8ede7bcf0d89d3f92e04414503e6b8270b4ae6131abd0af6b39
|
data/Gemfile.lock
CHANGED
data/lib/workos/organizations.rb
CHANGED
data/lib/workos/sso.rb
CHANGED
@@ -28,8 +28,8 @@ module WorkOS
|
|
28
28
|
# connection, or organization is required.
|
29
29
|
# The domain is deprecated.
|
30
30
|
# @param [String] provider A provider name for an Identity Provider
|
31
|
-
# configured on your WorkOS dashboard. Only '
|
32
|
-
#
|
31
|
+
# configured on your WorkOS dashboard. Only 'AppleOAuth', 'GitHubOAuth',
|
32
|
+
# 'GoogleOAuth', and 'MicrosoftOAuth' are supported.
|
33
33
|
# @param [String] connection The ID for a Connection configured on
|
34
34
|
# WorkOS.
|
35
35
|
# @param [String] organization The ID for an Organization configured
|
@@ -13,6 +13,7 @@ module WorkOS
|
|
13
13
|
# The ProviderEnum is a declaration of a
|
14
14
|
# fixed set of values for User Management Providers.
|
15
15
|
class Provider
|
16
|
+
Apple = 'AppleOAuth'
|
16
17
|
GitHub = 'GitHubOAuth'
|
17
18
|
Google = 'GoogleOAuth'
|
18
19
|
Microsoft = 'MicrosoftOAuth'
|
@@ -44,7 +45,8 @@ module WorkOS
|
|
44
45
|
# configured redirect URI on your WorkOS dashboard.
|
45
46
|
# @param [String] client_id This value can be obtained from the API Keys page in the WorkOS dashboard.
|
46
47
|
# @param [String] provider A provider name is used to initiate SSO using an
|
47
|
-
# OAuth-compatible provider. Only 'authkit ,'
|
48
|
+
# OAuth-compatible provider. Only 'authkit', 'AppleOAuth', 'GitHubOAuth', 'GoogleOAuth',
|
49
|
+
# and 'MicrosoftOAuth' are supported.
|
48
50
|
# @param [String] connection_id The ID for a Connection configured on
|
49
51
|
# WorkOS.
|
50
52
|
# @param [String] organization_id The organization_id selector is used to
|
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.4.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-05 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
|