workos 0.2.2 → 0.2.3
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/.rubocop.yml +2 -0
- data/.ruby-version +1 -1
- data/.semaphore/semaphore.yml +13 -6
- data/Gemfile.lock +6 -6
- data/lib/workos.rb +1 -0
- data/lib/workos/audit_trail.rb +0 -16
- data/lib/workos/client.rb +43 -4
- data/lib/workos/connection.rb +48 -0
- data/lib/workos/profile.rb +6 -7
- data/lib/workos/sso.rb +45 -32
- data/lib/workos/types.rb +2 -2
- data/lib/workos/types/connection_struct.rb +15 -0
- data/lib/workos/types/profile_struct.rb +0 -1
- data/lib/workos/types/provider_enum.rb +0 -1
- data/lib/workos/version.rb +1 -1
- data/sorbet/rbi/hidden-definitions/errors.txt +1416 -321
- data/sorbet/rbi/hidden-definitions/hidden.rbi +2490 -597
- data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +36 -14
- data/sorbet/rbi/todo.rbi +1 -6
- data/spec/lib/workos/sso_spec.rb +46 -0
- data/spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml +58 -0
- data/spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml +63 -0
- metadata +8 -2
@@ -57,7 +57,7 @@ module Rainbow
|
|
57
57
|
sig { params(value: Numeric).returns(Integer) }
|
58
58
|
def to_ansi_domain(value); end
|
59
59
|
|
60
|
-
sig { params(ground: Symbol, values: Integer).returns(RGB) }
|
60
|
+
sig { params(ground: Symbol, values: Integer).returns(RGB) }
|
61
61
|
def initialize(ground, *values); end
|
62
62
|
|
63
63
|
sig { returns(T::Array[Integer]) }
|
@@ -94,9 +94,18 @@ module Rainbow
|
|
94
94
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
95
95
|
def color(*values); end
|
96
96
|
|
97
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
98
|
+
def foreground(*values); end
|
99
|
+
|
100
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
101
|
+
def fg(*values); end
|
102
|
+
|
97
103
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
98
104
|
def background(*values); end
|
99
105
|
|
106
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
107
|
+
def bg(*values); end
|
108
|
+
|
100
109
|
sig { returns(NullPresenter) }
|
101
110
|
def reset; end
|
102
111
|
|
@@ -148,12 +157,14 @@ module Rainbow
|
|
148
157
|
sig { returns(NullPresenter) }
|
149
158
|
def white; end
|
150
159
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
160
|
+
sig { returns(NullPresenter) }
|
161
|
+
def bold; end
|
162
|
+
|
163
|
+
sig { returns(NullPresenter) }
|
164
|
+
def dark; end
|
165
|
+
|
166
|
+
sig { returns(NullPresenter) }
|
167
|
+
def strike; end
|
157
168
|
end
|
158
169
|
|
159
170
|
class Presenter < String
|
@@ -162,9 +173,18 @@ module Rainbow
|
|
162
173
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
163
174
|
def color(*values); end
|
164
175
|
|
176
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
177
|
+
def foreground(*values); end
|
178
|
+
|
179
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
180
|
+
def fg(*values); end
|
181
|
+
|
165
182
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
166
183
|
def background(*values); end
|
167
184
|
|
185
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
186
|
+
def bg(*values); end
|
187
|
+
|
168
188
|
sig { returns(Presenter) }
|
169
189
|
def reset; end
|
170
190
|
|
@@ -216,12 +236,14 @@ module Rainbow
|
|
216
236
|
sig { returns(Presenter) }
|
217
237
|
def white; end
|
218
238
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
239
|
+
sig { returns(Presenter) }
|
240
|
+
def bold; end
|
241
|
+
|
242
|
+
sig { returns(Presenter) }
|
243
|
+
def dark; end
|
244
|
+
|
245
|
+
sig { returns(Presenter) }
|
246
|
+
def strike; end
|
225
247
|
end
|
226
248
|
|
227
249
|
class StringUtils
|
@@ -240,7 +262,7 @@ module Rainbow
|
|
240
262
|
|
241
263
|
sig { params(enabled: T::Boolean).returns(Wrapper) }
|
242
264
|
def initialize(enabled = true); end
|
243
|
-
|
265
|
+
|
244
266
|
sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) }
|
245
267
|
def wrap(string); end
|
246
268
|
end
|
data/sorbet/rbi/todo.rbi
CHANGED
@@ -2,11 +2,6 @@
|
|
2
2
|
# srb rbi todo
|
3
3
|
|
4
4
|
# typed: strong
|
5
|
+
module T::CompatibilityPatches::RecorderExtensions; end
|
5
6
|
module T::Private::Methods::MethodHooks; end
|
6
|
-
module T::Private::Methods::MethodHooks; end
|
7
|
-
module T::Private::Methods::MethodHooks; end
|
8
|
-
module T::Private::Methods::SingletonMethodHooks; end
|
9
|
-
module T::Private::Methods::SingletonMethodHooks; end
|
10
|
-
module T::Private::Methods::SingletonMethodHooks; end
|
11
|
-
module T::Private::Methods::SingletonMethodHooks; end
|
12
7
|
module T::Private::Methods::SingletonMethodHooks; end
|
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -211,7 +211,53 @@ describe WorkOS::SSO do
|
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
|
+
describe '.create_connection' do
|
215
|
+
before(:all) do
|
216
|
+
WorkOS.key = 'key'
|
217
|
+
end
|
218
|
+
|
219
|
+
after(:all) do
|
220
|
+
WorkOS.key = nil
|
221
|
+
end
|
222
|
+
|
223
|
+
context 'with a valid source' do
|
224
|
+
it 'creates a connection' do
|
225
|
+
VCR.use_cassette('sso/create_connection_with_valid_source') do
|
226
|
+
connection = WorkOS::SSO.create_connection(
|
227
|
+
source: 'draft_conn_01E6PK87QP6NQ29RRX0G100YGV',
|
228
|
+
)
|
229
|
+
|
230
|
+
expect(connection.id).to eq('conn_01E4F9T2YWZFD218DN04KVFDSY')
|
231
|
+
expect(connection.connection_type).to eq('GoogleOAuth')
|
232
|
+
expect(connection.name).to eq('Foo Corp')
|
233
|
+
expect(connection.domains.first[:domain]).to eq('example.com')
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
context 'with an invalid source' do
|
239
|
+
it 'raises an error' do
|
240
|
+
VCR.use_cassette('sso/create_connection_with_invalid_source') do
|
241
|
+
expect do
|
242
|
+
WorkOS::SSO.create_connection(source: 'invalid')
|
243
|
+
end.to raise_error(
|
244
|
+
WorkOS::APIError,
|
245
|
+
'Status 404, Not Found - request ID: ',
|
246
|
+
)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
214
252
|
describe '.promote_draft_connection' do
|
253
|
+
before(:all) do
|
254
|
+
WorkOS.key = 'key'
|
255
|
+
end
|
256
|
+
|
257
|
+
after(:all) do
|
258
|
+
WorkOS.key = nil
|
259
|
+
end
|
260
|
+
|
215
261
|
let(:token) { 'draft_conn_id' }
|
216
262
|
let(:project_id) { 'proj_0239u590h' }
|
217
263
|
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/connections
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"source":"invalid"}'
|
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.2.2
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
24
|
+
headers:
|
25
|
+
Vary:
|
26
|
+
- Origin, Accept-Encoding
|
27
|
+
Access-Control-Allow-Credentials:
|
28
|
+
- 'true'
|
29
|
+
X-Dns-Prefetch-Control:
|
30
|
+
- 'off'
|
31
|
+
X-Frame-Options:
|
32
|
+
- SAMEORIGIN
|
33
|
+
Strict-Transport-Security:
|
34
|
+
- max-age=15552000; includeSubDomains
|
35
|
+
X-Download-Options:
|
36
|
+
- noopen
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Request-Id:
|
42
|
+
- ''
|
43
|
+
Content-Type:
|
44
|
+
- application/json; charset=utf-8
|
45
|
+
Content-Length:
|
46
|
+
- '23'
|
47
|
+
Etag:
|
48
|
+
- W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
|
49
|
+
Date:
|
50
|
+
- Fri, 24 Apr 2020 02:16:27 GMT
|
51
|
+
Connection:
|
52
|
+
- keep-alive
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"message":"Not Found"}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Fri, 24 Apr 2020 02:16:27 GMT
|
58
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/connections
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"source":"draft_conn_01E6PK87QP6NQ29RRX0G100YGV"}'
|
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.2.2
|
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
|
+
X-Dns-Prefetch-Control:
|
34
|
+
- 'off'
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15552000; includeSubDomains
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 8cd03fab-ca1a-4c0b-9953-1f918849a9de
|
47
|
+
Content-Type:
|
48
|
+
- application/json; charset=utf-8
|
49
|
+
Etag:
|
50
|
+
- W/"55a-z00MNCfGmS/7RWJwhsBrAXo09Ls"
|
51
|
+
Date:
|
52
|
+
- Fri, 24 Apr 2020 17:20:52 GMT
|
53
|
+
Transfer-Encoding:
|
54
|
+
- chunked
|
55
|
+
Via:
|
56
|
+
- 1.1 vegur
|
57
|
+
body:
|
58
|
+
encoding: ASCII-8BIT
|
59
|
+
string: '{"object":"connection","id":"conn_01E4F9T2YWZFD218DN04KVFDSY","status":"unlinked","name":"Foo Corp","connection_type":"GoogleOAuth","oauth_uid":"demo
|
60
|
+
client id","oauth_secret":"demo client secret","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/gcrSPYSytyQeZKkwKs6Ye4ogM/callback","saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_trust_cert":null,"saml_x509_certs":null,"domains":[{"object":"connection_domain","id":"domain_01E6PK9N3XMD8RHWF7S66380AR","domain":"example.com"}]}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 24 Apr 2020 17:20:52 GMT
|
63
|
+
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -210,10 +210,12 @@ files:
|
|
210
210
|
- lib/workos/audit_trail.rb
|
211
211
|
- lib/workos/base.rb
|
212
212
|
- lib/workos/client.rb
|
213
|
+
- lib/workos/connection.rb
|
213
214
|
- lib/workos/errors.rb
|
214
215
|
- lib/workos/profile.rb
|
215
216
|
- lib/workos/sso.rb
|
216
217
|
- lib/workos/types.rb
|
218
|
+
- lib/workos/types/connection_struct.rb
|
217
219
|
- lib/workos/types/profile_struct.rb
|
218
220
|
- lib/workos/types/provider_enum.rb
|
219
221
|
- lib/workos/version.rb
|
@@ -236,6 +238,8 @@ files:
|
|
236
238
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml
|
237
239
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml
|
238
240
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
241
|
+
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
242
|
+
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
239
243
|
- spec/support/profile.txt
|
240
244
|
- workos.gemspec
|
241
245
|
homepage: https://github.com/workos/workos-ruby
|
@@ -272,4 +276,6 @@ test_files:
|
|
272
276
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml
|
273
277
|
- spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml
|
274
278
|
- spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml
|
279
|
+
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_invalid_source.yml
|
280
|
+
- spec/support/fixtures/vcr_cassettes/sso/create_connection_with_valid_source.yml
|
275
281
|
- spec/support/profile.txt
|