clerk-sdk-ruby 4.0.0.beta4 → 4.0.0.beta5

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: 37d37c25f76ef78179a59083af8a754d1dbdff353d858cda3ba08ae679497ff8
4
- data.tar.gz: f3d5676522601c297a8a7ba997bb73072aefe5cb387ab0a8e836d991421f61ee
3
+ metadata.gz: 67c1fab205f71527a160495706ec916605f7c86c16d8e7d071effc1c24e5428f
4
+ data.tar.gz: 4c7eb1de1b212a276dd1a43c81ad5db81cf675afc9160f7226c14d84847c5bb1
5
5
  SHA512:
6
- metadata.gz: 96891456fd52907105030582cb772c28f07a3ca24d16ddd666277df514652314cdaa3ba54ee14e99466789aea996dad74df884ca2a9c0ff6d7ff42d5ad22a404
7
- data.tar.gz: 4512bbdb1d3e6e787adb7fd7dfa39967fef73d6e742fcf0ca5c87f58016e5ed5ed25c3fd32c24dc24997644b388da33ca6da7e1ed028cb61040dec60210bd43c
6
+ metadata.gz: e9158158fd8926b24179855a3ee6ed49fd8913e00b1a67a0de6b3364265af0e66fe894f04fcb0aa8f98363f4ac2aad9a2761201cb0e4788a06d6106fd141b343
7
+ data.tar.gz: 12d99225f089afdb1276c6589b58145497ccbdb489370e0665a2b69c8292dc55efcfdcc5631dee5e00730f1a74c645a8d0f301fa439df366d0c6683a35229a0a
@@ -20,6 +20,8 @@ jobs:
20
20
 
21
21
  - name: Set up Ruby
22
22
  uses: ruby/setup-ruby@v1
23
+ env:
24
+ BUNDLE_FROZEN: false
23
25
  with:
24
26
  ruby-version: ${{ matrix.ruby }}
25
27
  bundler-cache: true
data/Gemfile.lock CHANGED
@@ -2,7 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  clerk-sdk-ruby (4.0.0.beta4)
5
- clerk-http-client (~> 0.0.1)
5
+ clerk-http-client (= 2.0.0.beta5)
6
6
  concurrent-ruby (~> 1.1)
7
7
  faraday (>= 1.4.1, < 3.0)
8
8
  jwt (~> 2.5)
@@ -45,7 +45,7 @@ GEM
45
45
  bigdecimal (3.1.9)
46
46
  builder (3.3.0)
47
47
  byebug (11.1.3)
48
- clerk-http-client (0.0.1)
48
+ clerk-http-client (2.0.0.beta5)
49
49
  faraday (>= 1.0.1, < 3.0)
50
50
  faraday-multipart
51
51
  marcel
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency "faraday", ">= 1.4.1", "< 3.0"
31
31
  spec.add_dependency "jwt", '~> 2.5'
32
- spec.add_dependency "clerk-http-client", "~> 0.0.1"
32
+ spec.add_dependency "clerk-http-client", "2.0.0.beta5"
33
33
  spec.add_dependency "concurrent-ruby", "~> 1.1"
34
34
 
35
35
  spec.add_development_dependency "byebug", "~> 11.1"
@@ -22,7 +22,7 @@ module Clerk
22
22
  @lock.with_write_lock do
23
23
  @last_update = Time.now.to_i
24
24
  @jwks = begin
25
- sdk.jwks.get.keys.map(&:to_hash)
25
+ sdk.jwks.get_jwks.keys.map(&:to_hash)
26
26
  rescue Clerk::Error, ClerkHttpClient::ApiError
27
27
  nil
28
28
  end
data/lib/clerk/proxy.rb CHANGED
@@ -108,13 +108,13 @@ module Clerk
108
108
 
109
109
  def fetch_user(user_id)
110
110
  cached_fetch("clerk:user:#{user_id}") do
111
- sdk.users.find(user_id)
111
+ sdk.users.get_user(user_id)
112
112
  end
113
113
  end
114
114
 
115
115
  def fetch_org(org_id)
116
116
  cached_fetch("clerk:org:#{org_id}") do
117
- sdk.organizations.find(org_id)
117
+ sdk.organizations.get_organization(org_id)
118
118
  end
119
119
  end
120
120
 
data/lib/clerk/sdk.rb CHANGED
@@ -43,34 +43,5 @@ module Clerk
43
43
 
44
44
  JWT.decode(token, nil, true, algorithms: algorithms, exp_leeway: timeout, jwks: jwk_loader).first
45
45
  end
46
-
47
- private
48
-
49
- # TODO: Temporary solution until generators are improved
50
- HTTP_CLIENT_CUSTOM_MAPPING = {
51
- allowlist: "AllowListBlockList",
52
- blocklist: "AllowListBlockList",
53
- email_sms_templates: "EmailSMSTemplates",
54
- oauth_applications: "OAuthApplications",
55
- jwt_templates: "JWTTemplates",
56
- redirect_urls: "RedirectURLs",
57
- saml_connections: "SAMLConnections"
58
- }
59
-
60
- def generate_const_name(method_name)
61
- "#{HTTP_CLIENT_CUSTOM_MAPPING[method_name] || Utils.camel_case(method_name)}Api"
62
- end
63
-
64
- def respond_to_missing?(method_name, include_private = false)
65
- ClerkHttpClient.const_get(generate_const_name(method_name)).respond_to?(:new)
66
- rescue NameError
67
- false
68
- end
69
-
70
- def method_missing(method_name, *arguments)
71
- ClerkHttpClient.const_get(generate_const_name(method_name)).new
72
- rescue NameError
73
- raise NoMethodError, "undefined method `#{method_name}` for #{self.class.name}"
74
- end
75
46
  end
76
47
  end
data/lib/clerk/utils.rb CHANGED
@@ -5,12 +5,6 @@ require "base64"
5
5
  module Clerk
6
6
  module Utils
7
7
  class << self
8
- def camel_case(str)
9
- str = str.to_s
10
- return str if str !~ /_/ && str =~ /[A-Z]+.*/
11
- str.split("_").map { |s| s.capitalize }.join
12
- end
13
-
14
8
  def decode_publishable_key(publishable_key)
15
9
  Base64.decode64(publishable_key.split("_")[2].to_s)
16
10
  end
data/lib/clerk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clerk
4
- VERSION = "4.0.0.beta4"
4
+ VERSION = "4.0.0.beta5"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clerk-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta4
4
+ version: 4.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clerk
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-06 00:00:00.000000000 Z
10
+ date: 2025-01-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: faraday
@@ -47,16 +47,16 @@ dependencies:
47
47
  name: clerk-http-client
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - "~>"
50
+ - - '='
51
51
  - !ruby/object:Gem::Version
52
- version: 0.0.1
52
+ version: 2.0.0.beta5
53
53
  type: :runtime
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - '='
58
58
  - !ruby/object:Gem::Version
59
- version: 0.0.1
59
+ version: 2.0.0.beta5
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: concurrent-ruby
62
62
  requirement: !ruby/object:Gem::Requirement