workos 2.16.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/workos/client.rb +1 -1
- data/lib/workos/configuration.rb +1 -1
- data/lib/workos/sso.rb +1 -1
- data/lib/workos/types/provider_enum.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +18 -16
- data/spec/lib/workos/sso_spec.rb +8 -8
- data/workos.gemspec +0 -1
- metadata +4 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef5e91f45a32fca11bf7338b94c35c1c9cbc74d7193a065e2f7b4f995b40a108
|
4
|
+
data.tar.gz: 168c7c0b96de3b066845ece0fdb7c92ae37f7ba3ac8729cdc0226f22bf12442b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57574ab78fd8bdd0cd5e77612290c58c252b80ac7e086b7c7d60046e9688d4bf19e4ede830f4ac91f53f4400e3b25c3001322d8e83656866fece316a41c6a9ac
|
7
|
+
data.tar.gz: 7595a48e1a25602247bb684bb4d95727f8a0fdc39c27a02662f9f677335b310f980596522519e294bedabae88e460e81589c34fdf04a85bdaea544c64400f38b
|
data/Gemfile.lock
CHANGED
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
|
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
|
data/lib/workos/configuration.rb
CHANGED
data/lib/workos/sso.rb
CHANGED
data/lib/workos/version.rb
CHANGED
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
|
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
|
-
|
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
|
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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.
|
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-
|
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:
|
@@ -423,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
423
418
|
- !ruby/object:Gem::Version
|
424
419
|
version: '0'
|
425
420
|
requirements: []
|
426
|
-
rubygems_version: 3.4.
|
421
|
+
rubygems_version: 3.4.22
|
427
422
|
signing_key:
|
428
423
|
specification_version: 4
|
429
424
|
summary: API client for WorkOS
|