firebase-admin-sdk 0.1.3 → 0.2.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/main.yml +1 -0
- data/Gemfile +2 -0
- data/firebase-admin-sdk.gemspec +5 -6
- data/lib/firebase/admin/internal/http_client.rb +6 -16
- data/lib/firebase/admin/middleware/request/credentials.rb +15 -0
- data/lib/firebase/admin/version.rb +1 -1
- metadata +28 -36
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88be554faaf7046b8bd9b9f03f36f3a9390931f95c951b342a085d08848a1435
|
4
|
+
data.tar.gz: 0ca72d1e3018939f92c739452b345ae39e06be7c9af9fb13e5769c443d8f03fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 636e70de1043d56f6c4e7f31d6ed76f2f54dffe04bf2e24e65357cabb1da02f121c5834479837ec31673519101b11f115fac5716512c5601dca593e7b93a3883
|
7
|
+
data.tar.gz: b97bf935283c404c6f701333bd01bf56458255068b43d3d6fb083d139e2ebed267d51675afc99a66ae9e3edc1d9a0fe461a69c72af1cc3d18168a97d482c59e0
|
data/.github/workflows/main.yml
CHANGED
data/Gemfile
CHANGED
data/firebase-admin-sdk.gemspec
CHANGED
@@ -22,14 +22,13 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_runtime_dependency "googleauth", "> 0.16", "< 2.0"
|
25
|
-
spec.add_runtime_dependency "faraday", "<
|
26
|
-
spec.add_runtime_dependency "faraday_middleware", "~> 1.0"
|
25
|
+
spec.add_runtime_dependency "faraday", "> 1", "< 3"
|
27
26
|
spec.add_runtime_dependency "jwt", ">= 1.5", "< 3.0"
|
28
27
|
|
29
|
-
spec.add_development_dependency "rake"
|
30
|
-
spec.add_development_dependency "rspec"
|
31
|
-
spec.add_development_dependency "webmock"
|
32
|
-
spec.add_development_dependency "fakefs"
|
28
|
+
spec.add_development_dependency "rake"
|
29
|
+
spec.add_development_dependency "rspec"
|
30
|
+
spec.add_development_dependency "webmock"
|
31
|
+
spec.add_development_dependency "fakefs"
|
33
32
|
spec.add_development_dependency "climate_control"
|
34
33
|
spec.add_development_dependency "standard"
|
35
34
|
spec.add_development_dependency "activesupport"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "faraday"
|
2
|
-
|
2
|
+
require_relative "../middleware/request/credentials"
|
3
3
|
|
4
4
|
module Firebase
|
5
5
|
module Admin
|
@@ -35,7 +35,7 @@ module Firebase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def post(url = nil, params = nil, headers = nil)
|
38
|
-
connection.post(url, params, headers)
|
38
|
+
connection.post(url, params.to_json, headers)
|
39
39
|
end
|
40
40
|
|
41
41
|
def patch(url = nil, params = nil, headers = nil)
|
@@ -55,23 +55,13 @@ module Firebase
|
|
55
55
|
}
|
56
56
|
|
57
57
|
@connection ||= Faraday::Connection.new(@uri, options) do |c|
|
58
|
-
c.
|
59
|
-
c.
|
60
|
-
c.
|
61
|
-
c.
|
62
|
-
c.use Faraday::Response::RaiseError
|
58
|
+
c.request :url_encoded
|
59
|
+
c.request :credentials, credentials: @credentials unless @credentials.nil?
|
60
|
+
c.response :json
|
61
|
+
c.response :raise_error
|
63
62
|
c.adapter(Faraday.default_adapter)
|
64
63
|
end
|
65
64
|
end
|
66
|
-
|
67
|
-
# Middleware for applying credentials to authenticate requests.
|
68
|
-
class CredentialsMiddleware < Faraday::Middleware
|
69
|
-
def on_request(env)
|
70
|
-
creds = options[:credentials]
|
71
|
-
creds.apply!(env[:request_headers])
|
72
|
-
end
|
73
|
-
end
|
74
|
-
private_constant :CredentialsMiddleware
|
75
65
|
end
|
76
66
|
end
|
77
67
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "faraday/middleware"
|
2
|
+
|
3
|
+
# Middleware for applying credentials to authenticate requests.
|
4
|
+
module Faraday
|
5
|
+
module Credentials
|
6
|
+
class Middleware < ::Faraday::Middleware
|
7
|
+
def on_request(env)
|
8
|
+
creds = options[:credentials]
|
9
|
+
creds.apply!(env[:request_headers])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Faraday::Request.register_middleware(credentials: Faraday::Credentials::Middleware)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firebase-admin-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tariq Zaid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: googleauth
|
@@ -34,30 +34,22 @@ dependencies:
|
|
34
34
|
name: faraday
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
40
|
-
type: :runtime
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
39
|
+
version: '1'
|
44
40
|
- - "<"
|
45
41
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: faraday_middleware
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.0'
|
42
|
+
version: '3'
|
54
43
|
type: :runtime
|
55
44
|
prerelease: false
|
56
45
|
version_requirements: !ruby/object:Gem::Requirement
|
57
46
|
requirements:
|
58
|
-
- - "
|
47
|
+
- - ">"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1'
|
50
|
+
- - "<"
|
59
51
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
52
|
+
version: '3'
|
61
53
|
- !ruby/object:Gem::Dependency
|
62
54
|
name: jwt
|
63
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,58 +74,58 @@ dependencies:
|
|
82
74
|
name: rake
|
83
75
|
requirement: !ruby/object:Gem::Requirement
|
84
76
|
requirements:
|
85
|
-
- - "
|
77
|
+
- - ">="
|
86
78
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
79
|
+
version: '0'
|
88
80
|
type: :development
|
89
81
|
prerelease: false
|
90
82
|
version_requirements: !ruby/object:Gem::Requirement
|
91
83
|
requirements:
|
92
|
-
- - "
|
84
|
+
- - ">="
|
93
85
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
86
|
+
version: '0'
|
95
87
|
- !ruby/object:Gem::Dependency
|
96
88
|
name: rspec
|
97
89
|
requirement: !ruby/object:Gem::Requirement
|
98
90
|
requirements:
|
99
|
-
- - "
|
91
|
+
- - ">="
|
100
92
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
93
|
+
version: '0'
|
102
94
|
type: :development
|
103
95
|
prerelease: false
|
104
96
|
version_requirements: !ruby/object:Gem::Requirement
|
105
97
|
requirements:
|
106
|
-
- - "
|
98
|
+
- - ">="
|
107
99
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
100
|
+
version: '0'
|
109
101
|
- !ruby/object:Gem::Dependency
|
110
102
|
name: webmock
|
111
103
|
requirement: !ruby/object:Gem::Requirement
|
112
104
|
requirements:
|
113
|
-
- - "
|
105
|
+
- - ">="
|
114
106
|
- !ruby/object:Gem::Version
|
115
|
-
version: '
|
107
|
+
version: '0'
|
116
108
|
type: :development
|
117
109
|
prerelease: false
|
118
110
|
version_requirements: !ruby/object:Gem::Requirement
|
119
111
|
requirements:
|
120
|
-
- - "
|
112
|
+
- - ">="
|
121
113
|
- !ruby/object:Gem::Version
|
122
|
-
version: '
|
114
|
+
version: '0'
|
123
115
|
- !ruby/object:Gem::Dependency
|
124
116
|
name: fakefs
|
125
117
|
requirement: !ruby/object:Gem::Requirement
|
126
118
|
requirements:
|
127
|
-
- - "
|
119
|
+
- - ">="
|
128
120
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
121
|
+
version: '0'
|
130
122
|
type: :development
|
131
123
|
prerelease: false
|
132
124
|
version_requirements: !ruby/object:Gem::Requirement
|
133
125
|
requirements:
|
134
|
-
- - "
|
126
|
+
- - ">="
|
135
127
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
128
|
+
version: '0'
|
137
129
|
- !ruby/object:Gem::Dependency
|
138
130
|
name: climate_control
|
139
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,7 +178,6 @@ files:
|
|
186
178
|
- ".github/workflows/main.yml"
|
187
179
|
- ".gitignore"
|
188
180
|
- ".rspec"
|
189
|
-
- ".ruby-version"
|
190
181
|
- Gemfile
|
191
182
|
- LICENSE.txt
|
192
183
|
- README.md
|
@@ -229,6 +220,7 @@ files:
|
|
229
220
|
- lib/firebase/admin/messaging/notification.rb
|
230
221
|
- lib/firebase/admin/messaging/topic_management_response.rb
|
231
222
|
- lib/firebase/admin/messaging/utils.rb
|
223
|
+
- lib/firebase/admin/middleware/request/credentials.rb
|
232
224
|
- lib/firebase/admin/version.rb
|
233
225
|
homepage: https://github.com/cheddar-me/firebase-admin-sdk-ruby
|
234
226
|
licenses:
|
@@ -249,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
241
|
- !ruby/object:Gem::Version
|
250
242
|
version: '0'
|
251
243
|
requirements: []
|
252
|
-
rubygems_version: 3.
|
244
|
+
rubygems_version: 3.4.10
|
253
245
|
signing_key:
|
254
246
|
specification_version: 4
|
255
247
|
summary: Firebase Admin SDK for Ruby
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.0.1
|