firebase-admin-sdk 0.1.2 → 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: 70f5ac81488726bd977898980155890e557f9e2894072ad8e1873e6c60ab99b6
4
- data.tar.gz: 97732224127a66ffe81483584706ce505471c7a8f0965d7b2be1f9a135fd3cbf
3
+ metadata.gz: 88be554faaf7046b8bd9b9f03f36f3a9390931f95c951b342a085d08848a1435
4
+ data.tar.gz: 0ca72d1e3018939f92c739452b345ae39e06be7c9af9fb13e5769c443d8f03fa
5
5
  SHA512:
6
- metadata.gz: 55f1db8f3ea1cb752e50f4cfff1d94230e86270021210e3a3f16d4bc49f8974b80440ebc1f507e4e454aa72d61adf9b62595d92f4a1a08205f2af15534fd5c1c
7
- data.tar.gz: 85d8984833119d962ee80c1dc90bb45276f13ae006e7e165f2ae15e938529782379cfca5fa117764449ed4963f8d6c94a6d7ef5c913b926077ca615ca0c13737
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
@@ -21,15 +21,14 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = "bin"
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency "googleauth", "~> 0.16"
25
- spec.add_runtime_dependency "faraday", "< 2"
26
- spec.add_runtime_dependency "faraday_middleware", "~> 1.0"
24
+ spec.add_runtime_dependency "googleauth", "> 0.16", "< 2.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.2"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,57 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firebase-admin-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
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-04 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
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.16'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.16'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: faraday
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "<"
37
+ - - ">"
32
38
  - !ruby/object:Gem::Version
33
- version: '2'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
39
+ version: '1'
38
40
  - - "<"
39
41
  - !ruby/object:Gem::Version
40
- version: '2'
41
- - !ruby/object:Gem::Dependency
42
- name: faraday_middleware
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.0'
42
+ version: '3'
48
43
  type: :runtime
49
44
  prerelease: false
50
45
  version_requirements: !ruby/object:Gem::Requirement
51
46
  requirements:
52
- - - "~>"
47
+ - - ">"
53
48
  - !ruby/object:Gem::Version
54
- version: '1.0'
49
+ version: '1'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3'
55
53
  - !ruby/object:Gem::Dependency
56
54
  name: jwt
57
55
  requirement: !ruby/object:Gem::Requirement
@@ -76,58 +74,58 @@ dependencies:
76
74
  name: rake
77
75
  requirement: !ruby/object:Gem::Requirement
78
76
  requirements:
79
- - - "~>"
77
+ - - ">="
80
78
  - !ruby/object:Gem::Version
81
- version: '13.0'
79
+ version: '0'
82
80
  type: :development
83
81
  prerelease: false
84
82
  version_requirements: !ruby/object:Gem::Requirement
85
83
  requirements:
86
- - - "~>"
84
+ - - ">="
87
85
  - !ruby/object:Gem::Version
88
- version: '13.0'
86
+ version: '0'
89
87
  - !ruby/object:Gem::Dependency
90
88
  name: rspec
91
89
  requirement: !ruby/object:Gem::Requirement
92
90
  requirements:
93
- - - "~>"
91
+ - - ">="
94
92
  - !ruby/object:Gem::Version
95
- version: '3.0'
93
+ version: '0'
96
94
  type: :development
97
95
  prerelease: false
98
96
  version_requirements: !ruby/object:Gem::Requirement
99
97
  requirements:
100
- - - "~>"
98
+ - - ">="
101
99
  - !ruby/object:Gem::Version
102
- version: '3.0'
100
+ version: '0'
103
101
  - !ruby/object:Gem::Dependency
104
102
  name: webmock
105
103
  requirement: !ruby/object:Gem::Requirement
106
104
  requirements:
107
- - - "~>"
105
+ - - ">="
108
106
  - !ruby/object:Gem::Version
109
- version: '3.13'
107
+ version: '0'
110
108
  type: :development
111
109
  prerelease: false
112
110
  version_requirements: !ruby/object:Gem::Requirement
113
111
  requirements:
114
- - - "~>"
112
+ - - ">="
115
113
  - !ruby/object:Gem::Version
116
- version: '3.13'
114
+ version: '0'
117
115
  - !ruby/object:Gem::Dependency
118
116
  name: fakefs
119
117
  requirement: !ruby/object:Gem::Requirement
120
118
  requirements:
121
- - - "~>"
119
+ - - ">="
122
120
  - !ruby/object:Gem::Version
123
- version: 1.3.2
121
+ version: '0'
124
122
  type: :development
125
123
  prerelease: false
126
124
  version_requirements: !ruby/object:Gem::Requirement
127
125
  requirements:
128
- - - "~>"
126
+ - - ">="
129
127
  - !ruby/object:Gem::Version
130
- version: 1.3.2
128
+ version: '0'
131
129
  - !ruby/object:Gem::Dependency
132
130
  name: climate_control
133
131
  requirement: !ruby/object:Gem::Requirement
@@ -180,7 +178,6 @@ files:
180
178
  - ".github/workflows/main.yml"
181
179
  - ".gitignore"
182
180
  - ".rspec"
183
- - ".ruby-version"
184
181
  - Gemfile
185
182
  - LICENSE.txt
186
183
  - README.md
@@ -223,6 +220,7 @@ files:
223
220
  - lib/firebase/admin/messaging/notification.rb
224
221
  - lib/firebase/admin/messaging/topic_management_response.rb
225
222
  - lib/firebase/admin/messaging/utils.rb
223
+ - lib/firebase/admin/middleware/request/credentials.rb
226
224
  - lib/firebase/admin/version.rb
227
225
  homepage: https://github.com/cheddar-me/firebase-admin-sdk-ruby
228
226
  licenses:
@@ -243,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
241
  - !ruby/object:Gem::Version
244
242
  version: '0'
245
243
  requirements: []
246
- rubygems_version: 3.2.15
244
+ rubygems_version: 3.4.10
247
245
  signing_key:
248
246
  specification_version: 4
249
247
  summary: Firebase Admin SDK for Ruby
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.0.1