clerk-sdk-ruby 2.10.0.beta2 → 2.11.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: 7a9cc4880855663a951169e9f5898ec94e3693b048e86c84feae5dbfd4aa1318
4
- data.tar.gz: 19883dc888a73800890edcf438443fc3ceb529c971829b3b079b884933136417
3
+ metadata.gz: 34c7beec3b3a8d96bb7d508099daf4778d4718e9a4d3b6d84bcf31544f7ff1fb
4
+ data.tar.gz: 773eae9d2547ad936e7543dae38b9453a07bf44b23f4bfe593b03df2048ea515
5
5
  SHA512:
6
- metadata.gz: e3f51660a5c2e56cffb7e681ddf31b5155d37ed5cd87a85f93be09b39493ee9e82eb7f0cb12fb19089119f296fb58cfdbc43392e6034da0298cfdce60957df86
7
- data.tar.gz: c236853329fb8c0ac1d62b9324dda4daab54d4de034b639ea9dc8425440ae3bb30e29c0e795dd1621a3d805801e35744d45943372ec32b39acff842702152428
6
+ metadata.gz: 35eeca356c4f4cf3d40760a98780606c4e933375fbdbb736fc2dea2a089dfe2b75c0d88a99d5773afd49b85e8af3192db2f197203685a61ed43811e28227e90e
7
+ data.tar.gz: f82372393ddadea3a6aa5848558816a081b34f4ef6be0231bf3cd71648ce19d55b43b0b221544304fde2393fccae45eb763c9c931106965cac66cf286cec3ead
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## unreleased
2
2
 
