firebase_token_auth 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/README.md +1 -1
- data/firebase_token_auth.gemspec +1 -1
- data/lib/firebase_token_auth/client.rb +1 -0
- data/lib/firebase_token_auth/configuration.rb +2 -0
- data/lib/firebase_token_auth/public_key_manager.rb +1 -1
- data/lib/firebase_token_auth/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96a4c3041301e5af29e38a8a70454e2628c9edf5e7ad936d910790ca40613ce
|
4
|
+
data.tar.gz: 18827a9a5f2ea0826dd9981b524e1836c2a3c244ce85b794722ad2b6a1b93a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2a5bf310a1b9aad1c2aac7eb562bc4968ea69b1cdd80ee3a0682388b2dd1a2d57ea1f26f521e332789d6cf6df01504a45c64f9d1493dcb98a0ccf3da16f67eb
|
7
|
+
data.tar.gz: ae028494a05b1979755e6f17e38edf1d51fbbe9dc03adac85ef6b5b3b3ac1adb540ac1694f0f6b9b6331318a0c85bb59a9f54027919a65162d6e0826a810cfa7
|
data/.github/workflows/test.yml
CHANGED
data/README.md
CHANGED
data/firebase_token_auth.gemspec
CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'google-
|
27
|
+
spec.add_dependency 'google-apis-identitytoolkit_v3'
|
28
28
|
spec.add_dependency 'jwt'
|
29
29
|
end
|
@@ -32,6 +32,7 @@ module FirebaseTokenAuth
|
|
32
32
|
public_key_manager.refresh_publickeys!
|
33
33
|
validator.validate(configuration.project_id, decoded_jwt)
|
34
34
|
default_options = { algorithm: ALGORITHM, verify_iat: true, verify_expiration: true, exp_leeway: configuration.exp_leeway }
|
35
|
+
raise ValidationError, 'Public key may have expired.' unless public_key_manager.public_keys.include?(public_key_id)
|
35
36
|
jwt = JWT.decode(id_token, public_key_manager.public_keys[public_key_id].public_key, true, default_options.merge!(options))
|
36
37
|
IdTokenResult.new(jwt[0]['sub'], IdToken.new(jwt[0], jwt[1]))
|
37
38
|
end
|
@@ -29,6 +29,7 @@ module FirebaseTokenAuth
|
|
29
29
|
|
30
30
|
@auth = if json_key_io
|
31
31
|
io = json_key_io.respond_to?(:read) ? json_key_io : File.open(json_key_io)
|
32
|
+
io.rewind if io.respond_to?(:read)
|
32
33
|
Google::Auth::ServiceAccountCredentials.make_creds(
|
33
34
|
json_key_io: io,
|
34
35
|
scope: scope
|
@@ -40,6 +41,7 @@ module FirebaseTokenAuth
|
|
40
41
|
|
41
42
|
if json_key_io
|
42
43
|
json_io = json_key_io.respond_to?(:read) ? json_key_io : File.open(json_key_io)
|
44
|
+
json_io.rewind if json_key_io.respond_to?(:read)
|
43
45
|
parsed = JSON.parse(json_io.read)
|
44
46
|
@private_key = OpenSSL::PKey::RSA.new(parsed['private_key'])
|
45
47
|
@client_email = parsed['client_email']
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firebase_token_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miyataka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: google-
|
14
|
+
name: google-apis-identitytoolkit_v3
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.1.4
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Firebase Authentication API wrapper for serverside. It support custom token
|