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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cff98525ea9487f1e3a8f7358c0190a72933dab5a28548a15b9a5c759e8e3897
4
- data.tar.gz: aec561d06104af836bdb43312bfe8bb2a93298f1588d17a2aa578d2498a78fa0
3
+ metadata.gz: 88be554faaf7046b8bd9b9f03f36f3a9390931f95c951b342a085d08848a1435
4
+ data.tar.gz: 0ca72d1e3018939f92c739452b345ae39e06be7c9af9fb13e5769c443d8f03fa
5
5
  SHA512:
6
- metadata.gz: 370b215c81299b68f079ba36876fad8ec65bdd72eb7eaead4e309258106ea37e61854ca19282128999a32aac0299f96ad6bcecf704385e49d27b6ff04a8f1bf7
7
- data.tar.gz: cd6b429f7cd3237e9dfb3e065c4a04b051b35f3d5144956bb4da048adc754bd343995c167d9f5574af83e5c2e7c6eda64515a53e5db0c15fc318d79d8b7a19bb
6
+ metadata.gz: 636e70de1043d56f6c4e7f31d6ed76f2f54dffe04bf2e24e65357cabb1da02f121c5834479837ec31673519101b11f115fac5716512c5601dca593e7b93a3883
7
+ data.tar.gz: b97bf935283c404c6f701333bd01bf56458255068b43d3d6fb083d139e2ebed267d51675afc99a66ae9e3edc1d9a0fe461a69c72af1cc3d18168a97d482c59e0
@@ -12,6 +12,7 @@ jobs:
12
12
  - name: Setup Ruby
13
13
  uses: ruby/setup-ruby@v1
14
14
  with:
15
+ ruby-version: 3.0
15
16
  bundler-cache: true
16
17
 
17
18
  - name: Run standard
data/Gemfile CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ ruby "3.2.2"
6
+
5
7
  gemspec
@@ -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", "< 2"
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", "~> 13.0"
30
- spec.add_development_dependency "rspec", "~> 3.0"
31
- spec.add_development_dependency "webmock", "~> 3.13"
32
- spec.add_development_dependency "fakefs", "~> 1.3.2"
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
- require "faraday_middleware"
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.use CredentialsMiddleware, credentials: @credentials unless @credentials.nil?
59
- c.use Faraday::Request::UrlEncoded
60
- c.use FaradayMiddleware::EncodeJson
61
- c.use Faraday::Response::ParseJson
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Firebase
4
4
  module Admin
5
- VERSION = "0.1.3"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
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.1.3
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: 2021-09-30 00:00:00.000000000 Z
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: '2'
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: '2'
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: '1.0'
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: '13.0'
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: '13.0'
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: '3.0'
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: '3.0'
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: '3.13'
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: '3.13'
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: 1.3.2
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: 1.3.2
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.2.15
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