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 +4 -4
- data/.github/workflows/main.yml +2 -0
- data/Gemfile.lock +2 -2
- data/clerk-sdk-ruby.gemspec +1 -1
- data/lib/clerk/jwks_cache.rb +1 -1
- data/lib/clerk/proxy.rb +2 -2
- data/lib/clerk/sdk.rb +0 -29
- data/lib/clerk/utils.rb +0 -6
- data/lib/clerk/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67c1fab205f71527a160495706ec916605f7c86c16d8e7d071effc1c24e5428f
|
4
|
+
data.tar.gz: 4c7eb1de1b212a276dd1a43c81ad5db81cf675afc9160f7226c14d84847c5bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9158158fd8926b24179855a3ee6ed49fd8913e00b1a67a0de6b3364265af0e66fe894f04fcb0aa8f98363f4ac2aad9a2761201cb0e4788a06d6106fd141b343
|
7
|
+
data.tar.gz: 12d99225f089afdb1276c6589b58145497ccbdb489370e0665a2b69c8292dc55efcfdcc5631dee5e00730f1a74c645a8d0f301fa439df366d0c6683a35229a0a
|
data/.github/workflows/main.yml
CHANGED
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 (
|
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.
|
48
|
+
clerk-http-client (2.0.0.beta5)
|
49
49
|
faraday (>= 1.0.1, < 3.0)
|
50
50
|
faraday-multipart
|
51
51
|
marcel
|
data/clerk-sdk-ruby.gemspec
CHANGED
@@ -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", "
|
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"
|
data/lib/clerk/jwks_cache.rb
CHANGED
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.
|
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.
|
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
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.
|
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-
|
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.
|
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.
|
59
|
+
version: 2.0.0.beta5
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: concurrent-ruby
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|