workos 2.15.0 → 2.17.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: 2b01746fa31764bb3e0a381ca2e3dd0bef08a39a9e80db8d5079997e2e392d36
4
- data.tar.gz: 79ec855c5da2d642a911b7896d353628e837c020a471d70824b39bb510e60d71
3
+ metadata.gz: ef5e91f45a32fca11bf7338b94c35c1c9cbc74d7193a065e2f7b4f995b40a108
4
+ data.tar.gz: 168c7c0b96de3b066845ece0fdb7c92ae37f7ba3ac8729cdc0226f22bf12442b
5
5
  SHA512:
6
- metadata.gz: 6aaee86d818a23e40de43f9f5eececdb109fe1fdbba6c4c7a50916e814976ec7a140628415c40aca4d170eb4fd3105125eb8bc4c68ea8ff695f6bb8f91baeea9
7
- data.tar.gz: c805ad7bf051ebaeb1b5ac485f710d951d5890cd9219adbf32daa3edf653d2baa8e0fb740c550d4e0be9433d7fe6fb355d4130148a66ef9e80f7f73d76bebc66
6
+ metadata.gz: 57574ab78fd8bdd0cd5e77612290c58c252b80ac7e086b7c7d60046e9688d4bf19e4ede830f4ac91f53f4400e3b25c3001322d8e83656866fece316a41c6a9ac
7
+ data.tar.gz: 7595a48e1a25602247bb684bb4d95727f8a0fdc39c27a02662f9f677335b310f980596522519e294bedabae88e460e81589c34fdf04a85bdaea544c64400f38b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (2.15.0)
4
+ workos (2.17.0)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
data/devbox.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "packages": [
3
+ "ruby@3.0.2"
4
+ ],
5
+ "shell": {
6
+ "init_hook": [
7
+ "bundle install"
8
+ ],
9
+ "scripts": {
10
+ "test": [
11
+ "bundle exec rspec"
12
+ ],
13
+ "lint": [
14
+ "bundle exec rubocop"
15
+ ]
16
+ }
17
+ }
18
+ }
data/devbox.lock ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "lockfile_version": "1",
3
+ "packages": {
4
+ "ruby@3.0.2": {
5
+ "last_modified": "2021-11-01T15:39:33Z",
6
+ "plugin_version": "0.0.1",
7
+ "resolved": "github:NixOS/nixpkgs/7053541084bf5ce2921ef307e5585d39d7ba8b3f#ruby_3_0",
8
+ "version": "3.0.2"
9
+ }
10
+ }
11
+ }
data/lib/workos/client.rb CHANGED
@@ -9,7 +9,7 @@ module WorkOS
9
9
 
10
10
  sig { returns(Net::HTTP) }
11
11
  def client
12
- Net::HTTP.new(WorkOS::API_HOSTNAME, 443).tap do |http_client|
12
+ Net::HTTP.new(WorkOS.config.api_hostname, 443).tap do |http_client|
13
13
  http_client.use_ssl = true
14
14
  http_client.open_timeout = WorkOS.config.timeout
15
15
  http_client.read_timeout = WorkOS.config.timeout
@@ -4,7 +4,7 @@
4
4
  module WorkOS
5
5
  # Configuration class sets config initializer
6
6
  class Configuration
7
- attr_accessor :timeout, :key
7
+ attr_accessor :api_hostname, :timeout, :key
8
8
 
9
9
  def initialize
10
10
  @timeout = 60
data/lib/workos/events.rb CHANGED
@@ -44,7 +44,7 @@ module WorkOS
44
44
 
45
45
  WorkOS::Types::ListStruct.new(
46
46
  data: events,
47
- list_metadata: parsed_response['listMetadata'],
47
+ list_metadata: parsed_response['list_metadata'],
48
48
  )
49
49
  end
50
50
  end
data/lib/workos/sso.rb CHANGED
@@ -104,7 +104,7 @@ module WorkOS
104
104
  organization: organization,
105
105
  }.compact)
106
106
 
107
- "https://#{WorkOS::API_HOSTNAME}/sso/authorize?#{query}"
107
+ "https://#{WorkOS.config.api_hostname}/sso/authorize?#{query}"
108
108
  end
