workos 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a00962231e6c619c78e5b5549a2e53ca7c60e5e31bd06f46a383b1797f673b0
4
- data.tar.gz: 593fb9342f9085abdd855a9a861f01859fd0ad7427e146b22c10dce142cd6779
3
+ metadata.gz: 84def52db9a12c4c5563af30a992f43e68441e7139624b787c588f39827d4843
4
+ data.tar.gz: 1d378bfefbdeae33688496031448bac6eea97a96e1179e91496c8f8ba69c87ca
5
5
  SHA512:
6
- metadata.gz: 02fc5ab50f261d7f3a5d0eebcaa40003c86222a98c5dad13b066d61b643b18e47998e1919bd257d9a3873fe54d04690de7a0c47457c9a34aab7f6d8909e307f8
7
- data.tar.gz: 9ef0e3d05c5d15fa4ff3645488fc8cf725c24c48477b5ab0c8c7621e7cc1f4ca51a1161e00cc6ef74cb8dadc18b07ca68223f525b5aba66d843ccfb92000f711
6
+ metadata.gz: 37117a2ea0851f35e83bbe4f17cf04dfb4ab2c7769e7f797ddd3e3d910849e0ae58e07647a72c7a21b4cf7f31f60a17fe60f78da149a422c9c211db284bc19f2
7
+ data.tar.gz: 5747ba824f3aceda49c56ae5154264d153f59befd01f89465df6bb6f1e29b14edd04c9cc2f66f73442e4e31fa2766bed76ce705c4c1b4609c4b6da1bbc8f701b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (0.10.1)
4
+ workos (0.10.2)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
@@ -54,7 +54,7 @@ GEM
54
54
  simplecov-html (0.12.2)
55
55
  sorbet (0.5.5560)
56
56
  sorbet-static (= 0.5.5560)
57
- sorbet-runtime (0.5.6300)
57
+ sorbet-runtime (0.5.6317)
58
58
  sorbet-static (0.5.5560-universal-darwin-14)
59
59
  unicode-display_width (1.6.0)
60
60
  vcr (5.0.0)
data/lib/workos/portal.rb CHANGED
@@ -42,7 +42,7 @@ module WorkOS
42
42
  # Generate a link to grant access to an organization's Admin Portal
43
43
  #
44
44
  # @param [String] intent The access scope for the generated Admin Portal
45
- # link. Valid values are: ["sso"]
45
+ # link. Valid values are: ["sso", "dsync"]
46
46
  # @param [String] organization The ID of the organization the Admin
47
47
  # Portal link will be generated for.
48
48
  # @param [String] The URL that the end user will be redirected to upon
@@ -8,6 +8,7 @@ module WorkOS
8
8
  class Intent < T::Enum
9
9
  enums do
10
10
  SSO = new('sso')
11
+ DSYNC = new('dsync')
11
12
  end
12
13
  end
13
14
  end
@@ -2,5 +2,5 @@
2
2
  # typed: strong
3
3
 
4
4
  module WorkOS
5
- VERSION = '0.10.1'
5
+ VERSION = '0.10.2'
6
6
  end
@@ -47,9 +47,9 @@ describe WorkOS::Portal do
47
47
  let(:organization) { 'org_01EHQMYV6MBK39QC5PZXHY59C3' }
48
48
 
49
49
  describe 'with a valid organization' do
50
- describe 'with the minimal params' do
50
+ context 'with the sso intent' do
51
51
  it 'returns an Admin Portal link' do
52
- VCR.use_cassette 'portal/generate_link' do
52
+ VCR.use_cassette 'portal/generate_link_sso' do
53
53
  portal_link = described_class.generate_link(
54
54
  intent: 'sso',
55
55
  organization: organization,
@@ -61,6 +61,21 @@ describe WorkOS::Portal do
61
61
  end
62
62
  end
63
63
  end
64
+
65
+ describe 'with the dsync intent' do
66
+ it 'returns an Admin Portal link' do
67
+ VCR.use_cassette 'portal/generate_link_dsync' do
68
+ portal_link = described_class.generate_link(
69
+ intent: 'dsync',
70
+ organization: organization,
71
+ )
72
+
73
+ expect(portal_link).to eq(
74
+ 'https://id.workos.com/portal/launch?secret=secret',
75
+ )
76
+ end
77
+ end
78
+ end
64
79
  end
65
80
 
66
81
  describe 'with an invalid organization' do
@@ -88,7 +103,7 @@ describe WorkOS::Portal do
88
103
  )
89
104
  end.to raise_error(
90
105
  ArgumentError,
91
- 'bogus-intent is not a valid value. `intent` must be in ["sso"]',
106
+ /bogus-intent is not a valid value/,
92
107
  )
93
108
  end
94
109
  end
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/portal/generate_link
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"intent":"dsync","organization":"org_01EHQMYV6MBK39QC5PZXHY59C3","return_url":null}'
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/2.7.1; x86_64-darwin19; v0.10.1
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - Cowboy
27
+ Connection:
28
+ - keep-alive
29
+ Vary:
30
+ - Origin, Accept-Encoding
31
+ Access-Control-Allow-Credentials:
32
+ - 'true'
33
+ Content-Security-Policy:
34
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
35
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
36
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
37
+ X-Dns-Prefetch-Control:
38
+ - 'off'
39
+ Expect-Ct:
40
+ - max-age=0
41
+ X-Frame-Options:
42
+ - SAMEORIGIN
43
+ Strict-Transport-Security:
44
+ - max-age=15552000; includeSubDomains
45
+ X-Download-Options:
46
+ - noopen
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Xss-Protection:
54
+ - '0'
55
+ X-Request-Id:
56
+ - 5cf84612-cd60-4d91-9c7e-e1e11bb6b074
57
+ Content-Type:
58
+ - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '319'
61
+ Etag:
62
+ - W/"13f-riW7JK+w7gdYvKYPzZmuQc+wFXk"
63
+ Date:
64
+ - Wed, 03 Mar 2021 22:08:00 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}'
70
+ http_version:
71
+ recorded_at: Wed, 03 Mar 2021 22:08:00 GMT
72
+ recorded_with: VCR 5.0.0
@@ -67,6 +67,6 @@ http_interactions:
67
67
  body:
68
68
  encoding: UTF-8
69
69
  string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}'
70
- http_version:
70
+ http_version:
71
71
  recorded_at: Wed, 09 Sep 2020 23:43:07 GMT
72
72
  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: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -267,8 +267,9 @@ files:
267
267
  - spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
268
268
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
269
269
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
270
- - spec/support/fixtures/vcr_cassettes/portal/generate_link.yml
270
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
271
271
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
272
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml
272
273
  - spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
273
274
  - spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
274
275
  - spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml
@@ -304,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
305
  - !ruby/object:Gem::Version
305
306
  version: '0'
306
307
  requirements: []
307
- rubygems_version: 3.2.12
308
+ rubygems_version: 3.2.13
308
309
  signing_key:
309
310
  specification_version: 4
310
311
  summary: API client for WorkOS
@@ -340,8 +341,9 @@ test_files:
340
341
  - spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml
341
342
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml
342
343
  - spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml
343
- - spec/support/fixtures/vcr_cassettes/portal/generate_link.yml
344
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml
344
345
  - spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml
346
+ - spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml
345
347
  - spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
346
348
  - spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
347
349
  - spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml