clerk-sdk-ruby 2.10.0 → 2.11.1

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: 1e9e8d21b8fb8894e6d3ad8889974bbd1580c17408b8dfc72b41f2f65d8ca580
4
- data.tar.gz: b4f2f528429bd9e0dd84b27414850dcafbe8b1f11dab09f2a86854f864a254e4
3
+ metadata.gz: 44a06343f2301fd2a975f73e9cafe69c1965c1ef8bac85ff404832e0346aa44d
4
+ data.tar.gz: eadb539cdf1de8cab247cdf3cee2c11618bdde59130098f3cab3c0813e45e1e6
5
5
  SHA512:
6
- metadata.gz: 9abe8cff4274e2c944f49dd3bf087773f23289271ae6b99d9d1190fb3e5d230269a32a78b9b7f8200cab1fde00b983078e17d83aae3dd2b8e315ed120e286489
7
- data.tar.gz: 9dba4bffa1412f0d373ecbe82b5b1e04dc1059230c3b41f33a95c7c7de674bf5e8642c35dae3dfd99242e8afd85499077e833856e9221efcbc14aff654d792e9
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.10.0)
4
+ clerk-sdk-ruby (2.11.1)
5
5
  concurrent-ruby (~> 1.1)
6
- faraday (~> 1.4.1)
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 (1.4.3)
15
- faraday-em_http (~> 1.0)
16
- faraday-em_synchrony (~> 1.0)
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-em_http (1.0.0)
23
- faraday-em_synchrony (1.0.0)
24
- faraday-excon (1.1.0)
25
- faraday-net_http (1.0.1)
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.6)
24
+ timecop (0.9.8)
33
25
 
34
26
  PLATFORMS
35
27
  arm64-darwin-22
@@ -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", "~> 1.4.1"
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.start_with?("test_") ||
207
- Clerk.configuration.api_key.start_with?("sk_test_")
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
- !development_or_staging?
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 # Inject a Faraday::Connection for testing or full control over Faraday
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
- api_key = api_key || Clerk.configuration.api_key
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clerk
4
- VERSION = "2.10.0"
4
+ VERSION = "2.11.1"
5
5
  end
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.10.0
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-04-04 00:00:00.000000000 Z
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