109
109
  # rubocop:enable Metrics/ParameterLists
110
110
 
@@ -7,6 +7,7 @@ module WorkOS
7
7
  # fixed set of values for SSO Providers.
8
8
  class Provider < T::Enum
9
9
  enums do
10
+ GitHub = new('GitHubOAuth')
10
11
  Google = new('GoogleOAuth')
11
12
  Microsoft = new('MicrosoftOAuth')
12
13
  end
@@ -2,5 +2,5 @@
2
2
  # typed: strong
3
3
 
4
4
  module WorkOS
5
- VERSION = '2.15.0'
5
+ VERSION = '2.17.0'
6
6
  end
data/lib/workos.rb CHANGED
@@ -11,10 +11,25 @@ require 'workos/configuration'
11
11
  # requests to the WorkOS API. The gem will read
12
12
  # your API key automatically from the ENV var `WORKOS_API_KEY`.
13
13
  # Alternatively, you can set the key yourself with
14
- # `WorkOS.key = [your api key]` somewhere in the load path of
15
- # your application, such as an initializer.
14
+ # `WorkOS.configure { |config| config.key = [your api key] }` somewhere
15
+ # in the load path of your application, such as an initializer.
16
16
  module WorkOS
17
- API_HOSTNAME = ENV['WORKOS_API_HOSTNAME'] || 'api.workos.com'
17
+ def self.default_config
18
+ Configuration.new.tap do |config|
19
+ config.api_hostname = ENV['WORKOS_API_HOSTNAME'] || 'api.workos.com'
20
+ # Remove WORKOS_KEY at some point in the future. Keeping it here now for
21
+ # backwards compatibility.
22
+ config.key = ENV['WORKOS_API_KEY'] || ENV['WORKOS_KEY']
23
+ end
24
+ end
25
+
26
+ def self.config
27
+ @config ||= default_config
28
+ end
29
+
30
+ def self.configure
31
+ yield(config)
32
+ end
18
33
 
19
34
  def self.key=(value)
20
35
  warn '`WorkOS.key=` is deprecated. Use `WorkOS.configure` instead.'
@@ -28,14 +43,6 @@ module WorkOS
28
43
  config.key
29
44
  end
30
45
 
31
- def self.config
32
- @config ||= Configuration.new
33
- end
34
-
35
- def self.configure
36
- yield(config)
37
- end
38
-
39
46
  autoload :Types, 'workos/types'
40
47
  autoload :Client, 'workos/client'
41
48
  autoload :Configuration, 'workos/configuration'
@@ -71,9 +78,4 @@ module WorkOS
71
78
  autoload :InvalidRequestError, 'workos/errors'
72
79
  autoload :SignatureVerificationError, 'workos/errors'
73
80
  autoload :TimeoutError, 'workos/errors'
74
-
75
- # Remove WORKOS_KEY at some point in the future. Keeping it here now for
76
- # backwards compatibility.
77
- key = ENV['WORKOS_API_KEY'] || ENV['WORKOS_KEY']
78
- config.key = key unless key.nil?
79
81
  end
@@ -26,7 +26,7 @@ describe WorkOS::SSO do
26
26
  it 'returns the expected hostname' do
27
27
  authorization_url = described_class.authorization_url(**args)
28
28
 
29
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
29
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
30
30
  end
31
31
 
32
32
  it 'returns the expected query string' do
@@ -60,7 +60,7 @@ describe WorkOS::SSO do
60
60
  it 'returns the expected hostname' do
61
61
  authorization_url = described_class.authorization_url(**args)
62
62
 
63
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
63
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
64
64
  end
65
65
 
66
66
  it 'returns the expected query string' do
@@ -94,7 +94,7 @@ describe WorkOS::SSO do
94
94
  it 'returns the expected hostname' do
95
95
  authorization_url = described_class.authorization_url(**args)
96
96
 
97
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
97
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
98
98
  end
99
99
 
100
100
  it 'returns the expected query string' do
@@ -128,7 +128,7 @@ describe WorkOS::SSO do
128
128
  it 'returns the expected hostname' do
