workos 1.1.0 → 1.4.0

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: 7d48c12ff6a0a470ca2a35fb76cabf17fe9d4f2444b11811891a9ea0c81f9cda
4
- data.tar.gz: ec43b59ca57135efd145346ce14ebab1ed30341f210b3a47f8525afb907d3856
3
+ metadata.gz: '0759642aa08b5b318ae278e24ccb6ea8fff542813f824554144bf8a7cb1c5e36'
4
+ data.tar.gz: 2107f726a12230587fadd90c84a3cef8db7ead1b247533f3e7a61b63b1698512
5
5
  SHA512:
6
- metadata.gz: 2068f4bd90b52d90b802eea6f1e8ebeb2a5e1b166d5256d952df40af30821bd858999813532f18e9ab44eff36f4cde40a27f423126028509fe9c12f15ef07d58
7
- data.tar.gz: 526f33fd44a2371696dc19f400461af7e170e362d7057bf04529767eae8692d12b8e56635f6b61d5b0e8c585f2275e65e62422f064bbe056645c2c0cc1cfe14f
6
+ metadata.gz: ae53dc4b2bfb55fca62f49e09439731bdf77e708c9bb6239bf7b5cd50e23e6ed95aeaf2a5761720dce07bbe4c59ea8520c5df7a37b128f5c767a05ac25693b6d
7
+ data.tar.gz: 8bc941b051ba860742f8890a19999e289e64011da34af698f5b84006b9a27c9dd97fd5a5d277f3341e69be70037e7d0d2daa47c1fb0c4899450d8b699b89d6cd
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (1.1.0)
4
+ workos (1.4.0)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
10
+ addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  ast (2.4.2)
13
13
  codecov (0.2.12)
@@ -60,7 +60,7 @@ GEM
60
60
  simplecov_json_formatter (0.1.2)
61
61
  sorbet (0.5.6388)
62
62
  sorbet-static (= 0.5.6388)
63
- sorbet-runtime (0.5.6424)
63
+ sorbet-runtime (0.5.6530)
64
64
  sorbet-static (0.5.6388-universal-darwin-14)
65
65
  sorbet-static (0.5.6388-universal-darwin-15)
66
66
  sorbet-static (0.5.6388-universal-darwin-16)
data/lib/workos/client.rb CHANGED
@@ -48,7 +48,7 @@ module WorkOS
48
48
  'Content-Type' => 'application/json',
49
49
  )
50
50
 
51
- request['Authorization'] = "Bearer #{access_token || WorkOS.key!}}" if auth
51
+ request['Authorization'] = "Bearer #{access_token || WorkOS.key!}" if auth
52
52
  request['User-Agent'] = user_agent
53
53
  request
54
54
  end
@@ -8,7 +8,7 @@ module WorkOS
8
8
  class Directory
9
9
  extend T::Sig
10
10
 
11
- attr_accessor :id, :domain, :name, :type, :state
11
+ attr_accessor :id, :domain, :name, :type, :state, :organization_id
12
12
 
13
13
  sig { params(json: String).void }
14
14
  def initialize(json)
@@ -19,6 +19,7 @@ module WorkOS
19
19
  @domain = T.let(raw.domain, String)
20
20
  @type = T.let(raw.type, String)
21
21
  @state = T.let(raw.state, String)
22
+ @organization_id = T.let(raw.organization_id, String)
22
23
  end
23
24
 
24
25
  def to_json(*)
@@ -28,6 +29,7 @@ module WorkOS
28
29
  domain: domain,
29
30
  type: type,
30
31
  state: state,
32
+ organization_id: organization_id,
31
33
  }
32
34
  end
33
35
 
@@ -47,6 +49,7 @@ module WorkOS
47
49
  domain: hash[:domain],
48
50
  type: hash[:type],
49
51
  state: hash[:state],
52
+ organization_id: hash[:organization_id],
50
53
  )
51
54
  end
52
55
  end
@@ -9,8 +9,9 @@ module WorkOS
9
9
  extend T::Sig
10
10
 
11
11
  attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :username, :state,
12
- :raw_attributes
12
+ :groups, :raw_attributes
13
13
 
14
+ # rubocop:disable Metrics/AbcSize
14
15
  sig { params(json: String).void }
15
16
  def initialize(json)
16
17
  raw = parse_json(json)
