clerk-sdk-ruby 2.10.0 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +11 -19
- data/clerk-sdk-ruby.gemspec +1 -1
- data/lib/clerk/rack_middleware_v2.rb +6 -3
- data/lib/clerk/sdk.rb +9 -2
- data/lib/clerk/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44a06343f2301fd2a975f73e9cafe69c1965c1ef8bac85ff404832e0346aa44d
|
4
|
+
data.tar.gz: eadb539cdf1de8cab247cdf3cee2c11618bdde59130098f3cab3c0813e45e1e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba62a865518047cf7a8b6c25881bdded00463d2ea6150cc71749dc72892b13c88022cf9081e61805654bbcf99a06907dad6afc0deb9dc9ee08291e7e495c9f47
|
7
|
+
data.tar.gz: fe68ea6c686db7651e38a99d6369afdf7fb8b7f1ef1a65d2e671c5f75276cd4731ee35ff406f77e31311b43ad606ce8d9aaa4064463d1b7e4087a35713207b90
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## unreleased
|
2
2
|
|
3
|
+
## 2.11.1 - 2023-10-31
|
4
|
+
|
5
|
+
- fix: Properly set Clerk API key (secret) when using Faraday v2 [https://github.com/clerkinc/clerk-sdk-ruby/pull/37]
|
6
|
+
|
7
|
+
## 2.11.0 - 2023-10-27
|
8
|
+
|
9
|
+
- feat: Added support for Faraday v2 [https://github.com/clerkinc/clerk-sdk-ruby/pull/37]
|
10
|
+
|
3
11
|
## 2.10.0 - 2023-04-04
|
4
12
|
|
5
13
|
Identical to 2.10.0.beta2
|
data/Gemfile.lock
CHANGED
@@ -1,35 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clerk-sdk-ruby (2.
|
4
|
+
clerk-sdk-ruby (2.11.1)
|
5
5
|
concurrent-ruby (~> 1.1)
|
6
|
-
faraday (
|
6
|
+
faraday (>= 1.4.1, < 3.0)
|
7
7
|
jwt (~> 2.5)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
+
base64 (0.1.1)
|
12
13
|
byebug (11.1.3)
|
13
14
|
concurrent-ruby (1.2.2)
|
14
|
-
faraday (
|
15
|
-
|
16
|
-
faraday-
|
17
|
-
faraday-excon (~> 1.1)
|
18
|
-
faraday-net_http (~> 1.0)
|
19
|
-
faraday-net_http_persistent (~> 1.1)
|
20
|
-
multipart-post (>= 1.2, < 3)
|
15
|
+
faraday (2.7.11)
|
16
|
+
base64
|
17
|
+
faraday-net_http (>= 2.0, < 3.1)
|
21
18
|
ruby2_keywords (>= 0.0.4)
|
22
|
-
faraday-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
faraday-net_http_persistent (1.2.0)
|
27
|
-
jwt (2.7.0)
|
28
|
-
minitest (5.18.0)
|
29
|
-
multipart-post (2.3.0)
|
30
|
-
rake (13.0.6)
|
19
|
+
faraday-net_http (3.0.2)
|
20
|
+
jwt (2.7.1)
|
21
|
+
minitest (5.20.0)
|
22
|
+
rake (13.1.0)
|
31
23
|
ruby2_keywords (0.0.5)
|
32
|
-
timecop (0.9.
|
24
|
+
timecop (0.9.8)
|
33
25
|
|
34
26
|
PLATFORMS
|
35
27
|
arm64-darwin-22
|
data/clerk-sdk-ruby.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_dependency "faraday", "
|
30
|
+
spec.add_dependency "faraday", ">= 1.4.1", "< 3.0"
|
31
31
|
spec.add_dependency "jwt", '~> 2.5'
|
32
32
|
spec.add_dependency "concurrent-ruby", "~> 1.1"
|
33
33
|
|
@@ -203,12 +203,15 @@ module Clerk
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def development_or_staging?
|
206
|
-
Clerk.configuration.api_key
|
207
|
-
|
206
|
+
Clerk.configuration.api_key &&
|
207
|
+
(Clerk.configuration.api_key.start_with?("test_") ||
|
208
|
+
Clerk.configuration.api_key.start_with?("sk_test_"))
|
208
209
|
end
|
209
210
|
|
210
211
|
def production?
|
211
|
-
|
212
|
+
Clerk.configuration.api_key &&
|
213
|
+
(Clerk.configuration.api_key.start_with?("live_") ||
|
214
|
+
Clerk.configuration.api_key.start_with?("sk_live_"))
|
212
215
|
end
|
213
216
|
|
214
217
|
def cross_origin_request?(req)
|
data/lib/clerk/sdk.rb
CHANGED
@@ -40,7 +40,8 @@ module Clerk
|
|
40
40
|
|
41
41
|
def initialize(api_key: nil, base_url: nil, logger: nil, ssl_verify: true,
|
42
42
|
connection: nil)
|
43
|
-
if connection
|
43
|
+
if connection
|
44
|
+
# Inject a Faraday::Connection for testing or full control over Faraday
|
44
45
|
@conn = connection
|
45
46
|
return
|
46
47
|
else
|
@@ -50,7 +51,13 @@ module Clerk
|
|
50
51
|
else
|
51
52
|
URI(base_url)
|
52
53
|
end
|
53
|
-
|
54
|
+
|
55
|
+
api_key ||= Clerk.configuration.api_key
|
56
|
+
|
57
|
+
if Faraday::VERSION.to_i >= 2 && api_key.nil?
|
58
|
+
api_key = -> { raise ArgumentError, "Clerk secret key is not set" }
|
59
|
+
end
|
60
|
+
|
54
61
|
logger = logger || Clerk.configuration.logger
|
55
62
|
@conn = Faraday.new(
|
56
63
|
url: base_uri, headers: DEFAULT_HEADERS, ssl: {verify: ssl_verify}
|
data/lib/clerk/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clerk-sdk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clerk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.4.1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 1.4.1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: jwt
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|