workos 0.0.1 → 0.0.2
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/.github/renovate.json +5 -0
- data/.rubocop.yml +3 -0
- data/.ruby-version +1 -1
- data/.semaphore/rubygems.yml +6 -1
- data/.semaphore/semaphore.yml +4 -3
- data/Gemfile.lock +13 -15
- data/docs/WorkOS.html +2 -2
- data/docs/WorkOS/Base.html +1 -1
- data/docs/WorkOS/Profile.html +1 -1
- data/docs/WorkOS/RequestError.html +1 -1
- data/docs/WorkOS/SSO.html +9 -9
- data/docs/WorkOS/Types.html +1 -1
- data/docs/WorkOS/Types/ProfileStruct.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/top-level-namespace.html +1 -1
- data/lib/workos/profile.rb +11 -0
- data/lib/workos/sso.rb +6 -7
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/sso_spec.rb +29 -6
- data/workos.gemspec +3 -4
- metadata +13 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4a148a2a3c606738d27e79bcaf6c599ed6dcbfe28f89fbfd19e49fa06616c02
|
|
4
|
+
data.tar.gz: 298806d027c6dd44d45a73f58c25fe8ac046de1e846f9cfe552e3ef4a1ea4b75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91a635da667d2c6b84148df8c27667249e5e68888120837e934aff39b2a9c1df14f5c090b2755e5f1686cb26b549c9b5092570c193ff9055c9ef902f04325e7d
|
|
7
|
+
data.tar.gz: bddb0eaf54cbe9d95a9ffbe20ffa1ed8ba729aae5e0c5eeff7b1c86913ed8989cd7411ce30f44f4d9d499d8b6a576bb224e00beb4d1920700926d7143c08ed30
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.6.5
|
data/.semaphore/rubygems.yml
CHANGED
|
@@ -14,6 +14,11 @@ blocks:
|
|
|
14
14
|
jobs:
|
|
15
15
|
- name: Publish to Rubygems
|
|
16
16
|
commands:
|
|
17
|
-
- checkout
|
|
17
|
+
- checkout
|
|
18
|
+
- sem-version ruby 2.6.5
|
|
19
|
+
- gem update --system
|
|
20
|
+
- gem install bundler
|
|
21
|
+
- bundle install
|
|
22
|
+
- chmod 0600 /home/semaphore/.gem/credentials
|
|
18
23
|
- bundle exec gem build workos --output=release.gem
|
|
19
24
|
- bundle exec gem push release.gem
|
data/.semaphore/semaphore.yml
CHANGED
|
@@ -11,7 +11,8 @@ blocks:
|
|
|
11
11
|
- name: srb tc
|
|
12
12
|
commands:
|
|
13
13
|
- checkout
|
|
14
|
-
- sem-version ruby 2.
|
|
14
|
+
- sem-version ruby 2.6.5
|
|
15
|
+
- gem install bundler
|
|
15
16
|
- bundle install
|
|
16
17
|
- bundle exec srb tc
|
|
17
18
|
- name: Run Rubocop 🚔
|
|
@@ -20,7 +21,7 @@ blocks:
|
|
|
20
21
|
- name: rubocop
|
|
21
22
|
commands:
|
|
22
23
|
- checkout
|
|
23
|
-
- sem-version ruby 2.
|
|
24
|
+
- sem-version ruby 2.6.5
|
|
24
25
|
- bundle install
|
|
25
26
|
- bundle exec rubocop
|
|
26
27
|
- name: Run Tests 👩🏽🔬
|
|
@@ -57,7 +58,7 @@ blocks:
|
|
|
57
58
|
- checkout
|
|
58
59
|
- sem-version ruby 2.6.5
|
|
59
60
|
- bundle install
|
|
60
|
-
- bundle exec rspec
|
|
61
|
+
- bundle exec rspec
|
|
61
62
|
promotions:
|
|
62
63
|
- name: Deploy workos-rb to rubygems
|
|
63
64
|
pipeline_file: rubygems.yml
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
workos (0.0.
|
|
5
|
-
|
|
6
|
-
sorbet-runtime
|
|
4
|
+
workos (0.0.2)
|
|
5
|
+
sorbet-runtime (~> 0.5)
|
|
7
6
|
|
|
8
7
|
GEM
|
|
9
8
|
remote: https://rubygems.org/
|
|
@@ -21,12 +20,11 @@ GEM
|
|
|
21
20
|
docile (1.3.2)
|
|
22
21
|
hashdiff (1.0.0)
|
|
23
22
|
jaro_winkler (1.5.4)
|
|
24
|
-
json (2.
|
|
23
|
+
json (2.3.0)
|
|
25
24
|
parallel (1.19.1)
|
|
26
|
-
parser (2.
|
|
25
|
+
parser (2.7.0.0)
|
|
27
26
|
ast (~> 2.4.0)
|
|
28
|
-
public_suffix (4.0.
|
|
29
|
-
rack (1.6.11)
|
|
27
|
+
public_suffix (4.0.2)
|
|
30
28
|
rainbow (3.0.0)
|
|
31
29
|
rake (13.0.1)
|
|
32
30
|
rspec (3.9.0)
|
|
@@ -42,7 +40,7 @@ GEM
|
|
|
42
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
43
41
|
rspec-support (~> 3.9.0)
|
|
44
42
|
rspec-support (3.9.0)
|
|
45
|
-
rubocop (0.
|
|
43
|
+
rubocop (0.78.0)
|
|
46
44
|
jaro_winkler (~> 1.5.1)
|
|
47
45
|
parallel (~> 1.10)
|
|
48
46
|
parser (>= 2.6)
|
|
@@ -56,10 +54,10 @@ GEM
|
|
|
56
54
|
json (>= 1.8, < 3)
|
|
57
55
|
simplecov-html (~> 0.10.0)
|
|
58
56
|
simplecov-html (0.10.2)
|
|
59
|
-
sorbet (0.
|
|
60
|
-
sorbet-static (= 0.
|
|
61
|
-
sorbet-runtime (0.
|
|
62
|
-
sorbet-static (0.
|
|
57
|
+
sorbet (0.5.5181)
|
|
58
|
+
sorbet-static (= 0.5.5181)
|
|
59
|
+
sorbet-runtime (0.5.5181)
|
|
60
|
+
sorbet-static (0.5.5181-universal-darwin-14)
|
|
63
61
|
unicode-display_width (1.6.0)
|
|
64
62
|
url (0.3.2)
|
|
65
63
|
webmock (3.7.6)
|
|
@@ -71,14 +69,14 @@ PLATFORMS
|
|
|
71
69
|
ruby
|
|
72
70
|
|
|
73
71
|
DEPENDENCIES
|
|
74
|
-
bundler (
|
|
72
|
+
bundler (>= 2.0.1)
|
|
75
73
|
codecov (~> 0.1.16)
|
|
76
74
|
rake
|
|
77
75
|
rspec (~> 3.9.0)
|
|
78
76
|
rubocop (~> 0.77)
|
|
79
|
-
sorbet
|
|
77
|
+
sorbet (~> 0.5)
|
|
80
78
|
webmock
|
|
81
79
|
workos!
|
|
82
80
|
|
|
83
81
|
BUNDLED WITH
|
|
84
|
-
2.
|
|
82
|
+
2.1.2
|
data/docs/WorkOS.html
CHANGED
|
@@ -129,7 +129,7 @@ initializer.</p>
|
|
|
129
129
|
<dt id="VERSION-constant" class="">VERSION =
|
|
130
130
|
|
|
131
131
|
</dt>
|
|
132
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.
|
|
132
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.2</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
133
133
|
|
|
134
134
|
</dl>
|
|
135
135
|
|
|
@@ -318,7 +318,7 @@ initializer.</p>
|
|
|
318
318
|
</div>
|
|
319
319
|
|
|
320
320
|
<div id="footer">
|
|
321
|
-
Generated on
|
|
321
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
322
322
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
323
323
|
0.9.20 (ruby-2.4.9).
|
|
324
324
|
</div>
|
data/docs/WorkOS/Base.html
CHANGED
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
</div>
|
|
272
272
|
|
|
273
273
|
<div id="footer">
|
|
274
|
-
Generated on
|
|
274
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
275
275
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
276
276
|
0.9.20 (ruby-2.4.9).
|
|
277
277
|
</div>
|
data/docs/WorkOS/Profile.html
CHANGED
|
@@ -715,7 +715,7 @@ is instantiated internally but exposed.</p>
|
|
|
715
715
|
</div>
|
|
716
716
|
|
|
717
717
|
<div id="footer">
|
|
718
|
-
Generated on
|
|
718
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
719
719
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
720
720
|
0.9.20 (ruby-2.4.9).
|
|
721
721
|
</div>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</div>
|
|
126
126
|
|
|
127
127
|
<div id="footer">
|
|
128
|
-
Generated on
|
|
128
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
130
130
|
0.9.20 (ruby-2.4.9).
|
|
131
131
|
</div>
|
data/docs/WorkOS/SSO.html
CHANGED
|
@@ -314,6 +314,7 @@ the response.</p>
|
|
|
314
314
|
<pre class="lines">
|
|
315
315
|
|
|
316
316
|
|
|
317
|
+
55
|
|
317
318
|
56
|
|
318
319
|
57
|
|
319
320
|
58
|
|
@@ -323,14 +324,13 @@ the response.</p>
|
|
|
323
324
|
62
|
|
324
325
|
63
|
|
325
326
|
64
|
|
326
|
-
65
|
|
327
|
-
66</pre>
|
|
327
|
+
65</pre>
|
|
328
328
|
</td>
|
|
329
329
|
<td>
|
|
330
|
-
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line
|
|
330
|
+
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 55</span>
|
|
331
331
|
|
|
332
332
|
<span class='kw'>def</span> <span class='id identifier rubyid_authorization_url'>authorization_url</span><span class='lparen'>(</span><span class='label'>domain:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='comma'>,</span> <span class='label'>redirect_uri:</span><span class='comma'>,</span> <span class='label'>state:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
333
|
-
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>
|
|
333
|
+
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form'>encode_www_form</span><span class='lparen'>(</span>
|
|
334
334
|
<span class='label'>domain:</span> <span class='id identifier rubyid_domain'>domain</span><span class='comma'>,</span>
|
|
335
335
|
<span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
|
|
336
336
|
<span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
|
|
@@ -459,6 +459,7 @@ step.</p>
|
|
|
459
459
|
<pre class="lines">
|
|
460
460
|
|
|
461
461
|
|
|
462
|
+
100
|
|
462
463
|
101
|
|
463
464
|
102
|
|
464
465
|
103
|
|
@@ -471,14 +472,13 @@ step.</p>
|
|
|
471
472
|
110
|
|
472
473
|
111
|
|
473
474
|
112
|
|
474
|
-
113
|
|
475
|
-
114</pre>
|
|
475
|
+
113</pre>
|
|
476
476
|
</td>
|
|
477
477
|
<td>
|
|
478
|
-
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line
|
|
478
|
+
<pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 100</span>
|
|
479
479
|
|
|
480
480
|
<span class='kw'>def</span> <span class='id identifier rubyid_profile'>profile</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='comma'>,</span> <span class='label'>redirect_uri:</span><span class='rparen'>)</span>
|
|
481
|
-
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>
|
|
481
|
+
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form'>encode_www_form</span><span class='lparen'>(</span>
|
|
482
482
|
<span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
|
|
483
483
|
<span class='label'>client_secret:</span> <span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key!'><span class='object_link'><a href="../WorkOS.html#key!-class_method" title="WorkOS.key! (method)">key!</a></span></span><span class='comma'>,</span>
|
|
484
484
|
<span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
|
|
@@ -501,7 +501,7 @@ step.</p>
|
|
|
501
501
|
</div>
|
|
502
502
|
|
|
503
503
|
<div id="footer">
|
|
504
|
-
Generated on
|
|
504
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
505
505
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
506
506
|
0.9.20 (ruby-2.4.9).
|
|
507
507
|
</div>
|
data/docs/WorkOS/Types.html
CHANGED
|
@@ -119,7 +119,7 @@ throughout this Ruby gem.</p>
|
|
|
119
119
|
</div>
|
|
120
120
|
|
|
121
121
|
<div id="footer">
|
|
122
|
-
Generated on
|
|
122
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
124
124
|
0.9.20 (ruby-2.4.9).
|
|
125
125
|
</div>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</div>
|
|
126
126
|
|
|
127
127
|
<div id="footer">
|
|
128
|
-
Generated on
|
|
128
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
130
130
|
0.9.20 (ruby-2.4.9).
|
|
131
131
|
</div>
|
data/docs/file.README.html
CHANGED
|
@@ -82,7 +82,7 @@ you just want to use the package, just run:</p>
|
|
|
82
82
|
</div></div>
|
|
83
83
|
|
|
84
84
|
<div id="footer">
|
|
85
|
-
Generated on
|
|
85
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
86
86
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
87
87
|
0.9.20 (ruby-2.4.9).
|
|
88
88
|
</div>
|
data/docs/index.html
CHANGED
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
</div>
|
|
180
180
|
|
|
181
181
|
<div id="footer">
|
|
182
|
-
Generated on
|
|
182
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
183
183
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
184
184
|
0.9.20 (ruby-2.4.9).
|
|
185
185
|
</div>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
</div>
|
|
101
101
|
|
|
102
102
|
<div id="footer">
|
|
103
|
-
Generated on
|
|
103
|
+
Generated on Wed Dec 18 08:33:35 2019 by
|
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
105
105
|
0.9.20 (ruby-2.4.9).
|
|
106
106
|
</div>
|
data/lib/workos/profile.rb
CHANGED
|
@@ -34,6 +34,17 @@ module WorkOS
|
|
|
34
34
|
[first_name, last_name].compact.join(' ')
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
def to_json(*)
|
|
38
|
+
{
|
|
39
|
+
id: id,
|
|
40
|
+
email: email,
|
|
41
|
+
first_name: first_name,
|
|
42
|
+
last_name: last_name,
|
|
43
|
+
connection_type: connection_type,
|
|
44
|
+
idp_id: idp_id,
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
37
48
|
private
|
|
38
49
|
|
|
39
50
|
sig { params(json_string: String).returns(WorkOS::Types::ProfileStruct) }
|
data/lib/workos/sso.rb
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
require 'net/http'
|
|
6
|
-
require 'rack/utils'
|
|
7
6
|
require 'uri'
|
|
8
7
|
|
|
9
8
|
module WorkOS
|
|
@@ -54,7 +53,7 @@ module WorkOS
|
|
|
54
53
|
#
|
|
55
54
|
# @return [String]
|
|
56
55
|
def authorization_url(domain:, project_id:, redirect_uri:, state: {})
|
|
57
|
-
query =
|
|
56
|
+
query = URI.encode_www_form(
|
|
58
57
|
domain: domain,
|
|
59
58
|
client_id: project_id,
|
|
60
59
|
redirect_uri: redirect_uri,
|
|
@@ -99,7 +98,7 @@ module WorkOS
|
|
|
99
98
|
#
|
|
100
99
|
# @return [WorkOS::Profile]
|
|
101
100
|
def profile(code:, project_id:, redirect_uri:)
|
|
102
|
-
query =
|
|
101
|
+
query = URI.encode_www_form(
|
|
103
102
|
client_id: project_id,
|
|
104
103
|
client_secret: WorkOS.key!,
|
|
105
104
|
redirect_uri: redirect_uri,
|
|
@@ -127,14 +126,14 @@ module WorkOS
|
|
|
127
126
|
|
|
128
127
|
sig { params(response: Net::HTTPResponse).void }
|
|
129
128
|
def check_and_raise_error(response:)
|
|
130
|
-
return if response.is_a? Net::HTTPOK
|
|
131
|
-
|
|
132
129
|
begin
|
|
133
|
-
|
|
130
|
+
body = JSON.parse(response.body)
|
|
131
|
+
return if body['profile']
|
|
132
|
+
|
|
133
|
+
message = body['message']
|
|
134
134
|
rescue StandardError
|
|
135
135
|
message = 'Something went wrong'
|
|
136
136
|
end
|
|
137
|
-
|
|
138
137
|
raise WorkOS::RequestError, message
|
|
139
138
|
end
|
|
140
139
|
end
|
data/lib/workos/version.rb
CHANGED
data/spec/lib/workos/sso_spec.rb
CHANGED
|
@@ -11,8 +11,8 @@ describe WorkOS::SSO do
|
|
|
11
11
|
project_id: 'workos-proj-123',
|
|
12
12
|
redirect_uri: 'foo.com/auth/callback',
|
|
13
13
|
state: {
|
|
14
|
-
next_page: '/dashboard/edit'
|
|
15
|
-
}
|
|
14
|
+
next_page: '/dashboard/edit',
|
|
15
|
+
},
|
|
16
16
|
}
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -48,7 +48,7 @@ describe WorkOS::SSO do
|
|
|
48
48
|
{
|
|
49
49
|
code: SecureRandom.hex(10),
|
|
50
50
|
project_id: 'workos-proj-123',
|
|
51
|
-
redirect_uri: 'foo.com/auth/callback'
|
|
51
|
+
redirect_uri: 'foo.com/auth/callback',
|
|
52
52
|
}
|
|
53
53
|
end
|
|
54
54
|
|
|
@@ -58,7 +58,7 @@ describe WorkOS::SSO do
|
|
|
58
58
|
client_secret: WorkOS.key,
|
|
59
59
|
code: args[:code],
|
|
60
60
|
grant_type: 'authorization_code',
|
|
61
|
-
redirect_uri: args[:redirect_uri]
|
|
61
|
+
redirect_uri: args[:redirect_uri],
|
|
62
62
|
}
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -82,14 +82,37 @@ describe WorkOS::SSO do
|
|
|
82
82
|
before do
|
|
83
83
|
stub_request(:post, 'https://api.workos.com/sso/token').
|
|
84
84
|
with(query: query).
|
|
85
|
-
to_return(
|
|
85
|
+
to_return(
|
|
86
|
+
status: 422,
|
|
87
|
+
body: { "message": 'some error message' }.to_json,
|
|
88
|
+
)
|
|
86
89
|
end
|
|
87
90
|
|
|
88
|
-
it '
|
|
91
|
+
it 'raises an exception' do
|
|
89
92
|
expect do
|
|
90
93
|
described_class.profile(**args)
|
|
91
94
|
end.to raise_error(WorkOS::RequestError, 'some error message')
|
|
92
95
|
end
|
|
93
96
|
end
|
|
97
|
+
|
|
98
|
+
context 'with an expired code' do
|
|
99
|
+
before do
|
|
100
|
+
stub_request(:post, 'https://api.workos.com/sso/token').
|
|
101
|
+
with(query: query).
|
|
102
|
+
to_return(status: 201, body: {
|
|
103
|
+
message: "The code '01DVX3C5Z367SFHR8QNDMK7V24'" \
|
|
104
|
+
' has expired or is invalid.',
|
|
105
|
+
}.to_json,)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
it 'raises an exception' do
|
|
109
|
+
expect do
|
|
110
|
+
described_class.profile(**args)
|
|
111
|
+
end.to raise_error(
|
|
112
|
+
WorkOS::RequestError,
|
|
113
|
+
"The code '01DVX3C5Z367SFHR8QNDMK7V24' has expired or is invalid.",
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
94
117
|
end
|
|
95
118
|
end
|
data/workos.gemspec
CHANGED
|
@@ -19,14 +19,13 @@ Gem::Specification.new do |spec|
|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
20
|
spec.require_paths = ['lib']
|
|
21
21
|
|
|
22
|
-
spec.add_dependency '
|
|
23
|
-
spec.add_dependency 'sorbet-runtime'
|
|
22
|
+
spec.add_dependency 'sorbet-runtime', '~> 0.5'
|
|
24
23
|
|
|
25
|
-
spec.add_development_dependency 'bundler', '
|
|
24
|
+
spec.add_development_dependency 'bundler', '>= 2.0.1'
|
|
26
25
|
spec.add_development_dependency 'codecov', '~> 0.1.16'
|
|
27
26
|
spec.add_development_dependency 'rake'
|
|
28
27
|
spec.add_development_dependency 'rspec', '~> 3.9.0'
|
|
29
28
|
spec.add_development_dependency 'rubocop', '~> 0.77'
|
|
30
|
-
spec.add_development_dependency 'sorbet'
|
|
29
|
+
spec.add_development_dependency 'sorbet', '~> 0.5'
|
|
31
30
|
spec.add_development_dependency 'webmock'
|
|
32
31
|
end
|
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: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WorkOS
|
|
@@ -10,48 +10,34 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2019-12-
|
|
13
|
+
date: 2019-12-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
|
-
name:
|
|
16
|
+
name: sorbet-runtime
|
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
|
18
18
|
requirements:
|
|
19
19
|
- - "~>"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version:
|
|
21
|
+
version: '0.5'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
26
|
- - "~>"
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version:
|
|
29
|
-
- !ruby/object:Gem::Dependency
|
|
30
|
-
name: sorbet-runtime
|
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
|
32
|
-
requirements:
|
|
33
|
-
- - ">="
|
|
34
|
-
- !ruby/object:Gem::Version
|
|
35
|
-
version: '0'
|
|
36
|
-
type: :runtime
|
|
37
|
-
prerelease: false
|
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
-
requirements:
|
|
40
|
-
- - ">="
|
|
41
|
-
- !ruby/object:Gem::Version
|
|
42
|
-
version: '0'
|
|
28
|
+
version: '0.5'
|
|
43
29
|
- !ruby/object:Gem::Dependency
|
|
44
30
|
name: bundler
|
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
|
46
32
|
requirements:
|
|
47
|
-
- - "
|
|
33
|
+
- - ">="
|
|
48
34
|
- !ruby/object:Gem::Version
|
|
49
35
|
version: 2.0.1
|
|
50
36
|
type: :development
|
|
51
37
|
prerelease: false
|
|
52
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
39
|
requirements:
|
|
54
|
-
- - "
|
|
40
|
+
- - ">="
|
|
55
41
|
- !ruby/object:Gem::Version
|
|
56
42
|
version: 2.0.1
|
|
57
43
|
- !ruby/object:Gem::Dependency
|
|
@@ -114,16 +100,16 @@ dependencies:
|
|
|
114
100
|
name: sorbet
|
|
115
101
|
requirement: !ruby/object:Gem::Requirement
|
|
116
102
|
requirements:
|
|
117
|
-
- - "
|
|
103
|
+
- - "~>"
|
|
118
104
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: '0'
|
|
105
|
+
version: '0.5'
|
|
120
106
|
type: :development
|
|
121
107
|
prerelease: false
|
|
122
108
|
version_requirements: !ruby/object:Gem::Requirement
|
|
123
109
|
requirements:
|
|
124
|
-
- - "
|
|
110
|
+
- - "~>"
|
|
125
111
|
- !ruby/object:Gem::Version
|
|
126
|
-
version: '0'
|
|
112
|
+
version: '0.5'
|
|
127
113
|
- !ruby/object:Gem::Dependency
|
|
128
114
|
name: webmock
|
|
129
115
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -151,6 +137,7 @@ executables:
|
|
|
151
137
|
extensions: []
|
|
152
138
|
extra_rdoc_files: []
|
|
153
139
|
files:
|
|
140
|
+
- ".github/renovate.json"
|
|
154
141
|
- ".gitignore"
|
|
155
142
|
- ".rspec"
|
|
156
143
|
- ".rubocop.yml"
|
|
@@ -251,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
251
238
|
- !ruby/object:Gem::Version
|
|
252
239
|
version: '0'
|
|
253
240
|
requirements: []
|
|
254
|
-
rubygems_version: 3.
|
|
241
|
+
rubygems_version: 3.1.2
|
|
255
242
|
signing_key:
|
|
256
243
|
specification_version: 4
|
|
257
244
|
summary: API client for WorkOS
|