@@ -22,8 +23,10 @@ module WorkOS
22
23
  @last_name = raw.last_name
23
24
  @username = raw.username
24
25
  @state = raw.state
26
+ @groups = T.let(raw.groups, Array)
25
27
  @raw_attributes = raw.raw_attributes
26
28
  end
29
+ # rubocop:enable Metrics/AbcSize
27
30
 
28
31
  def to_json(*)
29
32
  {
@@ -34,6 +37,7 @@ module WorkOS
34
37
  last_name: last_name,
35
38
  username: username,
36
39
  state: state,
40
+ groups: groups,
37
41
  raw_attributes: raw_attributes,
38
42
  }
39
43
  end
@@ -56,6 +60,7 @@ module WorkOS
56
60
  last_name: hash[:last_name],
57
61
  username: hash[:username],
58
62
  state: hash[:state],
63
+ groups: hash[:groups],
59
64
  raw_attributes: hash[:raw_attributes],
60
65
  )
61
66
  end
data/lib/workos/errors.rb CHANGED
@@ -13,12 +13,16 @@ module WorkOS
13
13
  sig do
14
14
  params(
15
15
  message: T.nilable(String),
16
+ error: T.nilable(String),
17
+ error_description: T.nilable(String),
16
18
  http_status: T.nilable(Integer),
17
19
  request_id: T.nilable(String),
18
20
  ).void
19
21
  end
20
- def initialize(message: nil, http_status: nil, request_id: nil)
22
+ def initialize(message: nil, error: nil, error_description: nil, http_status: nil, request_id: nil)
21
23
  @message = message
24
+ @error = error
25
+ @error_description = error_description
22
26
  @http_status = http_status
23
27
  @request_id = request_id
24
28
  end
@@ -27,7 +31,14 @@ module WorkOS
27
31
  def to_s
28
32
  status_string = @http_status.nil? ? '' : "Status #{@http_status}, "
29
33
  id_string = @request_id.nil? ? '' : " - request ID: #{@request_id}"
30
- "#{status_string}#{@message}#{id_string}"
34
+ if @error && @error_description
35
+ error_string = "error: #{@error}, error_description: #{@error_description}"
36
+ "#{status_string}#{error_string}#{id_string}"
37
+ elsif @error
38
+ "#{status_string}#{@error}#{id_string}"
39
+ else
40
+ "#{status_string}#{@message}#{id_string}"
41
+ end
31
42
  end
32
43
  end
33
44
 
@@ -62,7 +62,7 @@ module WorkOS
62
62
  # :id=>"org_domain_01E6PK9N3XMD8RHWF7S66380AR",
63
63
  # :domain=>"foo-corp.com"}]>
64
64
  #
65
- # @return [WorkOS::Connection]
65
+ # @return [WorkOS::Organization]
66
66
  sig { params(id: String).returns(WorkOS::Organization) }
67
67
  def get_organization(id:)
