workos 4.2.1 → 4.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f18e38578e2afcc1a18b6141954b28c4c58a7ea9ae46baa58eed157a452c1a8b
4
- data.tar.gz: 5e5036dfbad3f0fd25f1cb2368144692cd40f18d3668ea43be442ffa62f7b3d7
3
+ metadata.gz: b0788087be575732297410a9b832a1290f5615b632560366589db388e1b6ec8d
4
+ data.tar.gz: 97493a7743daa8994b65319882e3c3351361ea2a8a289c425abd6fc04023098f
5
5
  SHA512:
6
- metadata.gz: 50833c139a6ad2f9dcfffb74a74e38b7add1edfb3b76b63b0b1e7d2cd5673cc837a9abc35ba05998392aea10907acf80c65c9144abde217b1671aa3c65557a23
7
- data.tar.gz: c4ad2de56c7fd7b5da14b849295e2e9d4921b33c0ad6080d47387ff09e4a91c973e7a42ba648869a14280bad15eab3640736652d1b9916d333b24c842ef0c136
6
+ metadata.gz: fa8eca58f02a95f137a610033413f408477bdc8bcf66c14ddb9bda85be3e6f2bf008031b5cf7e13fd501962f4ab4c183b73477216879cfe86d9c9c3cf086c123
7
+ data.tar.gz: f156a6d7a1d032753dc7f79b478acd492f81b164bf974432ae1f3a7c2770145e347c4b501e1aaf42b8716eb67c7401fd167558859645f7090e79f638519ae1b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (4.2.1)
4
+ workos (4.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -45,6 +45,19 @@ end
45
45
 
46
46
  For our SDKs WorkOS follows a Semantic Versioning ([SemVer](https://semver.org/)) process where all releases will have a version X.Y.Z (like 1.0.0) pattern wherein Z would be a bug fix (e.g., 1.0.1), Y would be a minor release (1.1.0) and X would be a major release (2.0.0). We permit any breaking changes to only be released in major versions and strongly recommend reading changelogs before making any major version upgrades.
47
47
 
48
+ ## Beta Releases
49
+
50
+ WorkOS has features in Beta that can be accessed via Beta releases. We would love for you to try these
51
+ and share feedback with us before these features reach general availability (GA). To install a Beta version,
52
+ please follow the [installation steps](#installation) above using the Beta release version.
53
+
54
+ > Note: there can be breaking changes between Beta versions. Therefore, we recommend pinning the package version to a
55
+ > specific version. This way you can install the same version each time without breaking changes unless you are
56
+ > intentionally looking for the latest Beta version.
57
+
58
+ We highly recommend keeping an eye on when the Beta feature you are interested in goes from Beta to stable so that you
59
+ can move to using the stable version.
60
+
48
61
  ## More Information
49
62
 
50
63
  * [Single Sign-On Guide](https://workos.com/docs/sso/guide)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WorkOS
4
+ # Provides helpers for working with deprecated SDK and API features.
5
+ module Deprecation
6
+ def warn_deprecation(message)
7
+ full_message = "[DEPRECATION] #{message}"
8
+
9
+ if RUBY_VERSION > '3'
10
+ warn full_message, category: :deprecated
11
+ else
12
+ warn full_message
13
+ end
14
+ end
15
+ end
16
+ end
data/lib/workos/events.rb CHANGED
@@ -15,7 +15,7 @@ module WorkOS
15
15
  #
16
16
  # @param [Hash] options An options hash
17
17
  # @option options [String] event The type of event
18
- # retrieved.
18
+ # @option options [String] organization_id Limit scope of events to an organization
19
19
  # @option options [String] limit Maximum number of records to return.
20
20
  # @option options [String] after Pagination cursor to receive records
21
21
  # after a provided Event ID.
data/lib/workos/mfa.rb CHANGED
@@ -8,7 +8,8 @@ module WorkOS
8
8
  # MFA platform. You'll need a valid API key
9
9
  module MFA
10
10
  class << self
11
- include Client
11
+ include Client, Deprecation
12
+
12
13
  def delete_factor(id:)
13
14
  response = execute_request(
14
15
  request: delete_request(
@@ -101,7 +102,7 @@ module WorkOS
101
102
  authentication_challenge_id: nil,
102
103
  code: nil
103
104
  )
104
- warn '[DEPRECATION] `verify_factor` is deprecated. Please use `verify_challenge` instead.'
105
+ warn_deprecation '`verify_factor` is deprecated. Please use `verify_challenge` instead.'
105
106
 
106
107
  verify_challenge(
107
108
  authentication_challenge_id: authentication_challenge_id,
@@ -7,6 +7,7 @@ module WorkOS
7
7
  module Organizations
8
8
  class << self
9
9
  include Client
10
+ include Deprecation
10
11
 
11
12
  # Retrieve a list of organizations that have connections configured
12
13
  # within your WorkOS dashboard.
@@ -70,16 +71,28 @@ module WorkOS
70
71
 
71
72
  # Create an organization
72
73
  #
73
- # @param [Array<String>] domains List of domains that belong to the
74
- # organization
74
+ # @param [Array<Hash>] domain_data List of domain hashes describing an orgnaization domain.
75
+ # @option domain_data [String] domain The domain that belongs to the organization.
76
+ # @option domain_data [String] state The state of the domain. "verified" or "pending"
77
+ # @param [Array<String>] domains List of domains that belong to the organization.
78
+ # Deprecated: Use domain_data instead.
75
79
  # @param [String] name A unique, descriptive name for the organization
76
80
  # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections
77
81
  # within the Organization allow profiles that are outside of the Organization's configured User Email Domains.
78
82
  # @param [String] idempotency_key An idempotency key
79
- def create_organization(domains:, name:, allow_profiles_outside_organization: nil, idempotency_key: nil)
83
+ def create_organization(
84
+ domain_data: nil,
85
+ domains: nil,
86
+ name:,
87
+ allow_profiles_outside_organization: nil,
88
+ idempotency_key: nil
89
+ )
90
+ warn_deprecation '`domains` is deprecated. Use `domain_data` instead.' if domains
91
+
80
92
  request = post_request(
81
93
  auth: true,
82
94
  body: {
95
+ domain_data: domain_data,
83
96
  domains: domains,
84
97
  name: name,
85
98
  allow_profiles_outside_organization: allow_profiles_outside_organization,
@@ -97,12 +110,17 @@ module WorkOS
97
110
  # Update an organization
98
111
  #
99
112
  # @param [String] organization Organization unique identifier
100
- # @param [Array<String>] domains List of domains that belong to the
101
- # organization
113
+ # @param [Array<Hash>] domain_data List of domain hashes describing an orgnaization domain.
114
+ # @option domain_data [String] domain The domain that belongs to the organization.
115
+ # @option domain_data [String] state The state of the domain. "verified" or "pending"
116
+ # @param [Array<String>] domains List of domains that belong to the organization.
117
+ # Deprecated: Use domain_data instead.
102
118
  # @param [String] name A unique, descriptive name for the organization
103
119
  # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections
104
120
  # within the Organization allow profiles that are outside of the Organization's configured User Email Domains.
105
121
  def update_organization(organization:, domains:, name:, allow_profiles_outside_organization: nil)
122
+ warn_deprecation '`domains` is deprecated. Use `domain_data` instead.' if domains
123
+
106
124
  request = put_request(
107
125
  auth: true,
108
126
  body: {
data/lib/workos/sso.rb CHANGED
@@ -11,7 +11,7 @@ module WorkOS
11
11
  # @see https://docs.workos.com/sso/overview
12
12
  module SSO
13
13
  class << self
14
- include Client
14
+ include Client, Deprecation
15
15
 
16
16
  PROVIDERS = WorkOS::Types::Provider::ALL
17
17
 
@@ -65,7 +65,7 @@ module WorkOS
65
65
  state: ''
66
66
  )
67
67
  if domain
68
- warn '[DEPRECATION] `domain` is deprecated.
68
+ warn_deprecation '[DEPRECATION] `domain` is deprecated.
69
69
  Please use `organization` instead.'
70
70
  end
71
71
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '4.2.1'
4
+ VERSION = '4.4.0'
5
5
  end
data/lib/workos.rb CHANGED
@@ -49,6 +49,7 @@ module WorkOS
49
49
  autoload :Client, 'workos/client'
50
50
  autoload :Connection, 'workos/connection'
51
51
  autoload :DeprecatedHashWrapper, 'workos/deprecated_hash_wrapper'
52
+ autoload :Deprecation, 'workos/deprecation'
52
53
  autoload :Directory, 'workos/directory'
53
54
  autoload :DirectoryGroup, 'workos/directory_group'
54
55
  autoload :DirectorySync, 'workos/directory_sync'
@@ -83,5 +83,27 @@ describe WorkOS::Events do
83
83
  end
84
84
  end
85
85
  end
86
+
87
+ context 'with the organization_id option' do
88
+ it 'forms the proper request to the API' do
89
+ request_args = [
90
+ '/events?organization_id=org_1234',
91
+ 'Content-Type' => 'application/json'
92
+ ]
93
+
94
+ expected_request = Net::HTTP::Get.new(*request_args)
95
+
96
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
97
+ and_return(expected_request)
98
+
99
+ VCR.use_cassette 'events/list_events_with_organization_id' do
100
+ events = described_class.list_events(
101
+ organization_id: 'org_1234',
102
+ )
103
+
104
+ expect(events.data.size).to eq(1)
105
+ end
106
+ end
107
+ end
86
108
  end
87
109
  end
@@ -130,14 +130,19 @@ describe WorkOS::MFA do
130
130
 
131
131
  describe '.verify_factor' do
132
132
  it 'throws a warning' do
133
- expect do
134
- VCR.use_cassette 'mfa/verify_challenge_generic_valid' do
135
- described_class.verify_factor(
136
- authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J',
137
- code: '897792',
138
- )
139
- end
140
- end.to output("[DEPRECATION] `verify_factor` is deprecated. Please use `verify_challenge` instead.\n").to_stderr
133
+ VCR.use_cassette 'mfa/verify_challenge_generic_valid' do
134
+ allow(Warning).to receive(:warn)
135
+
136
+ described_class.verify_factor(
137
+ authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J',
138
+ code: '897792',
139
+ )
140
+
141
+ expect(Warning).to have_received(:warn).with(
142
+ "[DEPRECATION] `verify_factor` is deprecated. Please use `verify_challenge` instead.\n",
143
+ any_args,
144
+ )
145
+ end
141
146
  end
142
147
 
143
148
  it 'calls verify_challenge' do
@@ -18,6 +18,59 @@ describe WorkOS::Organizations do
18
18
  expect(organization.domains.first[:domain]).to eq('example.io')
19
19
  end
20
20
  end
21
+
22
+ context 'without domains' do
23
+ it 'creates an organization' do
24
+ VCR.use_cassette 'organization/create_without_domains' do
25
+ organization = described_class.create_organization(
26
+ name: 'Test Organization',
27
+ )
28
+
29
+ expect(organization.id).to start_with('org_')
30
+ expect(organization.name).to eq('Test Organization')
31
+ expect(organization.domains).to be_empty
32
+ end
33
+ end
34
+ end
35
+
36
+ context 'with domains' do
37
+ it 'creates an organization and warns' do
38
+ VCR.use_cassette 'organization/create_with_domains' do
39
+ allow(Warning).to receive(:warn)
40
+
41
+ organization = described_class.create_organization(
42
+ domains: ['example.io'],
43
+ name: 'Test Organization',
44
+ )
45
+
46
+ expect(organization.id).to start_with('org_')
47
+ expect(organization.name).to eq('Test Organization')
48
+ expect(organization.domains.first[:domain]).to eq('example.io')
49
+
50
+ expect(Warning).to have_received(:warn).with(
51
+ "[DEPRECATION] `domains` is deprecated. Use `domain_data` instead.\n",
52
+ any_args,
53
+ )
54
+ end
55
+ end
56
+ end
57
+
58
+ context 'with domain_data' do
59
+ it 'creates an organization' do
60
+ VCR.use_cassette 'organization/create_with_domain_data' do
61
+ organization = described_class.create_organization(
62
+ domain_data: [{ domain: 'example.io', state: 'verified' }],
63
+ name: 'Test Organization',
64
+ )
65
+
66
+ expect(organization.id).to start_with('org_')
67
+ expect(organization.name).to eq('Test Organization')
68
+ expect(organization.domains.first).to include(
69
+ domain: 'example.io', state: 'verified',
70
+ )
71
+ end
72
+ end
73
+ end
21
74
  end
22
75
 
23
76
  context 'with idempotency key' do
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.workos.com/events?organization_id=org_1234
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/2.7.2; arm64-darwin21; v2.3.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Thu, 14 Jul 2022 16:46:23 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '616'
31
+ Connection:
32
+ - keep-alive
33
+ Access-Control-Allow-Credentials:
34
+ - 'true'
35
+ Content-Security-Policy:
36
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
37
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
38
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
39
+ Etag:
40
+ - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw"
41
+ Expect-Ct:
42
+ - max-age=0
43
+ Referrer-Policy:
44
+ - no-referrer
45
+ Strict-Transport-Security:
46
+ - max-age=15552000; includeSubDomains
47
+ Vary:
48
+ - Origin, Accept-Encoding
49
+ Via:
50
+ - 1.1 spaces-router (b642bf20b975)
51
+ X-Content-Type-Options:
52
+ - nosniff
53
+ X-Dns-Prefetch-Control:
54
+ - 'off'
55
+ X-Download-Options:
56
+ - noopen
57
+ X-Frame-Options:
58
+ - SAMEORIGIN
59
+ X-Permitted-Cross-Domain-Policies:
60
+ - none
61
+ X-Request-Id:
62
+ - 51a82273-b413-cead-b968-c07ba4d6fd08
63
+ X-Xss-Protection:
64
+ - '0'
65
+ Cf-Cache-Status:
66
+ - DYNAMIC
67
+ Report-To:
68
+ - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"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
+ - 72abbbf2b93e8ca5-EWR
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "list_metadata":{"after":null}}'
78
+ http_version:
79
+ recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
80
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,82 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/organizations
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"domain_data":[{"domain":"example.io","state":"verified"}],"domains":null,"name":"Test
9
+ Organization","allow_profiles_outside_organization":null}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept-Encoding:
14
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
+ Accept:
16
+ - "*/*"
17
+ User-Agent:
18
+ - WorkOS; ruby/3.1.4; arm64-darwin22; v4.3.0
19
+ Authorization:
20
+ - Bearer <API_KEY>
21
+ response:
22
+ status:
23
+ code: 201
24
+ message: Created
25
+ headers:
26
+ Date:
27
+ - Tue, 30 Apr 2024 01:01:42 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Content-Length:
31
+ - '378'
32
+ Connection:
33
+ - keep-alive
34
+ Cf-Ray:
35
+ - 87c39a22cb2a7c04-LAX
36
+ Cf-Cache-Status:
37
+ - DYNAMIC
38
+ Etag:
39
+ - W/"17a-e7OoplZHJrHgxom5pCSqqpDxJjs"
40
+ Strict-Transport-Security:
41
+ - max-age=15552000; includeSubDomains
42
+ Vary:
43
+ - Origin, Accept-Encoding
44
+ Access-Control-Allow-Credentials:
45
+ - 'true'
46
+ Content-Security-Policy:
47
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
48
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
49
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
50
+ Expect-Ct:
51
+ - max-age=0
52
+ Referrer-Policy:
53
+ - no-referrer
54
+ X-Content-Type-Options:
55
+ - nosniff
56
+ X-Dns-Prefetch-Control:
57
+ - 'off'
58
+ X-Download-Options:
59
+ - noopen
60
+ X-Frame-Options:
61
+ - SAMEORIGIN
62
+ X-Permitted-Cross-Domain-Policies:
63
+ - none
64
+ X-Request-Id:
65
+ - 314446f5-ae74-4a34-a75b-4a048e295e96
66
+ X-Xss-Protection:
67
+ - '0'
68
+ Set-Cookie:
69
+ - __cf_bm=JRrIwwneHyRFvW2HY7HQeYKUAcqrygAM1Wd8iPoHBk8-1714438902-1.0.1.1-NySWD9QTWwy29v8Z1.CIWx943aVg9v1Y0Pr2e63CRHVJ8StvW7QRbW0gMe04VkNyj17genn8g3s1kVcqd4oWwQ;
70
+ path=/; expires=Tue, 30-Apr-24 01:31:42 GMT; domain=.workos.com; HttpOnly;
71
+ Secure; SameSite=None
72
+ - __cfruid=b1ea2c30a368e0f51f64c01389ed23411ab148f1-1714438902; path=/; domain=.workos.com;
73
+ HttpOnly; Secure; SameSite=None
74
+ Server:
75
+ - cloudflare
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"object":"organization","id":"org_01HWP8B4G64K6MAHZKTMVZ5RGP","name":"Test
79
+ Organization","allow_profiles_outside_organization":false,"created_at":"2024-04-30T01:01:42.277Z","updated_at":"2024-04-30T01:01:42.277Z","domains":[{"verification_strategy":"manual","state":"verified","object":"organization_domain","id":"org_domain_01HWP8B4GWBH9APRM8KPBFCNHW","domain":"example.io"}]}'
80
+ http_version:
81
+ recorded_at: Tue, 30 Apr 2024 01:01:42 GMT
82
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/organizations
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"domain_data":null,"domains":["example.io"],"name":"Test Organization","allow_profiles_outside_organization":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/3.1.4; arm64-darwin22; v4.3.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Tue, 30 Apr 2024 01:06:58 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '352'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 87c3a1dc79f82f1c-LAX
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"160-DoBiYByX9XrgXYYHDZKVF2kbtrY"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - c11d19bf-bd68-4d3e-ba59-9e2ec6f5e71f
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=1Qt0kSHHEyud3lsP.gz06VPTCcv5J35Xq1b2FudzKFk-1714439218-1.0.1.1-Pb5WXPCKuJfKXO3ri73EA_RuzaBMD.6brPkMihsQQzaC6gPRJdGiB_g3OT3eoN6km3RwF72MqD_Jlf8xb.Nb2A;
69
+ path=/; expires=Tue, 30-Apr-24 01:36:58 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=d4e3496284dd882965f61d10e392da91c73aa5c2-1714439218; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: UTF-8
77
+ string: '{"object":"organization","id":"org_01HWP8MSH28Z7SW2H6KK65S6VF","name":"Test
78
+ Organization","allow_profiles_outside_organization":false,"created_at":"2024-04-30T01:06:58.720Z","updated_at":"2024-04-30T01:06:58.720Z","domains":[{"state":"legacy_verified","object":"organization_domain","id":"org_domain_01HWP8MSHEX4KR7TJJFAFN9MK2","domain":"example.io"}]}'
79
+ http_version:
80
+ recorded_at: Tue, 30 Apr 2024 01:06:58 GMT
81
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/organizations
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"domain_data":null,"domains":null,"name":"Test Organization","allow_profiles_outside_organization":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/3.1.4; arm64-darwin22; v4.3.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Tue, 30 Apr 2024 00:58:00 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '227'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 87c394b48ef82f6f-LAX
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"e3-wm7ZLsZabhBpnQsj6nbIuYbCvJ4"
39
+ Strict-Transport-Security:
40
+ - max-age=15552000; includeSubDomains
41
+ Vary:
42
+ - Origin, Accept-Encoding
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Content-Security-Policy:
46
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
47
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
48
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
49
+ Expect-Ct:
50
+ - max-age=0
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Dns-Prefetch-Control:
56
+ - 'off'
57
+ X-Download-Options:
58
+ - noopen
59
+ X-Frame-Options:
60
+ - SAMEORIGIN
61
+ X-Permitted-Cross-Domain-Policies:
62
+ - none
63
+ X-Request-Id:
64
+ - 42653293-fec5-40f5-8e3e-f74a3a63235f
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=sr2v7XzZkDug4GaS8ZFVyNHQiFplJ1GRbehICEMbZEo-1714438680-1.0.1.1-jU4xGUlzCWlJcDjQ5PKN5v4BSetomhms7WYP1StgzZ.LO0oKDIOCW9R6CiS6BPfPB511ANRh9ricOnRoSM5x2A;
69
+ path=/; expires=Tue, 30-Apr-24 01:28:00 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=2ff6acd824f790442a69e03d7abbce5aa0842988-1714438680; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Report-To:
74
+ - '{"endpoints":[{"url":"https:\/\/csp-reporting.cloudflare.com\/cdn-cgi\/script_monitor\/report?m=MN1QYUE50Syo3whI3PgTAR0DEl89teeSttp_39ZoiJU-1714438680-1.0.1.1-7pyU.qZhlSTg4R9BBGC.xRSgae6EmLeyPE9ody07LpgLwMncwzQrnPFDhOwpi7MUiFfKAyRbUY80xGEvP_5Fzrw7a8AVy_K637dqtX8nmIuKEC.2VZJYNNRloqn4xCeFu8o6Q2luN6WANE.FKxrw0Q"}],"group":"cf-csp-endpoint","max_age":86400}'
75
+ Content-Security-Policy-Report-Only:
76
+ - script-src 'none'; connect-src 'none'; report-uri https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report?m=MN1QYUE50Syo3whI3PgTAR0DEl89teeSttp_39ZoiJU-1714438680-1.0.1.1-7pyU.qZhlSTg4R9BBGC.xRSgae6EmLeyPE9ody07LpgLwMncwzQrnPFDhOwpi7MUiFfKAyRbUY80xGEvP_5Fzrw7a8AVy_K637dqtX8nmIuKEC.2VZJYNNRloqn4xCeFu8o6Q2luN6WANE.FKxrw0Q;
77
+ report-to cf-csp-endpoint
78
+ Server:
79
+ - cloudflare
80
+ body:
81
+ encoding: UTF-8
82
+ string: '{"object":"organization","id":"org_01HWP84BDGAVGEEWB22A0CVV7G","name":"Test
83
+ Organization","allow_profiles_outside_organization":false,"created_at":"2024-04-30T00:57:59.983Z","updated_at":"2024-04-30T00:57:59.983Z","domains":[]}'
84
+ http_version:
85
+ recorded_at: Tue, 30 Apr 2024 00:58:00 GMT
86
+ 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: 4.2.1
4
+ version: 4.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-04-11 00:00:00.000000000 Z
11
+ date: 2024-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,6 +113,7 @@ files:
113
113
  - lib/workos/configuration.rb
114
114
  - lib/workos/connection.rb
115
115
  - lib/workos/deprecated_hash_wrapper.rb
116
+ - lib/workos/deprecation.rb
116
117
  - lib/workos/directory.rb
117
118
  - lib/workos/directory_group.rb
118
119
  - lib/workos/directory_sync.rb
@@ -201,6 +202,7 @@ files:
201
202
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml
202
203
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml
203
204
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml
205
+ - spec/support/fixtures/vcr_cassettes/events/list_events_with_organization_id.yml
204
206
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml
205
207
  - spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
206
208
  - spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
@@ -217,9 +219,12 @@ files:
217
219
  - spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml
218
220
  - spec/support/fixtures/vcr_cassettes/organization/create.yml
219
221
  - spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
222
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_domain_data.yml
223
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml
220
224
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml
221
225
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml
222
226
  - spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml
227
+ - spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml
223
228
  - spec/support/fixtures/vcr_cassettes/organization/delete.yml
224
229
  - spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml
225
230
  - spec/support/fixtures/vcr_cassettes/organization/get.yml
@@ -309,7 +314,7 @@ files:
309
314
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml
310
315
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml
311
316
  - spec/support/profile.txt
312
- - spec/support/shared_examples/client_spec.rb
317
+ - spec/support/shared_examples/client.rb
313
318
  - spec/support/webhook_payload.txt
314
319
  - workos.gemspec
315
320
  homepage: https://github.com/workos-inc/workos-ruby
@@ -391,6 +396,7 @@ test_files:
391
396
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml
392
397
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml
393
398
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml
399
+ - spec/support/fixtures/vcr_cassettes/events/list_events_with_organization_id.yml
394
400
  - spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml
395
401
  - spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml
396
402
  - spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml
@@ -407,9 +413,12 @@ test_files:
407
413
  - spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml
408
414
  - spec/support/fixtures/vcr_cassettes/organization/create.yml
409
415
  - spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml
416
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_domain_data.yml
417
+ - spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml
410
418
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml
411
419
  - spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml
412
420
  - spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml
421
+ - spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml
413
422
  - spec/support/fixtures/vcr_cassettes/organization/delete.yml
414
423
  - spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml
415
424
  - spec/support/fixtures/vcr_cassettes/organization/get.yml
@@ -499,5 +508,5 @@ test_files:
499
508
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml
500
509
  - spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml
501
510
  - spec/support/profile.txt
502
- - spec/support/shared_examples/client_spec.rb
511
+ - spec/support/shared_examples/client.rb
503
512
  - spec/support/webhook_payload.txt