fcmpush 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fcmpush.gemspec +1 -1
- data/lib/fcmpush/client.rb +15 -1
- data/lib/fcmpush/configuration.rb +7 -1
- data/lib/fcmpush/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d98bbee5a1f8daeb92bc80eb99e47900fbdb1dd1b02f94ccf336438acca4309
|
4
|
+
data.tar.gz: e0c867579f0b8a9f36bdb1072eac2260c402ca1bb9a7651f991c039d453d6f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6955bdd01edff13812527e4c3b0e559d8fbf50d264ef27ac9f7bfb86cf9aa7b37e99ab05f6a7d3e4086c0a8ae13a91bd0198ac44d3ce4d2f3d1dcc6b38c56e64
|
7
|
+
data.tar.gz: 0ad35b0fcf345715f4a6bc307a14f087961315803c0916e0032115cde3b8c3659fe18c108e22d822e2b4be9dbee41e6f9d1cd8a8804f76b370e6682881a2f4cf
|
data/fcmpush.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.required_ruby_version = '>= 2.6', '< 3.
|
25
|
+
spec.required_ruby_version = '>= 2.6', '< 3.4'
|
26
26
|
|
27
27
|
spec.add_dependency 'google-apis-identitytoolkit_v3'
|
28
28
|
spec.add_dependency 'net-http-persistent', '~> 4.0.1'
|
data/lib/fcmpush/client.rb
CHANGED
@@ -25,6 +25,20 @@ module Fcmpush
|
|
25
25
|
@access_token_expiry = Time.now.utc + access_token_response['expires_in']
|
26
26
|
@server_key = configuration.server_key
|
27
27
|
@connection = Net::HTTP::Persistent.new
|
28
|
+
|
29
|
+
if !configuration.proxy
|
30
|
+
# do nothing
|
31
|
+
elsif configuration.proxy == :ENV
|
32
|
+
@connection.proxy = :ENV
|
33
|
+
elsif configuration.proxy && configuration.proxy[:uri]
|
34
|
+
uri = URI(configuration.proxy[:uri])
|
35
|
+
# user name must not be a empty string, password can
|
36
|
+
if configuration.proxy[:user] && configuration.proxy[:user].strip != ''
|
37
|
+
uri.user = configuration.proxy[:user]
|
38
|
+
uri.password = configuration.proxy[:password] if configuration.proxy[:password]
|
39
|
+
end
|
40
|
+
@connection.proxy = uri
|
41
|
+
end
|
28
42
|
end
|
29
43
|
|
30
44
|
def v1_authorize
|
@@ -127,7 +141,7 @@ module Fcmpush
|
|
127
141
|
|
128
142
|
def exception_handler(response)
|
129
143
|
error = STATUS_TO_EXCEPTION_MAPPING[response.code]
|
130
|
-
raise error.new("
|
144
|
+
raise error.new("Received an error response #{response.code} #{error.to_s.split('::').last}: #{response.body}", response) if error
|
131
145
|
|
132
146
|
response
|
133
147
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fcmpush
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :scope, :json_key_io, :server_key
|
3
|
+
attr_accessor :scope, :json_key_io, :server_key, :proxy
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@scope = ['https://www.googleapis.com/auth/firebase.messaging']
|
@@ -16,6 +16,12 @@ module Fcmpush
|
|
16
16
|
|
17
17
|
# regacy auth
|
18
18
|
@server_key = ENV['FCM_SERVER_KEY']
|
19
|
+
|
20
|
+
# THIS IS EXPERIMENTAL
|
21
|
+
# NOT support `HTTPS_PROXY` environment variable. This feature not tested well on CI.
|
22
|
+
# cf. https://github.com/miyataka/fcmpush/pull/39#issuecomment-1722533622
|
23
|
+
# proxy
|
24
|
+
@proxy = :ENV
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
data/lib/fcmpush/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fcmpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miyataka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-apis-identitytoolkit_v3
|
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '2.6'
|
114
114
|
- - "<"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
116
|
+
version: '3.4'
|
117
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
119
|
- - ">="
|