firefighter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +2 -0
- data/lib/firefighter/identitytoolkit.rb +1 -3
- data/lib/firefighter/token_generator.rb +3 -3
- data/lib/firefighter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65a0d550b0817cc14a79f82f16ba44c628f710cb
|
4
|
+
data.tar.gz: 1a277e9c5cba8f0df19d4f267ad07b25d917d1a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74bbdd14e60fc5f6db685fda2413dcde977796667e51fce457176b69e18af4be72f07f79272e1e00784e073b0ca156a10c02f77a2f292f133527bfe59d123934
|
7
|
+
data.tar.gz: 0e5880b19bf6718f0d6e4ae490bf27dca481bd7f604d97dd527d2839cd2571255b2e84fc8eb83eb9ecc4ea07daf8c603a0a522b2c03747db573c88e74d40b911
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -10,6 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
addressable (2.5.2)
|
12
12
|
public_suffix (>= 2.0.2, < 4.0)
|
13
|
+
byebug (10.0.2)
|
13
14
|
crack (0.4.3)
|
14
15
|
safe_yaml (~> 1.0.0)
|
15
16
|
diff-lcs (1.3)
|
@@ -57,6 +58,7 @@ PLATFORMS
|
|
57
58
|
|
58
59
|
DEPENDENCIES
|
59
60
|
bundler (~> 1.16)
|
61
|
+
byebug
|
60
62
|
firefighter!
|
61
63
|
rake (~> 10.0)
|
62
64
|
rspec (~> 3.0)
|
@@ -6,15 +6,13 @@ module Firefighter
|
|
6
6
|
config = {
|
7
7
|
api_key: ENV['FIREBASE_WEB_API_KEY'],
|
8
8
|
service_account_email: ENV['FIREBASE_SERVICE_ACCOUNT_EMAIL'],
|
9
|
-
service_account_private_key_data: ENV['FIREBASE_PRIVATE_KEY_DATA'],
|
10
9
|
}
|
11
10
|
new(config)
|
12
11
|
end
|
13
12
|
|
14
|
-
def initialize(api_key:, service_account_email:,
|
13
|
+
def initialize(api_key:, service_account_email:, token_generator: TokenGenerator.from_env)
|
15
14
|
@api_key = api_key
|
16
15
|
@service_account_email = service_account_email
|
17
|
-
@service_account_private_key_data = service_account_private_key_data
|
18
16
|
@token_generator = token_generator
|
19
17
|
end
|
20
18
|
|
@@ -6,15 +6,15 @@ module Firefighter
|
|
6
6
|
def self.from_env
|
7
7
|
config = {
|
8
8
|
service_account_email: ENV['FIREBASE_SERVICE_ACCOUNT_EMAIL'],
|
9
|
-
|
9
|
+
service_account_private_key: ENV['FIREBASE_SERVICE_ACCOUNT_PRIVATE_KEY'],
|
10
10
|
}
|
11
11
|
new(config)
|
12
12
|
end
|
13
13
|
|
14
|
-
def initialize(service_account_email:,
|
14
|
+
def initialize(service_account_email:, service_account_private_key:, algorithm: 'RS256')
|
15
15
|
@service_account_email = service_account_email
|
16
|
-
@private_key = private_key
|
17
16
|
@algorithm = algorithm
|
17
|
+
@private_key = OpenSSL::PKey::RSA.new(service_account_private_key)
|
18
18
|
end
|
19
19
|
|
20
20
|
|
data/lib/firefighter/version.rb
CHANGED