firebase-admin 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/firebase-admin/client/accounts.rb +8 -1
- data/lib/firebase-admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ff8b5b882e80cee049010198961bde97f52c64dc5a5e6d5902bcab4dd40060
|
4
|
+
data.tar.gz: 35e4530ed48199101dd666743c959af4890b161e594545470a1a37dec02993ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54cd5fc99fd435c7f5151ca76b47456da8cdee6b38eaaf3afcb72048adb9219d329ceec054e1e8634881fd9326f8ddece9ea0d7801c686a509b11d2c269137b1
|
7
|
+
data.tar.gz: 5c117435a3122766517027c076faf2591cc5b66e38964e9e881d2f3bf64a0a9dd902ae572585d7bba2c2e7c681a9a169daf15e90e1a1a0f1cc62655794f70911
|
data/Gemfile.lock
CHANGED
@@ -106,7 +106,7 @@ module FirebaseAdmin
|
|
106
106
|
credentials = default_credentials
|
107
107
|
|
108
108
|
service_account_email = credentials.fetch('client_email', ENV['GOOGLE_CLIENT_EMAIL'])
|
109
|
-
private_key = OpenSSL::PKey::RSA.new credentials.fetch('private_key', ENV['GOOGLE_PRIVATE_KEY'])
|
109
|
+
private_key = OpenSSL::PKey::RSA.new credentials.fetch('private_key', unescape(ENV['GOOGLE_PRIVATE_KEY']))
|
110
110
|
|
111
111
|
now_seconds = Time.now.to_i
|
112
112
|
payload = {
|
@@ -118,6 +118,7 @@ module FirebaseAdmin
|
|
118
118
|
uid: uid
|
119
119
|
}
|
120
120
|
JWT.encode(payload, private_key, 'RS256')
|
121
|
+
JWT.decode()
|
121
122
|
end
|
122
123
|
|
123
124
|
# Get user by email/phone/uid
|
@@ -149,6 +150,12 @@ module FirebaseAdmin
|
|
149
150
|
|
150
151
|
private
|
151
152
|
|
153
|
+
def unescape(str)
|
154
|
+
str = str.gsub '\n', "\n"
|
155
|
+
str = str[1..-2] if str.start_with?('"') && str.end_with?('"')
|
156
|
+
str
|
157
|
+
end
|
158
|
+
|
152
159
|
def default_credentials
|
153
160
|
return {} if ENV['GOOGLE_APPLICATION_CREDENTIALS'].nil?
|
154
161
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firebase-admin
|
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
|
- Colin Harris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|