supabase-auth 0.1.0 → 0.1.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 +4 -4
- data/lib/supabase/auth/client.rb +8 -6
- data/lib/supabase/auth/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b4f7cdcf0814c8ebe968554adfc4d142691b864b3813d58d0ad78c07d100bda
|
|
4
|
+
data.tar.gz: 4051b6ea710ac669ed1c0a94c45c31d29e0e9469c3d580e8496d6f4144af3a06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cebe4dde4a57246f1b5d05541aca98286b118f6f56a161776b1d433cb97818bf45307ed629b902ef497cc4f8c78412784b7a289b94654df8bdc58babea7cec7b
|
|
7
|
+
data.tar.gz: bfdd074a5f2a876308ea01240dc32a152e9955da9eae370b1c8d1cb4ddbaa07bd70814d58c88513f1edb3f48a3049b1be509b9d0d8810d97728344d5913b2e8d
|
data/lib/supabase/auth/client.rb
CHANGED
|
@@ -681,15 +681,17 @@ module Supabase
|
|
|
681
681
|
return Types::ClaimsResponse.new(claims: payload, headers: header, signature: signature)
|
|
682
682
|
end
|
|
683
683
|
|
|
684
|
-
# Asymmetric JWT - verify via JWKS
|
|
684
|
+
# Asymmetric JWT - verify via JWKS using the jwt gem's decode
|
|
685
685
|
jwk_data = _fetch_jwks(header["kid"], jwks || { "keys" => [] })
|
|
686
|
-
|
|
686
|
+
jwk_set = JWT::JWK::Set.new({ "keys" => [jwk_data] })
|
|
687
687
|
|
|
688
|
-
|
|
689
|
-
raise Errors::AuthInvalidJwtError, "Unsupported algorithm: #{header["alg"]}" unless digest
|
|
688
|
+
raise Errors::AuthInvalidJwtError, "Unsupported algorithm: #{header["alg"]}" unless ALG_TO_DIGEST[header["alg"]]
|
|
690
689
|
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
begin
|
|
691
|
+
JWT.decode(token, nil, true, { algorithms: [header["alg"]], jwks: jwk_set })
|
|
692
|
+
rescue JWT::DecodeError => e
|
|
693
|
+
raise Errors::AuthInvalidJwtError, "Invalid JWT signature: #{e.message}"
|
|
694
|
+
end
|
|
693
695
|
|
|
694
696
|
Types::ClaimsResponse.new(claims: payload, headers: header, signature: signature)
|
|
695
697
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: supabase-auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bogdan Tarasenko
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -137,7 +136,6 @@ metadata:
|
|
|
137
136
|
homepage_uri: https://github.com/bogdantarasenko/supabase-rb
|
|
138
137
|
source_code_uri: https://github.com/bogdantarasenko/supabase-rb
|
|
139
138
|
changelog_uri: https://github.com/bogdantarasenko/supabase-rb/blob/main/CHANGELOG.md
|
|
140
|
-
post_install_message:
|
|
141
139
|
rdoc_options: []
|
|
142
140
|
require_paths:
|
|
143
141
|
- lib
|
|
@@ -152,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
152
150
|
- !ruby/object:Gem::Version
|
|
153
151
|
version: '0'
|
|
154
152
|
requirements: []
|
|
155
|
-
rubygems_version: 3.
|
|
156
|
-
signing_key:
|
|
153
|
+
rubygems_version: 3.6.9
|
|
157
154
|
specification_version: 4
|
|
158
155
|
summary: Ruby client for Supabase Auth (GoTrue API)
|
|
159
156
|
test_files: []
|