rpush 4.2.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +307 -163
- data/README.md +105 -19
- data/lib/generators/templates/add_adm.rb +1 -1
- data/lib/generators/templates/add_alert_is_json_to_rapns_notifications.rb +2 -2
- data/lib/generators/templates/add_app_to_rapns.rb +2 -2
- data/lib/generators/templates/add_fail_after_to_rpush_notifications.rb +1 -1
- data/lib/generators/templates/add_gcm.rb +11 -25
- data/lib/generators/templates/add_rpush.rb +33 -83
- data/lib/generators/templates/add_wpns.rb +1 -1
- data/lib/generators/templates/create_rapns_apps.rb +1 -1
- data/lib/generators/templates/create_rapns_feedback.rb +3 -9
- data/lib/generators/templates/create_rapns_notifications.rb +3 -9
- data/lib/generators/templates/rename_rapns_to_rpush.rb +9 -33
- data/lib/generators/templates/rpush.rb +5 -4
- data/lib/generators/templates/rpush_2_0_0_updates.rb +10 -18
- data/lib/generators/templates/rpush_2_1_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_2_6_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_2_7_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_0_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_0_1_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_1_0_add_pushy.rb +1 -1
- data/lib/generators/templates/rpush_3_1_1_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_2_0_add_apns_p8.rb +1 -1
- data/lib/generators/templates/rpush_3_2_4_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_3_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_3_3_1_updates.rb +3 -3
- data/lib/generators/templates/rpush_4_1_0_updates.rb +1 -1
- data/lib/generators/templates/rpush_4_1_1_updates.rb +1 -1
- data/lib/generators/templates/rpush_4_2_0_updates.rb +1 -1
- data/lib/rpush/cli.rb +1 -1
- data/lib/rpush/client/active_model/adm/data_validator.rb +1 -1
- data/lib/rpush/client/active_model/apns/app.rb +1 -17
- data/lib/rpush/client/active_model/apns/device_token_format_validator.rb +2 -2
- data/lib/rpush/client/active_model/apns/notification.rb +13 -1
- data/lib/rpush/client/active_model/apns/notification_payload_size_validator.rb +15 -0
- data/lib/rpush/client/active_model/apns2/app.rb +7 -1
- data/lib/rpush/client/active_model/apns2/notification.rb +14 -0
- data/lib/rpush/client/active_model/certificate_private_key_validator.rb +19 -0
- data/lib/rpush/client/active_model/gcm/expiry_collapse_key_mutual_inclusion_validator.rb +1 -1
- data/lib/rpush/client/active_model/gcm/notification.rb +2 -2
- data/lib/rpush/client/active_model/payload_data_size_validator.rb +1 -1
- data/lib/rpush/client/active_model/registration_ids_count_validator.rb +1 -1
- data/lib/rpush/client/active_model/webpush/app.rb +41 -0
- data/lib/rpush/client/active_model/webpush/notification.rb +66 -0
- data/lib/rpush/client/active_model.rb +5 -1
- data/lib/rpush/client/active_record/apns/active_record_serializable_notification.rb +65 -0
- data/lib/rpush/client/active_record/apns/notification.rb +1 -57
- data/lib/rpush/client/active_record/apns2/notification.rb +4 -1
- data/lib/rpush/client/active_record/apnsp8/notification.rb +1 -0
- data/lib/rpush/client/active_record/webpush/app.rb +11 -0
- data/lib/rpush/client/active_record/webpush/notification.rb +12 -0
- data/lib/rpush/client/active_record.rb +4 -0
- data/lib/rpush/client/redis/apns2/notification.rb +1 -0
- data/lib/rpush/client/redis/apnsp8/notification.rb +2 -0
- data/lib/rpush/client/redis/pushy/notification.rb +0 -1
- data/lib/rpush/client/redis/webpush/app.rb +15 -0
- data/lib/rpush/client/redis/webpush/notification.rb +15 -0
- data/lib/rpush/client/redis.rb +3 -0
- data/lib/rpush/configuration.rb +3 -2
- data/lib/rpush/daemon/apns/feedback_receiver.rb +1 -1
- data/lib/rpush/daemon/apns2/delivery.rb +14 -2
- data/lib/rpush/daemon/apnsp8/delivery.rb +14 -3
- data/lib/rpush/daemon/app_runner.rb +1 -1
- data/lib/rpush/daemon/batch.rb +12 -5
- data/lib/rpush/daemon/delivery.rb +1 -2
- data/lib/rpush/daemon/store/active_record/reconnectable.rb +1 -1
- data/lib/rpush/daemon/store/active_record.rb +11 -7
- data/lib/rpush/daemon/store/redis.rb +6 -6
- data/lib/rpush/daemon/string_helpers.rb +1 -1
- data/lib/rpush/daemon/webpush/delivery.rb +114 -0
- data/lib/rpush/daemon/webpush.rb +10 -0
- data/lib/rpush/daemon.rb +4 -1
- data/lib/rpush/logger.rb +2 -1
- data/lib/rpush/version.rb +3 -3
- data/spec/functional/apns2_spec.rb +99 -2
- data/spec/functional/gcm_priority_spec.rb +40 -0
- data/spec/functional/retry_spec.rb +1 -1
- data/spec/functional/webpush_spec.rb +31 -0
- data/spec/spec_helper.rb +3 -1
- data/spec/support/active_record_setup.rb +4 -3
- data/spec/support/config/database.yml +4 -4
- data/spec/support/simplecov_helper.rb +2 -2
- data/spec/unit/client/active_record/adm/app_spec.rb +2 -54
- data/spec/unit/client/active_record/adm/notification_spec.rb +2 -39
- data/spec/unit/client/active_record/apns/app_spec.rb +3 -26
- data/spec/unit/client/active_record/apns/feedback_spec.rb +1 -5
- data/spec/unit/client/active_record/apns/notification_spec.rb +29 -293
- data/spec/unit/client/active_record/apns2/app_spec.rb +5 -0
- data/spec/unit/client/active_record/apns2/notification_spec.rb +65 -0
- data/spec/unit/client/active_record/apnsp8/notification_spec.rb +28 -0
- data/spec/unit/client/active_record/app_spec.rb +1 -26
- data/spec/unit/client/active_record/gcm/app_spec.rb +3 -1
- data/spec/unit/client/active_record/gcm/notification_spec.rb +6 -88
- data/spec/unit/client/active_record/notification_spec.rb +3 -11
- data/spec/unit/client/active_record/pushy/app_spec.rb +2 -13
- data/spec/unit/client/active_record/pushy/notification_spec.rb +2 -55
- data/spec/unit/client/active_record/shared/app.rb +14 -0
- data/spec/unit/{notification_shared.rb → client/active_record/shared/notification.rb} +12 -7
- data/spec/unit/client/active_record/webpush/app_spec.rb +6 -0
- data/spec/unit/client/active_record/webpush/notification_spec.rb +6 -0
- data/spec/unit/client/active_record/wns/badge_notification_spec.rb +1 -11
- data/spec/unit/client/active_record/wns/raw_notification_spec.rb +3 -12
- data/spec/unit/client/active_record/wpns/app_spec.rb +3 -1
- data/spec/unit/client/active_record/wpns/notification_spec.rb +2 -17
- data/spec/unit/client/redis/adm/app_spec.rb +5 -0
- data/spec/unit/client/redis/adm/notification_spec.rb +5 -0
- data/spec/unit/client/redis/apns/app_spec.rb +5 -0
- data/spec/unit/client/redis/apns/feedback_spec.rb +5 -0
- data/spec/unit/client/redis/apns/notification_spec.rb +50 -0
- data/spec/unit/client/redis/apns2/app_spec.rb +4 -0
- data/spec/unit/client/redis/apns2/notification_spec.rb +50 -0
- data/spec/unit/client/redis/apnsp8/notification_spec.rb +29 -0
- data/spec/unit/client/redis/app_spec.rb +5 -0
- data/spec/unit/client/redis/gcm/app_spec.rb +5 -0
- data/spec/unit/client/redis/gcm/notification_spec.rb +5 -0
- data/spec/unit/client/redis/notification_spec.rb +5 -0
- data/spec/unit/client/redis/pushy/app_spec.rb +5 -0
- data/spec/unit/client/redis/pushy/notification_spec.rb +5 -0
- data/spec/unit/client/redis/webpush/app_spec.rb +5 -0
- data/spec/unit/client/redis/webpush/notification_spec.rb +5 -0
- data/spec/unit/client/redis/wns/badge_notification_spec.rb +5 -0
- data/spec/unit/client/redis/wns/raw_notification_spec.rb +22 -0
- data/spec/unit/client/redis/wpns/app_spec.rb +5 -0
- data/spec/unit/client/redis/wpns/notification_spec.rb +5 -0
- data/spec/unit/client/shared/adm/app.rb +51 -0
- data/spec/unit/client/shared/adm/notification.rb +39 -0
- data/spec/unit/client/shared/apns/app.rb +29 -0
- data/spec/unit/client/shared/apns/feedback.rb +9 -0
- data/spec/unit/client/shared/apns/notification.rb +277 -0
- data/spec/unit/client/shared/app.rb +17 -0
- data/spec/unit/client/shared/gcm/app.rb +4 -0
- data/spec/unit/client/shared/gcm/notification.rb +77 -0
- data/spec/unit/client/shared/notification.rb +10 -0
- data/spec/unit/client/shared/pushy/app.rb +17 -0
- data/spec/unit/client/shared/pushy/notification.rb +55 -0
- data/spec/unit/client/shared/webpush/app.rb +33 -0
- data/spec/unit/client/shared/webpush/notification.rb +83 -0
- data/spec/unit/client/shared/wns/badge_notification.rb +15 -0
- data/spec/unit/client/shared/wns/raw_notification.rb +21 -0
- data/spec/unit/client/shared/wpns/app.rb +4 -0
- data/spec/unit/client/shared/wpns/notification.rb +18 -0
- data/spec/unit/daemon/apnsp8/delivery_spec.rb +53 -0
- data/spec/unit/daemon/batch_spec.rb +50 -2
- data/spec/unit/daemon/delivery_spec.rb +10 -0
- data/spec/unit/daemon/pushy/delivery_spec.rb +5 -3
- data/spec/unit/daemon/shared/store.rb +312 -0
- data/spec/unit/daemon/store/active_record/reconnectable_spec.rb +7 -7
- data/spec/unit/daemon/store/active_record_spec.rb +6 -287
- data/spec/unit/daemon/store/redis_spec.rb +2 -291
- data/spec/unit/daemon/webpush/delivery_spec.rb +144 -0
- data/spec/unit_spec_helper.rb +3 -0
- metadata +145 -18
- data/lib/rpush/client/active_model/apns/binary_notification_validator.rb +0 -16
@@ -0,0 +1,144 @@
|
|
1
|
+
require 'unit_spec_helper'
|
2
|
+
|
3
|
+
describe Rpush::Daemon::Webpush::Delivery do
|
4
|
+
let(:app) { Rpush::Webpush::App.create!(name: 'MyApp', vapid_keypair: VAPID_KEYPAIR) }
|
5
|
+
|
6
|
+
# Push subscription information as received from a client browser when the
|
7
|
+
# user subscribed to push notifications.
|
8
|
+
let(:device_reg) {
|
9
|
+
{ endpoint: 'https://webpush-provider.example.org/push/some-id',
|
10
|
+
keys: {'auth' => 'DgN9EBia1o057BdhCOGURA', 'p256dh' => 'BAtxJ--7vHq9IVm8utUB3peJ4lpxRqk1rukCIkVJOomS83QkCnrQ4EyYQsSaCRgy_c8XPytgXxuyAvRJdnTPK4A'} }
|
11
|
+
}
|
12
|
+
|
13
|
+
let(:data) { { message: 'some message' } }
|
14
|
+
let(:notification) { Rpush::Webpush::Notification.create!(app: app, registration_ids: [device_reg], data: data) }
|
15
|
+
let(:batch) { instance_double('Rpush::Daemon::Batch', notification_processed: nil) }
|
16
|
+
let(:response) { instance_double('Net::HTTPResponse', code: response_code, header: response_header, body: response_body) }
|
17
|
+
let(:response_code) { 201 }
|
18
|
+
let(:response_header) { {} }
|
19
|
+
let(:response_body) { nil }
|
20
|
+
let(:http) { instance_double('Net::HTTP::Persistent', request: response) }
|
21
|
+
let(:logger) { instance_double('Rpush::Logger', error: nil, info: nil, warn: nil, internal_logger: nil) }
|
22
|
+
let(:now) { Time.parse('2020-10-13 00:00:00 UTC') }
|
23
|
+
|
24
|
+
before do
|
25
|
+
allow(Rpush).to receive_messages(logger: logger)
|
26
|
+
allow(Time).to receive_messages(now: now)
|
27
|
+
end
|
28
|
+
|
29
|
+
subject(:delivery) { described_class.new(app, http, notification, batch) }
|
30
|
+
|
31
|
+
describe '#perform' do
|
32
|
+
shared_examples 'process notification' do
|
33
|
+
it 'invoke batch.notification_processed' do
|
34
|
+
subject.perform rescue nil
|
35
|
+
expect(batch).to have_received(:notification_processed)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'when response code is 201' do
|
40
|
+
before do
|
41
|
+
allow(batch).to receive(:mark_delivered)
|
42
|
+
Rpush::Daemon.store = Rpush::Daemon::Store.const_get(Rpush.config.client.to_s.camelcase).new
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'marks the notification as delivered' do
|
46
|
+
delivery.perform
|
47
|
+
expect(batch).to have_received(:mark_delivered).with(notification)
|
48
|
+
end
|
49
|
+
|
50
|
+
it_behaves_like 'process notification'
|
51
|
+
end
|
52
|
+
|
53
|
+
shared_examples 'retry delivery' do |options|
|
54
|
+
let(:response_code) { options[:response_code] }
|
55
|
+
|
56
|
+
shared_examples 'logs' do |log_options|
|
57
|
+
let(:deliver_after) { log_options[:deliver_after] }
|
58
|
+
|
59
|
+
let(:expected_log_message) do
|
60
|
+
"[MyApp] Webpush endpoint responded with a #{response_code} error. Notification #{notification.id} will be retried after #{deliver_after} (retry 1)."
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'logs that the notification will be retried' do
|
64
|
+
delivery.perform
|
65
|
+
expect(logger).to have_received(:info).with(expected_log_message)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context 'when Retry-After header is present' do
|
70
|
+
let(:response_header) { { 'retry-after' => 10 } }
|
71
|
+
|
72
|
+
before do
|
73
|
+
allow(delivery).to receive(:mark_retryable) do
|
74
|
+
notification.deliver_after = now + 10.seconds
|
75
|
+
notification.retries += 1
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'retry the notification' do
|
80
|
+
delivery.perform
|
81
|
+
expect(delivery).to have_received(:mark_retryable).with(notification, now + 10.seconds)
|
82
|
+
end
|
83
|
+
|
84
|
+
it_behaves_like 'logs', deliver_after: '2020-10-13 00:00:10'
|
85
|
+
it_behaves_like 'process notification'
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when Retry-After header is not present' do
|
89
|
+
before do
|
90
|
+
allow(delivery).to receive(:mark_retryable_exponential) do
|
91
|
+
notification.deliver_after = now + 2.seconds
|
92
|
+
notification.retries = 1
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'retry the notification' do
|
97
|
+
delivery.perform
|
98
|
+
expect(delivery).to have_received(:mark_retryable_exponential).with(notification)
|
99
|
+
end
|
100
|
+
|
101
|
+
it_behaves_like 'logs', deliver_after: '2020-10-13 00:00:02'
|
102
|
+
it_behaves_like 'process notification'
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
it_behaves_like 'retry delivery', response_code: 429
|
107
|
+
it_behaves_like 'retry delivery', response_code: 500
|
108
|
+
it_behaves_like 'retry delivery', response_code: 502
|
109
|
+
it_behaves_like 'retry delivery', response_code: 503
|
110
|
+
it_behaves_like 'retry delivery', response_code: 504
|
111
|
+
|
112
|
+
context 'when delivery failed' do
|
113
|
+
let(:response_code) { 400 }
|
114
|
+
let(:fail_message) { 'that was a bad request' }
|
115
|
+
before do
|
116
|
+
allow(response).to receive(:body) { fail_message }
|
117
|
+
allow(batch).to receive(:mark_failed)
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'marks the notification as failed' do
|
121
|
+
expect { delivery.perform }.to raise_error(Rpush::DeliveryError)
|
122
|
+
expected_message = "Unable to deliver notification #{notification.id}, " \
|
123
|
+
"received error 400 (Bad Request: #{fail_message})"
|
124
|
+
expect(batch).to have_received(:mark_failed).with(notification, 400, expected_message)
|
125
|
+
end
|
126
|
+
|
127
|
+
it_behaves_like 'process notification'
|
128
|
+
end
|
129
|
+
|
130
|
+
context 'when SocketError raised' do
|
131
|
+
before do
|
132
|
+
allow(http).to receive(:request) { raise SocketError }
|
133
|
+
allow(delivery).to receive(:mark_retryable)
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'retry delivery after 10 seconds' do
|
137
|
+
expect { delivery.perform }.to raise_error(SocketError)
|
138
|
+
expect(delivery).to have_received(:mark_retryable).with(notification, now + 10.seconds, SocketError)
|
139
|
+
end
|
140
|
+
|
141
|
+
it_behaves_like 'process notification'
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
data/spec/unit_spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -44,14 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.18'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.18.3
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
55
|
- - "~>"
|
53
56
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
57
|
+
version: '0.18'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.18.3
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: jwt
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +78,14 @@ dependencies:
|
|
72
78
|
requirements:
|
73
79
|
- - ">="
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
81
|
+
version: '5.2'
|
76
82
|
type: :runtime
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - ">="
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
88
|
+
version: '5.2'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: thor
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,6 +134,20 @@ dependencies:
|
|
128
134
|
- - ">="
|
129
135
|
- !ruby/object:Gem::Version
|
130
136
|
version: '0'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: webpush
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '1.0'
|
144
|
+
type: :runtime
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '1.0'
|
131
151
|
- !ruby/object:Gem::Dependency
|
132
152
|
name: rake
|
133
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -272,16 +292,16 @@ dependencies:
|
|
272
292
|
name: rubocop
|
273
293
|
requirement: !ruby/object:Gem::Requirement
|
274
294
|
requirements:
|
275
|
-
- - "
|
295
|
+
- - "~>"
|
276
296
|
- !ruby/object:Gem::Version
|
277
|
-
version:
|
297
|
+
version: 1.12.0
|
278
298
|
type: :development
|
279
299
|
prerelease: false
|
280
300
|
version_requirements: !ruby/object:Gem::Requirement
|
281
301
|
requirements:
|
282
|
-
- - "
|
302
|
+
- - "~>"
|
283
303
|
- !ruby/object:Gem::Version
|
284
|
-
version:
|
304
|
+
version: 1.12.0
|
285
305
|
- !ruby/object:Gem::Dependency
|
286
306
|
name: rubocop-performance
|
287
307
|
requirement: !ruby/object:Gem::Requirement
|
@@ -401,13 +421,14 @@ files:
|
|
401
421
|
- lib/rpush/client/active_model/adm/data_validator.rb
|
402
422
|
- lib/rpush/client/active_model/adm/notification.rb
|
403
423
|
- lib/rpush/client/active_model/apns/app.rb
|
404
|
-
- lib/rpush/client/active_model/apns/binary_notification_validator.rb
|
405
424
|
- lib/rpush/client/active_model/apns/device_token_format_validator.rb
|
406
425
|
- lib/rpush/client/active_model/apns/notification.rb
|
426
|
+
- lib/rpush/client/active_model/apns/notification_payload_size_validator.rb
|
407
427
|
- lib/rpush/client/active_model/apns2/app.rb
|
408
428
|
- lib/rpush/client/active_model/apns2/notification.rb
|
409
429
|
- lib/rpush/client/active_model/apnsp8/app.rb
|
410
430
|
- lib/rpush/client/active_model/apnsp8/notification.rb
|
431
|
+
- lib/rpush/client/active_model/certificate_private_key_validator.rb
|
411
432
|
- lib/rpush/client/active_model/gcm/app.rb
|
412
433
|
- lib/rpush/client/active_model/gcm/expiry_collapse_key_mutual_inclusion_validator.rb
|
413
434
|
- lib/rpush/client/active_model/gcm/notification.rb
|
@@ -417,6 +438,8 @@ files:
|
|
417
438
|
- lib/rpush/client/active_model/pushy/notification.rb
|
418
439
|
- lib/rpush/client/active_model/pushy/time_to_live_validator.rb
|
419
440
|
- lib/rpush/client/active_model/registration_ids_count_validator.rb
|
441
|
+
- lib/rpush/client/active_model/webpush/app.rb
|
442
|
+
- lib/rpush/client/active_model/webpush/notification.rb
|
420
443
|
- lib/rpush/client/active_model/wns/app.rb
|
421
444
|
- lib/rpush/client/active_model/wns/notification.rb
|
422
445
|
- lib/rpush/client/active_model/wpns/app.rb
|
@@ -424,6 +447,7 @@ files:
|
|
424
447
|
- lib/rpush/client/active_record.rb
|
425
448
|
- lib/rpush/client/active_record/adm/app.rb
|
426
449
|
- lib/rpush/client/active_record/adm/notification.rb
|
450
|
+
- lib/rpush/client/active_record/apns/active_record_serializable_notification.rb
|
427
451
|
- lib/rpush/client/active_record/apns/app.rb
|
428
452
|
- lib/rpush/client/active_record/apns/feedback.rb
|
429
453
|
- lib/rpush/client/active_record/apns/notification.rb
|
@@ -437,6 +461,8 @@ files:
|
|
437
461
|
- lib/rpush/client/active_record/notification.rb
|
438
462
|
- lib/rpush/client/active_record/pushy/app.rb
|
439
463
|
- lib/rpush/client/active_record/pushy/notification.rb
|
464
|
+
- lib/rpush/client/active_record/webpush/app.rb
|
465
|
+
- lib/rpush/client/active_record/webpush/notification.rb
|
440
466
|
- lib/rpush/client/active_record/wns/app.rb
|
441
467
|
- lib/rpush/client/active_record/wns/badge_notification.rb
|
442
468
|
- lib/rpush/client/active_record/wns/notification.rb
|
@@ -459,6 +485,8 @@ files:
|
|
459
485
|
- lib/rpush/client/redis/notification.rb
|
460
486
|
- lib/rpush/client/redis/pushy/app.rb
|
461
487
|
- lib/rpush/client/redis/pushy/notification.rb
|
488
|
+
- lib/rpush/client/redis/webpush/app.rb
|
489
|
+
- lib/rpush/client/redis/webpush/notification.rb
|
462
490
|
- lib/rpush/client/redis/wns/app.rb
|
463
491
|
- lib/rpush/client/redis/wns/badge_notification.rb
|
464
492
|
- lib/rpush/client/redis/wns/notification.rb
|
@@ -513,6 +541,8 @@ files:
|
|
513
541
|
- lib/rpush/daemon/string_helpers.rb
|
514
542
|
- lib/rpush/daemon/synchronizer.rb
|
515
543
|
- lib/rpush/daemon/tcp_connection.rb
|
544
|
+
- lib/rpush/daemon/webpush.rb
|
545
|
+
- lib/rpush/daemon/webpush/delivery.rb
|
516
546
|
- lib/rpush/daemon/wns.rb
|
517
547
|
- lib/rpush/daemon/wns/badge_request.rb
|
518
548
|
- lib/rpush/daemon/wns/delivery.rb
|
@@ -539,11 +569,13 @@ files:
|
|
539
569
|
- spec/functional/apns_spec.rb
|
540
570
|
- spec/functional/cli_spec.rb
|
541
571
|
- spec/functional/embed_spec.rb
|
572
|
+
- spec/functional/gcm_priority_spec.rb
|
542
573
|
- spec/functional/gcm_spec.rb
|
543
574
|
- spec/functional/new_app_spec.rb
|
544
575
|
- spec/functional/pushy_spec.rb
|
545
576
|
- spec/functional/retry_spec.rb
|
546
577
|
- spec/functional/synchronization_spec.rb
|
578
|
+
- spec/functional/webpush_spec.rb
|
547
579
|
- spec/functional/wpns_spec.rb
|
548
580
|
- spec/functional_spec_helper.rb
|
549
581
|
- spec/spec_helper.rb
|
@@ -560,21 +592,66 @@ files:
|
|
560
592
|
- spec/unit/client/active_record/apns/app_spec.rb
|
561
593
|
- spec/unit/client/active_record/apns/feedback_spec.rb
|
562
594
|
- spec/unit/client/active_record/apns/notification_spec.rb
|
595
|
+
- spec/unit/client/active_record/apns2/app_spec.rb
|
596
|
+
- spec/unit/client/active_record/apns2/notification_spec.rb
|
597
|
+
- spec/unit/client/active_record/apnsp8/notification_spec.rb
|
563
598
|
- spec/unit/client/active_record/app_spec.rb
|
564
599
|
- spec/unit/client/active_record/gcm/app_spec.rb
|
565
600
|
- spec/unit/client/active_record/gcm/notification_spec.rb
|
566
601
|
- spec/unit/client/active_record/notification_spec.rb
|
567
602
|
- spec/unit/client/active_record/pushy/app_spec.rb
|
568
603
|
- spec/unit/client/active_record/pushy/notification_spec.rb
|
604
|
+
- spec/unit/client/active_record/shared/app.rb
|
605
|
+
- spec/unit/client/active_record/shared/notification.rb
|
606
|
+
- spec/unit/client/active_record/webpush/app_spec.rb
|
607
|
+
- spec/unit/client/active_record/webpush/notification_spec.rb
|
569
608
|
- spec/unit/client/active_record/wns/badge_notification_spec.rb
|
570
609
|
- spec/unit/client/active_record/wns/raw_notification_spec.rb
|
571
610
|
- spec/unit/client/active_record/wpns/app_spec.rb
|
572
611
|
- spec/unit/client/active_record/wpns/notification_spec.rb
|
612
|
+
- spec/unit/client/redis/adm/app_spec.rb
|
613
|
+
- spec/unit/client/redis/adm/notification_spec.rb
|
614
|
+
- spec/unit/client/redis/apns/app_spec.rb
|
615
|
+
- spec/unit/client/redis/apns/feedback_spec.rb
|
616
|
+
- spec/unit/client/redis/apns/notification_spec.rb
|
617
|
+
- spec/unit/client/redis/apns2/app_spec.rb
|
618
|
+
- spec/unit/client/redis/apns2/notification_spec.rb
|
619
|
+
- spec/unit/client/redis/apnsp8/notification_spec.rb
|
620
|
+
- spec/unit/client/redis/app_spec.rb
|
621
|
+
- spec/unit/client/redis/gcm/app_spec.rb
|
622
|
+
- spec/unit/client/redis/gcm/notification_spec.rb
|
623
|
+
- spec/unit/client/redis/notification_spec.rb
|
624
|
+
- spec/unit/client/redis/pushy/app_spec.rb
|
625
|
+
- spec/unit/client/redis/pushy/notification_spec.rb
|
626
|
+
- spec/unit/client/redis/webpush/app_spec.rb
|
627
|
+
- spec/unit/client/redis/webpush/notification_spec.rb
|
628
|
+
- spec/unit/client/redis/wns/badge_notification_spec.rb
|
629
|
+
- spec/unit/client/redis/wns/raw_notification_spec.rb
|
630
|
+
- spec/unit/client/redis/wpns/app_spec.rb
|
631
|
+
- spec/unit/client/redis/wpns/notification_spec.rb
|
632
|
+
- spec/unit/client/shared/adm/app.rb
|
633
|
+
- spec/unit/client/shared/adm/notification.rb
|
634
|
+
- spec/unit/client/shared/apns/app.rb
|
635
|
+
- spec/unit/client/shared/apns/feedback.rb
|
636
|
+
- spec/unit/client/shared/apns/notification.rb
|
637
|
+
- spec/unit/client/shared/app.rb
|
638
|
+
- spec/unit/client/shared/gcm/app.rb
|
639
|
+
- spec/unit/client/shared/gcm/notification.rb
|
640
|
+
- spec/unit/client/shared/notification.rb
|
641
|
+
- spec/unit/client/shared/pushy/app.rb
|
642
|
+
- spec/unit/client/shared/pushy/notification.rb
|
643
|
+
- spec/unit/client/shared/webpush/app.rb
|
644
|
+
- spec/unit/client/shared/webpush/notification.rb
|
645
|
+
- spec/unit/client/shared/wns/badge_notification.rb
|
646
|
+
- spec/unit/client/shared/wns/raw_notification.rb
|
647
|
+
- spec/unit/client/shared/wpns/app.rb
|
648
|
+
- spec/unit/client/shared/wpns/notification.rb
|
573
649
|
- spec/unit/configuration_spec.rb
|
574
650
|
- spec/unit/daemon/adm/delivery_spec.rb
|
575
651
|
- spec/unit/daemon/apns/certificate_expired_error_spec.rb
|
576
652
|
- spec/unit/daemon/apns/delivery_spec.rb
|
577
653
|
- spec/unit/daemon/apns/feedback_receiver_spec.rb
|
654
|
+
- spec/unit/daemon/apnsp8/delivery_spec.rb
|
578
655
|
- spec/unit/daemon/app_runner_spec.rb
|
579
656
|
- spec/unit/daemon/batch_spec.rb
|
580
657
|
- spec/unit/daemon/delivery_error_spec.rb
|
@@ -588,11 +665,13 @@ files:
|
|
588
665
|
- spec/unit/daemon/pushy/delivery_spec.rb
|
589
666
|
- spec/unit/daemon/retryable_error_spec.rb
|
590
667
|
- spec/unit/daemon/service_config_methods_spec.rb
|
668
|
+
- spec/unit/daemon/shared/store.rb
|
591
669
|
- spec/unit/daemon/signal_handler_spec.rb
|
592
670
|
- spec/unit/daemon/store/active_record/reconnectable_spec.rb
|
593
671
|
- spec/unit/daemon/store/active_record_spec.rb
|
594
672
|
- spec/unit/daemon/store/redis_spec.rb
|
595
673
|
- spec/unit/daemon/tcp_connection_spec.rb
|
674
|
+
- spec/unit/daemon/webpush/delivery_spec.rb
|
596
675
|
- spec/unit/daemon/wns/delivery_spec.rb
|
597
676
|
- spec/unit/daemon/wns/post_request_spec.rb
|
598
677
|
- spec/unit/daemon/wpns/delivery_spec.rb
|
@@ -601,7 +680,6 @@ files:
|
|
601
680
|
- spec/unit/deprecation_spec.rb
|
602
681
|
- spec/unit/embed_spec.rb
|
603
682
|
- spec/unit/logger_spec.rb
|
604
|
-
- spec/unit/notification_shared.rb
|
605
683
|
- spec/unit/plugin_spec.rb
|
606
684
|
- spec/unit/push_spec.rb
|
607
685
|
- spec/unit/reflectable_spec.rb
|
@@ -615,8 +693,9 @@ metadata:
|
|
615
693
|
bug_tracker_uri: https://github.com/rpush/rpush/issues
|
616
694
|
changelog_uri: https://github.com/rpush/rpush/blob/master/CHANGELOG.md
|
617
695
|
source_code_uri: https://github.com/rpush/rpush
|
696
|
+
rubygems_mfa_required: 'true'
|
618
697
|
post_install_message: |
|
619
|
-
When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations.
|
698
|
+
When upgrading Rpush, don't forget to run `bundle exec rpush init` to get all the latest migrations.
|
620
699
|
|
621
700
|
For details on this specific release, refer to the CHANGELOG.md file.
|
622
701
|
https://github.com/rpush/rpush/blob/master/CHANGELOG.md
|
@@ -627,15 +706,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
627
706
|
requirements:
|
628
707
|
- - ">="
|
629
708
|
- !ruby/object:Gem::Version
|
630
|
-
version: 2.
|
709
|
+
version: 2.4.0
|
631
710
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
632
711
|
requirements:
|
633
712
|
- - ">="
|
634
713
|
- !ruby/object:Gem::Version
|
635
714
|
version: '0'
|
636
715
|
requirements: []
|
637
|
-
rubygems_version: 3.
|
638
|
-
signing_key:
|
716
|
+
rubygems_version: 3.3.5
|
717
|
+
signing_key:
|
639
718
|
specification_version: 4
|
640
719
|
summary: The push notification service for Ruby.
|
641
720
|
test_files:
|
@@ -645,11 +724,13 @@ test_files:
|
|
645
724
|
- spec/functional/apns_spec.rb
|
646
725
|
- spec/functional/cli_spec.rb
|
647
726
|
- spec/functional/embed_spec.rb
|
727
|
+
- spec/functional/gcm_priority_spec.rb
|
648
728
|
- spec/functional/gcm_spec.rb
|
649
729
|
- spec/functional/new_app_spec.rb
|
650
730
|
- spec/functional/pushy_spec.rb
|
651
731
|
- spec/functional/retry_spec.rb
|
652
732
|
- spec/functional/synchronization_spec.rb
|
733
|
+
- spec/functional/webpush_spec.rb
|
653
734
|
- spec/functional/wpns_spec.rb
|
654
735
|
- spec/functional_spec_helper.rb
|
655
736
|
- spec/spec_helper.rb
|
@@ -666,21 +747,66 @@ test_files:
|
|
666
747
|
- spec/unit/client/active_record/apns/app_spec.rb
|
667
748
|
- spec/unit/client/active_record/apns/feedback_spec.rb
|
668
749
|
- spec/unit/client/active_record/apns/notification_spec.rb
|
750
|
+
- spec/unit/client/active_record/apns2/app_spec.rb
|
751
|
+
- spec/unit/client/active_record/apns2/notification_spec.rb
|
752
|
+
- spec/unit/client/active_record/apnsp8/notification_spec.rb
|
669
753
|
- spec/unit/client/active_record/app_spec.rb
|
670
754
|
- spec/unit/client/active_record/gcm/app_spec.rb
|
671
755
|
- spec/unit/client/active_record/gcm/notification_spec.rb
|
672
756
|
- spec/unit/client/active_record/notification_spec.rb
|
673
757
|
- spec/unit/client/active_record/pushy/app_spec.rb
|
674
758
|
- spec/unit/client/active_record/pushy/notification_spec.rb
|
759
|
+
- spec/unit/client/active_record/shared/app.rb
|
760
|
+
- spec/unit/client/active_record/shared/notification.rb
|
761
|
+
- spec/unit/client/active_record/webpush/app_spec.rb
|
762
|
+
- spec/unit/client/active_record/webpush/notification_spec.rb
|
675
763
|
- spec/unit/client/active_record/wns/badge_notification_spec.rb
|
676
764
|
- spec/unit/client/active_record/wns/raw_notification_spec.rb
|
677
765
|
- spec/unit/client/active_record/wpns/app_spec.rb
|
678
766
|
- spec/unit/client/active_record/wpns/notification_spec.rb
|
767
|
+
- spec/unit/client/redis/adm/app_spec.rb
|
768
|
+
- spec/unit/client/redis/adm/notification_spec.rb
|
769
|
+
- spec/unit/client/redis/apns/app_spec.rb
|
770
|
+
- spec/unit/client/redis/apns/feedback_spec.rb
|
771
|
+
- spec/unit/client/redis/apns/notification_spec.rb
|
772
|
+
- spec/unit/client/redis/apns2/app_spec.rb
|
773
|
+
- spec/unit/client/redis/apns2/notification_spec.rb
|
774
|
+
- spec/unit/client/redis/apnsp8/notification_spec.rb
|
775
|
+
- spec/unit/client/redis/app_spec.rb
|
776
|
+
- spec/unit/client/redis/gcm/app_spec.rb
|
777
|
+
- spec/unit/client/redis/gcm/notification_spec.rb
|
778
|
+
- spec/unit/client/redis/notification_spec.rb
|
779
|
+
- spec/unit/client/redis/pushy/app_spec.rb
|
780
|
+
- spec/unit/client/redis/pushy/notification_spec.rb
|
781
|
+
- spec/unit/client/redis/webpush/app_spec.rb
|
782
|
+
- spec/unit/client/redis/webpush/notification_spec.rb
|
783
|
+
- spec/unit/client/redis/wns/badge_notification_spec.rb
|
784
|
+
- spec/unit/client/redis/wns/raw_notification_spec.rb
|
785
|
+
- spec/unit/client/redis/wpns/app_spec.rb
|
786
|
+
- spec/unit/client/redis/wpns/notification_spec.rb
|
787
|
+
- spec/unit/client/shared/adm/app.rb
|
788
|
+
- spec/unit/client/shared/adm/notification.rb
|
789
|
+
- spec/unit/client/shared/apns/app.rb
|
790
|
+
- spec/unit/client/shared/apns/feedback.rb
|
791
|
+
- spec/unit/client/shared/apns/notification.rb
|
792
|
+
- spec/unit/client/shared/app.rb
|
793
|
+
- spec/unit/client/shared/gcm/app.rb
|
794
|
+
- spec/unit/client/shared/gcm/notification.rb
|
795
|
+
- spec/unit/client/shared/notification.rb
|
796
|
+
- spec/unit/client/shared/pushy/app.rb
|
797
|
+
- spec/unit/client/shared/pushy/notification.rb
|
798
|
+
- spec/unit/client/shared/webpush/app.rb
|
799
|
+
- spec/unit/client/shared/webpush/notification.rb
|
800
|
+
- spec/unit/client/shared/wns/badge_notification.rb
|
801
|
+
- spec/unit/client/shared/wns/raw_notification.rb
|
802
|
+
- spec/unit/client/shared/wpns/app.rb
|
803
|
+
- spec/unit/client/shared/wpns/notification.rb
|
679
804
|
- spec/unit/configuration_spec.rb
|
680
805
|
- spec/unit/daemon/adm/delivery_spec.rb
|
681
806
|
- spec/unit/daemon/apns/certificate_expired_error_spec.rb
|
682
807
|
- spec/unit/daemon/apns/delivery_spec.rb
|
683
808
|
- spec/unit/daemon/apns/feedback_receiver_spec.rb
|
809
|
+
- spec/unit/daemon/apnsp8/delivery_spec.rb
|
684
810
|
- spec/unit/daemon/app_runner_spec.rb
|
685
811
|
- spec/unit/daemon/batch_spec.rb
|
686
812
|
- spec/unit/daemon/delivery_error_spec.rb
|
@@ -694,11 +820,13 @@ test_files:
|
|
694
820
|
- spec/unit/daemon/pushy/delivery_spec.rb
|
695
821
|
- spec/unit/daemon/retryable_error_spec.rb
|
696
822
|
- spec/unit/daemon/service_config_methods_spec.rb
|
823
|
+
- spec/unit/daemon/shared/store.rb
|
697
824
|
- spec/unit/daemon/signal_handler_spec.rb
|
698
825
|
- spec/unit/daemon/store/active_record/reconnectable_spec.rb
|
699
826
|
- spec/unit/daemon/store/active_record_spec.rb
|
700
827
|
- spec/unit/daemon/store/redis_spec.rb
|
701
828
|
- spec/unit/daemon/tcp_connection_spec.rb
|
829
|
+
- spec/unit/daemon/webpush/delivery_spec.rb
|
702
830
|
- spec/unit/daemon/wns/delivery_spec.rb
|
703
831
|
- spec/unit/daemon/wns/post_request_spec.rb
|
704
832
|
- spec/unit/daemon/wpns/delivery_spec.rb
|
@@ -707,7 +835,6 @@ test_files:
|
|
707
835
|
- spec/unit/deprecation_spec.rb
|
708
836
|
- spec/unit/embed_spec.rb
|
709
837
|
- spec/unit/logger_spec.rb
|
710
|
-
- spec/unit/notification_shared.rb
|
711
838
|
- spec/unit/plugin_spec.rb
|
712
839
|
- spec/unit/push_spec.rb
|
713
840
|
- spec/unit/reflectable_spec.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Rpush
|
2
|
-
module Client
|
3
|
-
module ActiveModel
|
4
|
-
module Apns
|
5
|
-
class BinaryNotificationValidator < ::ActiveModel::Validator
|
6
|
-
MAX_BYTES = 2048
|
7
|
-
|
8
|
-
def validate(record)
|
9
|
-
return unless record.payload.bytesize > MAX_BYTES
|
10
|
-
record.errors[:base] << "APN notification cannot be larger than #{MAX_BYTES} bytes. Try condensing your alert and device attributes."
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|