68
68
  request = get_request(
@@ -125,6 +125,27 @@ module WorkOS
125
125
  WorkOS::Organization.new(response.body)
126
126
  end
127
127
 
128
+ # Delete an Organization
129
+ #
130
+ # @param [String] id Organization unique identifier
131
+ #
132
+ # @example
133
+ # WorkOS::SSO.delete_organization(id: 'org_01EHZNVPK3SFK441A1RGBFSHRT')
134
+ # => true
135
+ #
136
+ # @return [Bool] - returns `true` if successful
137
+ sig { params(id: String).returns(T::Boolean) }
138
+ def delete_organization(id:)
139
+ request = delete_request(
140
+ auth: true,
141
+ path: "/organizations/#{id}",
142
+ )
143
+
144
+ response = execute_request(request: request)
145
+
146
+ response.is_a? Net::HTTPSuccess
147
+ end
148
+
128
149
  private
129
150
 
130
151
  sig { params(response: Net::HTTPResponse).void }
data/lib/workos/sso.rb CHANGED
@@ -248,12 +248,15 @@ module WorkOS
248
248
  end
249
249
 
250
250
  sig { params(response: Net::HTTPResponse).void }
251
+ # rubocop:disable Metrics/MethodLength
251
252
  def check_and_raise_profile_and_token_error(response:)
252
253
  begin
253
254
  body = JSON.parse(response.body)
254
255
  return if body['access_token'] && body['profile']
255
256
 
256
257
  message = body['message']
258
+ error = body['error']
259
+ error_description = body['error_description']
257
260
  request_id = response['x-request-id']
258
261
  rescue StandardError
259
262
  message = 'Something went wrong'
@@ -261,10 +264,13 @@ module WorkOS
261
264
 
262
265
  raise APIError.new(
263
266
  message: message,
267
+ error: error,
268
+ error_description: error_description,
264
269
  http_status: nil,
265
270
  request_id: request_id,
266
271
  )
267
272
  end
273
+ # rubocop:enable Metrics/MethodLength
268
274
  end
269
275
  end
270
276
  end
@@ -11,6 +11,7 @@ module WorkOS
11
11
  const :domain, String
12
12
  const :type, String
13
13
  const :state, String
14
+ const :organization_id, String
14
15
  end
15
16
  end
16
17
  end
@@ -13,6 +13,7 @@ module WorkOS
13
13
  const :last_name, T.nilable(String)
14
14
  const :username, T.nilable(String)
15
15
  const :state, T.nilable(String)
16
+ const :groups, T::Array[T.untyped]
16
17
  const :raw_attributes, T::Hash[Symbol, Object]
17
18
  end
18
19
  end
@@ -8,6 +8,7 @@ module WorkOS
8
8
  class Provider < T::Enum
9
9
  enums do
10
10
  Google = new('GoogleOAuth')
11
+ Microsoft = new('MicrosoftOAuth')
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 = '1.1.0'
5
+ VERSION = '1.4.0'
6
6
  end
@@ -161,4 +161,31 @@ describe WorkOS::Organizations do
161
161
  end
162
162
  end
163
163
  end
164
+
165
+ describe '.delete_organization' do
166
+ context 'with a valid id' do
167
+ it 'returns true' do
168
+ VCR.use_cassette('organization/delete') do
169
+ response = described_class.delete_organization(
170
+ id: 'org_01F4A8TD0B4N1Y9SJ8SH635HDB',
171
+ )
172
+
173
+ expect(response).to be(true)
174
+ end
175
+ end
176
+ end
177
+
178
+ context 'with an invalid id' do
179
+ it 'returns false' do
180
+ VCR.use_cassette('organization/delete_invalid') do
181
+ expect do
182
+ described_class.delete_organization(id: 'invalid')
183
+ end.to raise_error(
184
+ WorkOS::APIError,
185
+ 'Status 404, Not Found - request ID: ',
186
+ )
187
+ end
188
+ end
189
+ end
190
+ end
164
191
  end
@@ -143,7 +143,7 @@ describe WorkOS::SSO do
143
143
  described_class.authorization_url(**args)
144
144
  end.to raise_error(
145
145
  ArgumentError,
146
- 'Okta is not a valid value. `provider` must be in ["GoogleOAuth"]',
146
+ 'Okta is not a valid value. `provider` must be in ["GoogleOAuth", "MicrosoftOAuth"]',
147
147
  )
148
148
  end
149
149
  end
@@ -252,7 +252,7 @@ describe WorkOS::SSO do
252
252
  to_return(
253
253
  headers: { 'X-Request-ID' => 'request-id' },
254
254
  status: 422,
255
- body: { "message": 'some error message' }.to_json,
255
+ body: { "error": 'some error', "error_description": 'some error description' }.to_json,
256
256
  )
257
257
  end
258
258
 
@@ -261,7 +261,7 @@ describe WorkOS::SSO do
261
261
  described_class.profile_and_token(**args)
262
262
  end.to raise_error(
263
263
  WorkOS::APIError,
264
- 'some error message - request ID: request-id',
264
+ 'error: some error, error_description: some error description - request ID: request-id',
265
265
  )
266
266
  end
267
267
  end
@@ -271,11 +271,11 @@ describe WorkOS::SSO do
271
271
  stub_request(:post, 'https://api.workos.com/sso/token').
272
272
  with(body: request_body).
273
273
  to_return(
274
- status: 201,
274
+ status: 400,
275
275
  headers: { 'X-Request-ID' => 'request-id' },
276
276
  body: {
277
- message: "The code '01DVX3C5Z367SFHR8QNDMK7V24'" \
278
- ' has expired or is invalid.',
277
+ "error": 'invalid_grant',
278
+ "error_description": "The code '01DVX3C5Z367SFHR8QNDMK7V24' has expired or is invalid.",
279
279
  }.to_json,
280
280
  )
281
281
  end
@@ -285,7 +285,7 @@ describe WorkOS::SSO do
285
285
  described_class.profile_and_token(**args)
286
286
  end.to raise_error(
287
287
  WorkOS::APIError,
288
- "The code '01DVX3C5Z367SFHR8QNDMK7V24'" \
288
+ "error: invalid_grant, error_description: The code '01DVX3C5Z367SFHR8QNDMK7V24'" \
289
289
  ' has expired or is invalid. - request ID: request-id',
290
290
  )
291
291
  end
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,20 +53,23 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - 1e6d2f37-ca39-4e6c-8d04-4a56fed444ce
56
+ - 167e0fa2-cee2-4834-a0aa-4f68fd0a3796
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '784'
59
61
  Etag:
60
- - W/"7dc-9PMr4siidbvsdQqw0uiJT6E94Dc"
62
+ - W/"310-fBrsCTIA95j4JLo4UR8X2zBThYQ"
61
63
  Date:
62
- - Thu, 22 Apr 2021 21:33:48 GMT
63
- Transfer-Encoding:
64
- - chunked
64
+ - Mon, 07 Jun 2021 17:55:30 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
- encoding: ASCII-8BIT
69
- string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
68
+ encoding: UTF-8
69
+ string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo
70
+ Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
71
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example
72
+ Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com"}]}'
70
73
  http_version:
71
- recorded_at: Thu, 22 Apr 2021 21:33:49 GMT
74
+ recorded_at: Mon, 07 Jun 2021 17:55:30 GMT
72
75
  recorded_with: VCR 5.0.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,7 +53,7 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - ee432766-24b5-4d6d-baa9-05b7d56ac582
56
+ - d5e27591-7a56-468c-bffe-3a035f3bf26c
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Content-Length:
@@ -61,12 +61,15 @@ http_interactions:
61
61
  Etag:
62
62
  - W/"47-5KOnfOsRy36pnaPjBxvaf6LRiGc"
63
63
  Date:
64
- - Thu, 22 Apr 2021 21:33:48 GMT
64
+ - Mon, 07 Jun 2021 17:55:30 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: UTF-8
69
- string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
69
+ string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo
70
+ Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
71
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example
72
+ Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com"}]}'
70
73
  http_version:
71
- recorded_at: Thu, 22 Apr 2021 21:33:48 GMT
74
+ recorded_at: Mon, 07 Jun 2021 17:55:30 GMT
72
75
  recorded_with: VCR 5.0.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,21 +53,21 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - c2664753-7a2a-499f-a6e7-dae700ad49d7
56
+ - d3cd212f-5dc1-4e08-ab1f-69e33bebd9ca
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Content-Length:
60
- - '256'
60
+ - '539'
61
61
  Etag:
62
- - W/"100-Vh8CFQGzG+aGyEkNXe2nXGxNFJ4"
62
+ - W/"21b-d3KisYEu0vvI9FJFreAktGIgT+c"
63
63
  Date:
64
- - Thu, 22 Apr 2021 21:33:47 GMT
64
+ - Mon, 07 Jun 2021 17:55:29 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: UTF-8
69
- string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01EK2YEMVTWGX27STRDR0N3MP9","name":"Foo
70
- Corp","external_key":"SZ5TZMl7gcOAKS04","type":"gsuite directory","state":"linked","domain":"foo-corp.com"}]}'
69
+ string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
70
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"}]}'
71
71
  http_version:
72
- recorded_at: Thu, 22 Apr 2021 21:33:47 GMT
72
+ recorded_at: Mon, 07 Jun 2021 17:55:29 GMT
73
73
  recorded_with: VCR 5.0.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,22 +53,22 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - 428c7b66-d05a-4055-8bad-3411cce2af98
56
+ - 64e81466-93f3-4496-a218-53982dbf6614
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Content-Length:
60
- - '509'
60
+ - '573'
61
61
  Etag:
62
- - W/"1fd-xSekCggfEeBaxDK/LwXVh/ANf8E"
62
+ - W/"23d-dw0vE9mpthzl0ajnZ3YLimmU4ZU"
63
63
  Date:
64
- - Thu, 22 Apr 2021 21:33:49 GMT
64
+ - Mon, 07 Jun 2021 17:55:31 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: UTF-8
69
- string: '{"object":"list","listMetadata":{"before":"directory_01F3DR5PASNQN7Z41K933Q12BM","after":null},"data":[{"object":"directory","id":"directory_01F3TMHZ5786V0BW141Q3G6XWX","name":"NEW
70
- Azure AD SCIM","external_key":"RfEhaHYmukAQgqME","type":"azure scim v2.0","state":"linked","domain":"sheldonvaughn.com"},{"object":"directory","id":"directory_01F3DR5PASNQN7Z41K933Q12BM","name":"Example
71
- Workday Company, Inc.","external_key":"NGGpjT9hQsiSgOKc","type":"workday","state":"unlinked","domain":"domain.example.com"}]}'
69
+ string: '{"object":"list","listMetadata":{"before":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo
70
+ Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
71
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"}]}'
72
72
  http_version:
73
- recorded_at: Thu, 22 Apr 2021 21:33:49 GMT
73
+ recorded_at: Mon, 07 Jun 2021 17:55:31 GMT
74
74
  recorded_with: VCR 5.0.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.2.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -30,8 +30,14 @@ http_interactions:
30
30
  - Origin, Accept-Encoding
31
31
  Access-Control-Allow-Credentials:
32
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'
33
37
  X-Dns-Prefetch-Control:
34
38
  - 'off'
39
+ Expect-Ct:
40
+ - max-age=0
35
41
  X-Frame-Options:
36
42
  - SAMEORIGIN
37
43
  Strict-Transport-Security:
@@ -40,23 +46,30 @@ http_interactions:
40
46
  - noopen
41
47
  X-Content-Type-Options:
42
48
  - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
43
53
  X-Xss-Protection:
44
- - 1; mode=block
54
+ - '0'
45
55
  X-Request-Id:
46
- - 53c53a76-1f3f-43bb-85a3-8faef43db375
56
+ - 0f6aa030-02d6-456e-960b-60682ab134d0
47
57
  Content-Type:
48
58
  - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '784'
49
61
  Etag:
50
- - W/"b53-vfsK4+PwHsj4f+pAs0MzdO3odVo"
62
+ - W/"310-fBrsCTIA95j4JLo4UR8X2zBThYQ"
51
63
  Date:
52
- - Thu, 30 Apr 2020 03:11:45 GMT
53
- Transfer-Encoding:
54
- - chunked
64
+ - Mon, 07 Jun 2021 17:55:29 GMT
55
65
  Via:
56
66
  - 1.1 vegur
57
67
  body:
58
- encoding: ASCII-8BIT
59
- string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_edp_1","external_key":"lA3gS1kCZMCkk82E","state":"linked","type":"gsuite directory","name":"Foo Corp","bearer_token":null,"client_id":"project_XXX","domain":"foo-corp.com"}, {"object":"directory","id":"directory_edp_2","external_key":"lA3g","state":"linked","type":"okta scim v2.0","name":"Example", "bearer_token":null,"client_id":"project_XXX","domain":"example.com"}, {"object":"directory","id":"directory_edp_3","external_key":"lA3gS1kC","state":"linked","type":"bamboohr","name":"Acme","bearer_token":null,"client_id":"project_XXX","domain":"acme.com"}]}'
68
+ encoding: UTF-8
69
+ string: '{"object":"list","listMetadata":{"before":"before-id","after":null},"data":[{"object":"directory","id":"directory_01F7796W20KW0CXEQQEYENT0ZC","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Bamboo
70
+ Test","external_key":"rPzV4pdpbaUiKsc6","type":"bamboohr","state":"unlinked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
71
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F5XHH1QHX6C2F0Z6WG9YPGCJ","organization_id":"org_01F29YJ068E52HGEB8ZQGC9MJG","name":"Example
72
+ Azure SCIM","external_key":"YDKJvbWHKKg66cSk","type":"azure scim v2.0","state":"linked","domain":"example.com"}]}'
60
73
  http_version:
61
- recorded_at: Thu, 30 Apr 2020 03:11:45 GMT
74
+ recorded_at: Mon, 07 Jun 2021 17:55:29 GMT
62
75
  recorded_with: VCR 5.0.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3
17
+ - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.2.1
18
18
  Authorization:
19
19
  - Bearer <API_KEY>
20
20
  response:
@@ -53,21 +53,21 @@ http_interactions:
53
53
  X-Xss-Protection:
54
54
  - '0'
55
55
  X-Request-Id:
56
- - 0c70123e-f36e-4b8f-bcaa-d5f04d65b619
56
+ - 5e0ab2f6-9af6-467d-a5a0-352425d8be64
57
57
  Content-Type:
58
58
  - application/json; charset=utf-8
59
59
  Content-Length:
60
- - '256'
60
+ - '305'
61
61
  Etag:
62
- - W/"100-Vh8CFQGzG+aGyEkNXe2nXGxNFJ4"
62
+ - W/"131-TOcWi8K5/vWBSqHH1IZu5atd73o"
63
63
  Date:
64
- - Thu, 22 Apr 2021 21:33:48 GMT
64
+ - Mon, 07 Jun 2021 17:55:30 GMT
65
65
  Via:
66
66
  - 1.1 vegur
67
67
  body:
68
68
  encoding: UTF-8
69
- string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01EK2YEMVTWGX27STRDR0N3MP9","name":"Foo
70
- Corp","external_key":"SZ5TZMl7gcOAKS04","type":"gsuite directory","state":"linked","domain":"foo-corp.com"}]}'
69
+ string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory","id":"directory_01F5ZY7XVQZ3DRYEZTH1EPA8BS","organization_id":"org_01EZDF20TZEJXKPSX2BJRN6TV6","name":"Foo
70
+ Corp","external_key":"qV4eyK99QGUaYYa0","type":"okta scim v2.0","state":"linked","domain":"foo-corp.com"}]}'
71
71
  http_version:
72
- recorded_at: Thu, 22 Apr 2021 21:33:48 GMT
72
+ recorded_at: Mon, 07 Jun 2021 17:55:30 GMT
73
73
  recorded_with: VCR 5.0.0
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.workos.com/organizations/org_01F4A8TD0B4N1Y9SJ8SH635HDB
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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.1.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 202
23
+ message: Accepted
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
+ -
57
+ Content-Type:
58
+ - text/plain; charset=utf-8
59
+ Content-Length:
60
+ - '8'
61
+ Etag:
62
+ - W/"8-YaBXLEiT7zQxEyDYTILfiL6oPhE"
63
+ Date:
64
+ - Mon, 24 May 2021 21:07:34 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: Accepted
70
+ http_version:
71
+ recorded_at: Mon, 24 May 2021 21:07:34 GMT
72
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.workos.com/organizations/invalid
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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.1.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
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
+ -
57
+ Content-Type:
58
+ - application/json; charset=utf-8
59
+ Content-Length:
60
+ - '23'
61
+ Etag:
62
+ - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
63
+ Date:
64
+ - Mon, 24 May 2021 21:07:34 GMT
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"message":"Not Found"}'
70
+ http_version:
71
+ recorded_at: Mon, 24 May 2021 21:07:34 GMT
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: 1.1.0
4
+ version: 1.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: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -309,6 +309,8 @@ files:
309
309
  - spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
310
310
  - spec/support/fixtures/vcr_cassettes/organization/create.yml
311
311
  - spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
312
+ - spec/support/fixtures/vcr_cassettes/organization/delete.yml
313
+ - spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml
312
314
  - spec/support/fixtures/vcr_cassettes/organization/get.yml
313
315
  - spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
314
316
  - spec/support/fixtures/vcr_cassettes/organization/list.yml
@@ -355,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
357
  - !ruby/object:Gem::Version
356
358
  version: '0'
357
359
  requirements: []
358
- rubygems_version: 3.2.17
360
+ rubygems_version: 3.2.24
359
361
  signing_key:
360
362
  specification_version: 4
361
363
  summary: API client for WorkOS
@@ -400,6 +402,8 @@ test_files:
400
402
  - spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml
401
403
  - spec/support/fixtures/vcr_cassettes/organization/create.yml
402
404
  - spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
405
+ - spec/support/fixtures/vcr_cassettes/organization/delete.yml
406
+ - spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml
403
407
  - spec/support/fixtures/vcr_cassettes/organization/get.yml
404
408
  - spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
405
409
  - spec/support/fixtures/vcr_cassettes/organization/list.yml