129
129
  authorization_url = described_class.authorization_url(**args)
130
130
 
131
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
131
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
132
132
  end
133
133
 
134
134
  it 'returns the expected query string' do
@@ -163,7 +163,7 @@ describe WorkOS::SSO do
163
163
  it 'returns the expected hostname' do
164
164
  authorization_url = described_class.authorization_url(**args)
165
165
 
166
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
166
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
167
167
  end
168
168
 
169
169
  it 'returns the expected query string' do
@@ -198,7 +198,7 @@ describe WorkOS::SSO do
198
198
  it 'returns the expected hostname' do
199
199
  authorization_url = described_class.authorization_url(**args)
200
200
 
201
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
201
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
202
202
  end
203
203
 
204
204
  it 'returns the expected query string' do
@@ -232,7 +232,7 @@ describe WorkOS::SSO do
232
232
  it 'returns the expected hostname' do
233
233
  authorization_url = described_class.authorization_url(**args)
234
234
 
235
- expect(URI.parse(authorization_url).host).to eq(WorkOS::API_HOSTNAME)
235
+ expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname)
236
236
  end
237
237
 
238
238
  it 'returns the expected query string' do
@@ -282,7 +282,7 @@ describe WorkOS::SSO do
282
282
  described_class.authorization_url(**args)
283
283
  end.to raise_error(
284
284
  ArgumentError,
285
- 'Okta is not a valid value. `provider` must be in ["GoogleOAuth", "MicrosoftOAuth"]',
285
+ 'Okta is not a valid value. `provider` must be in ["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]',
286
286
  )
287
287
  end
288
288
  end
@@ -74,7 +74,7 @@ http_interactions:
74
74
  - 72abbbf2b93e8ca5-EWR
75
75
  body:
76
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"}}], "listMetadata":{"after":null}}'
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
78
  http_version:
79
79
  recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
80
80
  recorded_with: VCR 5.0.0
@@ -74,7 +74,7 @@ http_interactions:
74
74
  - 72abbbf2b93e8ca5-EWR
75
75
  body:
76
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"}}], "listMetadata":{"after":null}}'
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
78
  http_version:
79
79
  recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
80
80
  recorded_with: VCR 5.0.0
@@ -74,7 +74,7 @@ http_interactions:
74
74
  - 72abbbf2b93e8ca5-EWR
75
75
  body:
76
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"}}], "listMetadata":{"after":null}}'
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
78
  http_version:
79
79
  recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
80
80
  recorded_with: VCR 5.0.0
@@ -74,7 +74,7 @@ http_interactions:
74
74
  - 72abbbf2b93e8ca5-EWR
75
75
  body:
76
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"}}], "listMetadata":{"after":null}}'
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
78
  http_version:
79
79
  recorded_at: Thu, 14 Jul 2022 16:46:23 GMT
80
80
  recorded_with: VCR 5.0.0
data/workos.gemspec CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
18
18
  }
19
19
 
20
20
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
21
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
22
  spec.require_paths = ['lib']
24
23
 
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: 2.15.0
4
+ version: 2.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2023-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -153,12 +153,7 @@ dependencies:
153
153
  description: API client for WorkOS
154
154
  email:
155
155
  - support@workos.com
156
- executables:
157
- - build
158
- - console
159
- - docs
160
- - publish
161
- - tapioca
156
+ executables: []
162
157
  extensions: []
163
158
  extra_rdoc_files: []
164
159
  files:
@@ -181,6 +176,8 @@ files:
181
176
  - bin/publish
182
177
  - bin/tapioca
183
178
  - codecov.yml
179
+ - devbox.json
180
+ - devbox.lock
184
181
  - docs/WorkOS.html
185
182
  - docs/WorkOS/APIError.html
186
183
  - docs/WorkOS/AuditLog.html
@@ -421,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
418
  - !ruby/object:Gem::Version
422
419
  version: '0'
423
420
  requirements: []
424
- rubygems_version: 3.4.14
421
+ rubygems_version: 3.4.22
425
422
  signing_key:
426
423
  specification_version: 4
427
424
  summary: API client for WorkOS