3
+ ## 2.11.0 - 2023-10-27
4
+
5
+ - feat: Added support for Faraday v2 [https://github.com/clerkinc/clerk-sdk-ruby/pull/37]
6
+
7
+ ## 2.10.0 - 2023-04-04
8
+
9
+ Identical to 2.10.0.beta2
10
+
3
11
  ## 2.10.0.beta2 - 2023-03-08
4
12
 
5
13
  - fix: incorrect usage keyword parameter (fix for 2.10.0.beta1)
@@ -54,7 +62,7 @@ Identical to 2.9.0.beta3
54
62
 
55
63
  ## 2.2.0 - 2022-08-26
56
64
 
57
- - feat: Add support for the [users.create](https://reference.clerk.dev/reference/backend-api-reference/users#create-a-user) endpoint
65
+ - feat: Add support for the [users.create](https://clerk.com/docs/reference/backend-api/tag/Users#operation/CreateUser) endpoint
58
66
 
59
67
  ## 2.1.2 - 2022-08-26
60
68
 
@@ -67,15 +75,15 @@ Identical to 2.9.0.beta3
67
75
  ## 2.0.0 - 2021-10-21
68
76
 
69
77
  This release introduces the new networkless middleware which works with the new
70
- authentication scheme, [Auth v2](https://docs.clerk.dev/main-concepts/auth-v2).
78
+ authentication scheme, [Auth v2](https://clerk.com/docs/upgrade-guides/auth-v2).
71
79
 
72
80
  It is backwards-incompatible with applications using Auth v1.
73
81
 
74
82
  - [BREAKING]: In order to use this version, you must set the authVersion prop
75
83
  accordingly in your frontend: `Clerk.load({authVersion: 2})`
76
84
 
77
- For more information on Auth v2, please refer to
78
- https://docs.clerk.dev/main-concepts/auth-v2.
85
+ For more information on Auth v2, please refer to
86
+ https://clerk.com/docs/upgrade-guides/auth-v2.
79
87
 
80
88
  ## 1.0.3 - 2021-07-21
81
89
 
data/Gemfile.lock CHANGED
@@ -1,35 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clerk-sdk-ruby (2.10.0.beta2)
4
+ clerk-sdk-ruby (2.10.0)
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)
19
+ faraday-net_http (3.0.2)
20
+ jwt (2.7.1)
21
+ minitest (5.20.0)
30
22
  rake (13.0.6)
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
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://www.clerk.dev/?utm_source=github&utm_medium=starter_repos&utm_campaign=sdk_ruby" target="_blank" align="center">
2
+ <a href="https://www.clerk.com/?utm_source=github&utm_medium=starter_repos&utm_campaign=sdk_ruby" target="_blank" align="center">
3
3
  <picture>
4
4
  <source media="(prefers-color-scheme: dark)" srcset="./docs/clerk-logo-dark.png">
5
5
  <img src="./docs/clerk-logo-light.png" height="64">
@@ -10,10 +10,10 @@
10
10
 
11
11
  # Clerk Ruby SDK
12
12
 
13
- This SDK allows you to call the [Clerk](https://www.clerk.dev/?utm_source=github&utm_medium=starter_repos&utm_campaign=sdk_ruby) Backend API from Ruby code without having to implement the calls yourself.
13
+ This SDK allows you to call the [Clerk](https://www.clerk.com/?utm_source=github&utm_medium=starter_repos&utm_campaign=sdk_ruby) Backend API from Ruby code without having to implement the calls yourself.
14
14
 
15
15
  [![chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://discord.com/invite/b5rXHjAg7A)
16
- [![documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://docs.clerk.dev)
16
+ [![documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs)
17
17
  [![twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)
18
18
 
19
19
  ---
@@ -25,7 +25,7 @@ Would you like to work on Open Source software and help maintain this repository
25
25
  ---
26
26
 
27
27
  **Note**: You're looking at the main branch, which requires that you use [Auth
28
- v2](https://clerk.dev/docs/upgrade-guides/auth-v2).
28
+ v2](https://clerk.com/docs/upgrade-guides/auth-v2).
29
29
 
30
30
  If you're looking for the legacy authentication scheme, refer to the
31
31
  [`v1`](https://github.com/clerkinc/clerk-sdk-ruby/tree/v1) branch.
@@ -49,10 +49,10 @@ Or install it yourself as:
49
49
  ## Quick Start
50
50
 
51
51
  First, you need to get an API key for a Clerk instance. This is done via the
52
- [Clerk dashboard](https://dashboard.clerk.dev/applications).
52
+ [Clerk dashboard](https://dashboard.clerk.com/applications).
53
53
 
54
54
  Then you can instantiate a `Clerk::SDK` instance and access all
55
- [Backend API](https://docs.clerk.dev/backend/backend-api-reference) endpoints.
55
+ [Backend API](https://clerk.com/docs/reference/backend-api) endpoints.
56
56
  Here's a quick example:
57
57
 
58
58
  ```ruby
@@ -156,7 +156,7 @@ API then responds with JSON which is then converted and returned as a Ruby
156
156
  `Hash`, or `Array` of hashes. Errors are also returned as a JSON object, with a
157
157
  single key (`errors`) containing an array of error objects.
158
158
 
159
- Read the [API documentation](https://docs.clerk.dev/backend/backend-api-reference)
159
+ Read the [API documentation](https://clerk.com/docs/reference/backend-api)
160
160
  for details on expected parameters and response formats.
161
161
 
162
162
  ## Development
@@ -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
 
@@ -24,7 +24,7 @@ module Clerk
24
24
  # which already contains the verified claims as retrieved from the session
25
25
  # token.
26
26
  #
27
- # See https://docs.clerk.dev/reference/backend-api-reference/sessions#verify-a-session
27
+ # See https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/VerifySession
28
28
  def clerk_reverify_session!
29
29
  request.env["clerk"].verify_session
30
30
  end
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 ||= if Faraday::VERSION.to_i < 2
56
+ Clerk.configuration.api_key
57
+ elsif Clerk.configuration.api_key.nil?
58
+ -> { 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.beta2"
4
+ VERSION = "2.11.0"
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.beta2
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clerk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2023-10-27 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
@@ -143,11 +149,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
149
  version: 2.4.0
144
150
  required_rubygems_version: !ruby/object:Gem::Requirement
145
151
  requirements:
146
- - - ">"
152
+ - - ">="
147
153
  - !ruby/object:Gem::Version
148
- version: 1.3.1
154
+ version: '0'
149
155
  requirements: []
150
- rubygems_version: 3.2.3
156
+ rubygems_version: 3.3.7
151
157
  signing_key:
152
158
  specification_version: 4
153
159
  summary: Clerk SDK for Ruby.