rpush 4.1.1 → 5.3.0

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.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +261 -161
  3. data/README.md +103 -17
  4. data/lib/generators/rpush_migration_generator.rb +1 -0
  5. data/lib/generators/templates/rpush.rb +4 -0
  6. data/lib/generators/templates/rpush_4_2_0_updates.rb +10 -0
  7. data/lib/rpush/cli.rb +1 -1
  8. data/lib/rpush/client/active_model.rb +4 -1
  9. data/lib/rpush/client/active_model/adm/data_validator.rb +1 -1
  10. data/lib/rpush/client/active_model/apns/device_token_format_validator.rb +2 -2
  11. data/lib/rpush/client/active_model/apns/notification.rb +9 -1
  12. data/lib/rpush/client/active_model/apns/notification_payload_size_validator.rb +15 -0
  13. data/lib/rpush/client/active_model/apns2/notification.rb +14 -0
  14. data/lib/rpush/client/active_model/gcm/expiry_collapse_key_mutual_inclusion_validator.rb +1 -1
  15. data/lib/rpush/client/active_model/gcm/notification.rb +4 -3
  16. data/lib/rpush/client/active_model/payload_data_size_validator.rb +1 -1
  17. data/lib/rpush/client/active_model/registration_ids_count_validator.rb +1 -1
  18. data/lib/rpush/client/active_model/webpush/app.rb +41 -0
  19. data/lib/rpush/client/active_model/webpush/notification.rb +66 -0
  20. data/lib/rpush/client/active_model/wns/notification.rb +8 -0
  21. data/lib/rpush/client/active_record.rb +4 -0
  22. data/lib/rpush/client/active_record/apns/active_record_serializable_notification.rb +65 -0
  23. data/lib/rpush/client/active_record/apns/notification.rb +1 -29
  24. data/lib/rpush/client/active_record/apns2/notification.rb +4 -1
  25. data/lib/rpush/client/active_record/apnsp8/notification.rb +1 -0
  26. data/lib/rpush/client/active_record/app.rb +1 -1
  27. data/lib/rpush/client/active_record/notification.rb +1 -1
  28. data/lib/rpush/client/active_record/webpush/app.rb +11 -0
  29. data/lib/rpush/client/active_record/webpush/notification.rb +12 -0
  30. data/lib/rpush/client/redis.rb +3 -0
  31. data/lib/rpush/client/redis/apns2/notification.rb +1 -0
  32. data/lib/rpush/client/redis/apnsp8/notification.rb +2 -0
  33. data/lib/rpush/client/redis/notification.rb +2 -1
  34. data/lib/rpush/client/redis/pushy/notification.rb +0 -1
  35. data/lib/rpush/client/redis/webpush/app.rb +15 -0
  36. data/lib/rpush/client/redis/webpush/notification.rb +15 -0
  37. data/lib/rpush/configuration.rb +3 -2
  38. data/lib/rpush/daemon.rb +4 -1
  39. data/lib/rpush/daemon/apns/feedback_receiver.rb +2 -1
  40. data/lib/rpush/daemon/apns2/delivery.rb +13 -2
  41. data/lib/rpush/daemon/apnsp8/delivery.rb +7 -2
  42. data/lib/rpush/daemon/app_runner.rb +1 -1
  43. data/lib/rpush/daemon/batch.rb +12 -5
  44. data/lib/rpush/daemon/delivery.rb +1 -2
  45. data/lib/rpush/daemon/dispatcher/apns_http2.rb +4 -2
  46. data/lib/rpush/daemon/dispatcher/apnsp8_http2.rb +2 -1
  47. data/lib/rpush/daemon/signal_handler.rb +1 -1
  48. data/lib/rpush/daemon/store/active_record.rb +1 -1
  49. data/lib/rpush/daemon/store/active_record/reconnectable.rb +1 -1
  50. data/lib/rpush/daemon/store/redis.rb +1 -1
  51. data/lib/rpush/daemon/webpush.rb +10 -0
  52. data/lib/rpush/daemon/webpush/delivery.rb +114 -0
  53. data/lib/rpush/daemon/wns/badge_request.rb +8 -3
  54. data/lib/rpush/daemon/wns/raw_request.rb +9 -2
  55. data/lib/rpush/daemon/wns/toast_request.rb +6 -2
  56. data/lib/rpush/logger.rb +1 -0
  57. data/lib/rpush/version.rb +3 -3
  58. data/spec/.rubocop.yml +1 -1
  59. data/spec/functional/apns2_spec.rb +97 -2
  60. data/spec/functional/gcm_priority_spec.rb +40 -0
  61. data/spec/functional/webpush_spec.rb +30 -0
  62. data/spec/spec_helper.rb +2 -0
  63. data/spec/support/active_record_setup.rb +3 -1
  64. data/spec/support/simplecov_helper.rb +1 -1
  65. data/spec/unit/client/active_record/adm/app_spec.rb +2 -54
  66. data/spec/unit/client/active_record/adm/notification_spec.rb +2 -39
  67. data/spec/unit/client/active_record/apns/app_spec.rb +3 -26
  68. data/spec/unit/client/active_record/apns/feedback_spec.rb +1 -5
  69. data/spec/unit/client/active_record/apns/notification_spec.rb +29 -288
  70. data/spec/unit/client/active_record/apns2/app_spec.rb +4 -0
  71. data/spec/unit/client/active_record/apns2/notification_spec.rb +65 -0
  72. data/spec/unit/client/active_record/apnsp8/notification_spec.rb +28 -0
  73. data/spec/unit/client/active_record/app_spec.rb +1 -26
  74. data/spec/unit/client/active_record/gcm/app_spec.rb +3 -1
  75. data/spec/unit/client/active_record/gcm/notification_spec.rb +6 -83
  76. data/spec/unit/client/active_record/notification_spec.rb +10 -11
  77. data/spec/unit/client/active_record/pushy/app_spec.rb +2 -13
  78. data/spec/unit/client/active_record/pushy/notification_spec.rb +2 -55
  79. data/spec/unit/client/active_record/shared/app.rb +14 -0
  80. data/spec/unit/{notification_shared.rb → client/active_record/shared/notification.rb} +12 -7
  81. data/spec/unit/client/active_record/webpush/app_spec.rb +6 -0
  82. data/spec/unit/client/active_record/webpush/notification_spec.rb +6 -0
  83. data/spec/unit/client/active_record/wns/badge_notification_spec.rb +1 -11
  84. data/spec/unit/client/active_record/wns/raw_notification_spec.rb +3 -12
  85. data/spec/unit/client/active_record/wpns/app_spec.rb +3 -1
  86. data/spec/unit/client/active_record/wpns/notification_spec.rb +2 -17
  87. data/spec/unit/client/redis/adm/app_spec.rb +5 -0
  88. data/spec/unit/client/redis/adm/notification_spec.rb +5 -0
  89. data/spec/unit/client/redis/apns/app_spec.rb +5 -0
  90. data/spec/unit/client/redis/apns/feedback_spec.rb +5 -0
  91. data/spec/unit/client/redis/apns/notification_spec.rb +50 -0
  92. data/spec/unit/client/redis/apns2/app_spec.rb +4 -0
  93. data/spec/unit/client/redis/apns2/notification_spec.rb +50 -0
  94. data/spec/unit/client/redis/apnsp8/notification_spec.rb +29 -0
  95. data/spec/unit/client/redis/app_spec.rb +5 -0
  96. data/spec/unit/client/redis/gcm/app_spec.rb +5 -0
  97. data/spec/unit/client/redis/gcm/notification_spec.rb +5 -0
  98. data/spec/unit/client/redis/notification_spec.rb +5 -0
  99. data/spec/unit/client/redis/pushy/app_spec.rb +5 -0
  100. data/spec/unit/client/redis/pushy/notification_spec.rb +5 -0
  101. data/spec/unit/client/redis/webpush/app_spec.rb +5 -0
  102. data/spec/unit/client/redis/webpush/notification_spec.rb +5 -0
  103. data/spec/unit/client/redis/wns/badge_notification_spec.rb +5 -0
  104. data/spec/unit/client/redis/wns/raw_notification_spec.rb +22 -0
  105. data/spec/unit/client/redis/wpns/app_spec.rb +5 -0
  106. data/spec/unit/client/redis/wpns/notification_spec.rb +5 -0
  107. data/spec/unit/client/shared/adm/app.rb +51 -0
  108. data/spec/unit/client/shared/adm/notification.rb +39 -0
  109. data/spec/unit/client/shared/apns/app.rb +29 -0
  110. data/spec/unit/client/shared/apns/feedback.rb +9 -0
  111. data/spec/unit/client/shared/apns/notification.rb +262 -0
  112. data/spec/unit/client/shared/app.rb +17 -0
  113. data/spec/unit/client/shared/gcm/app.rb +4 -0
  114. data/spec/unit/client/shared/gcm/notification.rb +77 -0
  115. data/spec/unit/client/shared/notification.rb +10 -0
  116. data/spec/unit/client/shared/pushy/app.rb +17 -0
  117. data/spec/unit/client/shared/pushy/notification.rb +55 -0
  118. data/spec/unit/client/shared/webpush/app.rb +33 -0
  119. data/spec/unit/client/shared/webpush/notification.rb +83 -0
  120. data/spec/unit/client/shared/wns/badge_notification.rb +15 -0
  121. data/spec/unit/client/shared/wns/raw_notification.rb +21 -0
  122. data/spec/unit/client/shared/wpns/app.rb +4 -0
  123. data/spec/unit/client/shared/wpns/notification.rb +18 -0
  124. data/spec/unit/daemon/apns/feedback_receiver_spec.rb +19 -1
  125. data/spec/unit/daemon/batch_spec.rb +50 -2
  126. data/spec/unit/daemon/delivery_spec.rb +10 -0
  127. data/spec/unit/daemon/gcm/delivery_spec.rb +1 -1
  128. data/spec/unit/daemon/shared/store.rb +312 -0
  129. data/spec/unit/daemon/store/active_record/reconnectable_spec.rb +7 -7
  130. data/spec/unit/daemon/store/active_record_spec.rb +7 -295
  131. data/spec/unit/daemon/store/redis_spec.rb +4 -293
  132. data/spec/unit/daemon/webpush/delivery_spec.rb +142 -0
  133. data/spec/unit/daemon/wns/post_request_spec.rb +64 -0
  134. data/spec/unit_spec_helper.rb +3 -0
  135. metadata +140 -13
  136. data/lib/rpush/client/active_model/apns/binary_notification_validator.rb +0 -16
@@ -0,0 +1,142 @@
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 |response_code:|
54
+ let(:response_code) { response_code }
55
+
56
+ shared_examples 'logs' do |deliver_after:|
57
+ let(:expected_log_message) do
58
+ "[MyApp] Webpush endpoint responded with a #{response_code} error. Notification #{notification.id} will be retried after #{deliver_after} (retry 1)."
59
+ end
60
+
61
+ it 'logs that the notification will be retried' do
62
+ delivery.perform
63
+ expect(logger).to have_received(:info).with(expected_log_message)
64
+ end
65
+ end
66
+
67
+ context 'when Retry-After header is present' do
68
+ let(:response_header) { { 'retry-after' => 10 } }
69
+
70
+ before do
71
+ allow(delivery).to receive(:mark_retryable) do
72
+ notification.deliver_after = now + 10.seconds
73
+ notification.retries += 1
74
+ end
75
+ end
76
+
77
+ it 'retry the notification' do
78
+ delivery.perform
79
+ expect(delivery).to have_received(:mark_retryable).with(notification, now + 10.seconds)
80
+ end
81
+
82
+ it_behaves_like 'logs', deliver_after: '2020-10-13 00:00:10'
83
+ it_behaves_like 'process notification'
84
+ end
85
+
86
+ context 'when Retry-After header is not present' do
87
+ before do
88
+ allow(delivery).to receive(:mark_retryable_exponential) do
89
+ notification.deliver_after = now + 2.seconds
90
+ notification.retries = 1
91
+ end
92
+ end
93
+
94
+ it 'retry the notification' do
95
+ delivery.perform
96
+ expect(delivery).to have_received(:mark_retryable_exponential).with(notification)
97
+ end
98
+
99
+ it_behaves_like 'logs', deliver_after: '2020-10-13 00:00:02'
100
+ it_behaves_like 'process notification'
101
+ end
102
+ end
103
+
104
+ it_behaves_like 'retry delivery', response_code: 429
105
+ it_behaves_like 'retry delivery', response_code: 500
106
+ it_behaves_like 'retry delivery', response_code: 502
107
+ it_behaves_like 'retry delivery', response_code: 503
108
+ it_behaves_like 'retry delivery', response_code: 504
109
+
110
+ context 'when delivery failed' do
111
+ let(:response_code) { 400 }
112
+ let(:fail_message) { 'that was a bad request' }
113
+ before do
114
+ allow(response).to receive(:body) { fail_message }
115
+ allow(batch).to receive(:mark_failed)
116
+ end
117
+
118
+ it 'marks the notification as failed' do
119
+ expect { delivery.perform }.to raise_error(Rpush::DeliveryError)
120
+ expected_message = "Unable to deliver notification #{notification.id}, " \
121
+ "received error 400 (Bad Request: #{fail_message})"
122
+ expect(batch).to have_received(:mark_failed).with(notification, 400, expected_message)
123
+ end
124
+
125
+ it_behaves_like 'process notification'
126
+ end
127
+
128
+ context 'when SocketError raised' do
129
+ before do
130
+ allow(http).to receive(:request) { raise SocketError }
131
+ allow(delivery).to receive(:mark_retryable)
132
+ end
133
+
134
+ it 'retry delivery after 10 seconds' do
135
+ expect { delivery.perform }.to raise_error(SocketError)
136
+ expect(delivery).to have_received(:mark_retryable).with(notification, now + 10.seconds, SocketError)
137
+ end
138
+
139
+ it_behaves_like 'process notification'
140
+ end
141
+ end
142
+ end
@@ -30,6 +30,8 @@ describe Rpush::Daemon::Wns::PostRequest do
30
30
  expect(request.body).to include('<toast>')
31
31
  expect(request.body).to include('MyApp')
32
32
  expect(request.body).to include('Example notification')
33
+ # no priority header
34
+ expect { request.fetch('X-WNS-PRIORITY') }.to raise_error(KeyError)
33
35
  end
34
36
 
35
37
  context 'with launch' do
@@ -55,6 +57,29 @@ describe Rpush::Daemon::Wns::PostRequest do
55
57
  end
56
58
  end
57
59
 
60
+ context 'with priority' do
61
+ let(:notification) do
62
+ Rpush::Wns::Notification.create!(
63
+ app: app,
64
+ data: {
65
+ title: "MyApp",
66
+ body: "Example notification"
67
+ },
68
+ uri: "http://some.example/",
69
+ priority: 1
70
+ )
71
+ end
72
+
73
+ it 'creates a request characteristic for toast notification with priority' do
74
+ request = Rpush::Daemon::Wns::PostRequest.create(notification, 'token')
75
+ expect(request['X-WNS-Type']).to eq('wns/toast')
76
+ expect(request['Content-Type']).to eq('text/xml')
77
+ expect(request['X-WNS-PRIORITY']).to eq('1')
78
+ expect(request.body).to include('MyApp')
79
+ expect(request.body).to include('Example notification')
80
+ end
81
+ end
82
+
58
83
  context 'with sound' do
59
84
  let(:notification) do
60
85
  Rpush::Wns::Notification.create!(
@@ -95,6 +120,25 @@ describe Rpush::Daemon::Wns::PostRequest do
95
120
  expect(request['Content-Type']).to eq('application/octet-stream')
96
121
  expect(request.body).to eq("{\"foo\":\"foo\",\"bar\":\"bar\"}")
97
122
  end
123
+
124
+ context 'with priority' do
125
+ let(:notification) do
126
+ Rpush::Wns::RawNotification.create!(
127
+ app: app,
128
+ data: { foo: 'foo', bar: 'bar' },
129
+ uri: "http://some.example/",
130
+ priority: 3
131
+ )
132
+ end
133
+
134
+ it 'creates a request characteristic for raw notification with priority' do
135
+ request = Rpush::Daemon::Wns::PostRequest.create(notification, 'token')
136
+ expect(request['X-WNS-Type']).to eq('wns/raw')
137
+ expect(request['X-WNS-PRIORITY']).to eq('3')
138
+ expect(request['Content-Type']).to eq('application/octet-stream')
139
+ expect(request.body).to eq("{\"foo\":\"foo\",\"bar\":\"bar\"}")
140
+ end
141
+ end
98
142
  end
99
143
 
100
144
  context 'BadgeNotification' do
@@ -113,5 +157,25 @@ describe Rpush::Daemon::Wns::PostRequest do
113
157
  expect(request.body).to include('<badge')
114
158
  expect(request.body).to include('42')
115
159
  end
160
+
161
+ context 'with priority' do
162
+ let(:notification) do
163
+ Rpush::Wns::BadgeNotification.create!(
164
+ app: app,
165
+ uri: "http://some.example/",
166
+ badge: 42,
167
+ priority: 4
168
+ )
169
+ end
170
+
171
+ it 'creates a request characteristic for badge notification with priority' do
172
+ request = Rpush::Daemon::Wns::PostRequest.create(notification, 'token')
173
+ expect(request['X-WNS-Type']).to eq('wns/badge')
174
+ expect(request['X-WNS-PRIORITY']).to eq('4')
175
+ expect(request['Content-Type']).to eq('text/xml')
176
+ expect(request.body).to include('<badge')
177
+ expect(request.body).to include('42')
178
+ end
179
+ end
116
180
  end
117
181
  end
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
  require 'rails'
3
3
 
4
+ # load all shared example files
5
+ Dir["./spec/unit/**/shared/**/*.rb"].sort.each { |f| require f }
6
+
4
7
  def unit_example?(metadata)
5
8
  metadata[:file_path] =~ %r{spec/unit}
6
9
  end
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.1.1
4
+ version: 5.3.0
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: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2021-01-07 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.14'
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.14'
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: '0'
81
+ version: '5.0'
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: '0'
88
+ version: '5.0'
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
@@ -392,6 +412,7 @@ files:
392
412
  - lib/generators/templates/rpush_3_3_1_updates.rb
393
413
  - lib/generators/templates/rpush_4_1_0_updates.rb
394
414
  - lib/generators/templates/rpush_4_1_1_updates.rb
415
+ - lib/generators/templates/rpush_4_2_0_updates.rb
395
416
  - lib/rpush.rb
396
417
  - lib/rpush/apns_feedback.rb
397
418
  - lib/rpush/cli.rb
@@ -400,9 +421,9 @@ files:
400
421
  - lib/rpush/client/active_model/adm/data_validator.rb
401
422
  - lib/rpush/client/active_model/adm/notification.rb
402
423
  - lib/rpush/client/active_model/apns/app.rb
403
- - lib/rpush/client/active_model/apns/binary_notification_validator.rb
404
424
  - lib/rpush/client/active_model/apns/device_token_format_validator.rb
405
425
  - lib/rpush/client/active_model/apns/notification.rb
426
+ - lib/rpush/client/active_model/apns/notification_payload_size_validator.rb
406
427
  - lib/rpush/client/active_model/apns2/app.rb
407
428
  - lib/rpush/client/active_model/apns2/notification.rb
408
429
  - lib/rpush/client/active_model/apnsp8/app.rb
@@ -416,6 +437,8 @@ files:
416
437
  - lib/rpush/client/active_model/pushy/notification.rb
417
438
  - lib/rpush/client/active_model/pushy/time_to_live_validator.rb
418
439
  - lib/rpush/client/active_model/registration_ids_count_validator.rb
440
+ - lib/rpush/client/active_model/webpush/app.rb
441
+ - lib/rpush/client/active_model/webpush/notification.rb
419
442
  - lib/rpush/client/active_model/wns/app.rb
420
443
  - lib/rpush/client/active_model/wns/notification.rb
421
444
  - lib/rpush/client/active_model/wpns/app.rb
@@ -423,6 +446,7 @@ files:
423
446
  - lib/rpush/client/active_record.rb
424
447
  - lib/rpush/client/active_record/adm/app.rb
425
448
  - lib/rpush/client/active_record/adm/notification.rb
449
+ - lib/rpush/client/active_record/apns/active_record_serializable_notification.rb
426
450
  - lib/rpush/client/active_record/apns/app.rb
427
451
  - lib/rpush/client/active_record/apns/feedback.rb
428
452
  - lib/rpush/client/active_record/apns/notification.rb
@@ -436,6 +460,8 @@ files:
436
460
  - lib/rpush/client/active_record/notification.rb
437
461
  - lib/rpush/client/active_record/pushy/app.rb
438
462
  - lib/rpush/client/active_record/pushy/notification.rb
463
+ - lib/rpush/client/active_record/webpush/app.rb
464
+ - lib/rpush/client/active_record/webpush/notification.rb
439
465
  - lib/rpush/client/active_record/wns/app.rb
440
466
  - lib/rpush/client/active_record/wns/badge_notification.rb
441
467
  - lib/rpush/client/active_record/wns/notification.rb
@@ -458,6 +484,8 @@ files:
458
484
  - lib/rpush/client/redis/notification.rb
459
485
  - lib/rpush/client/redis/pushy/app.rb
460
486
  - lib/rpush/client/redis/pushy/notification.rb
487
+ - lib/rpush/client/redis/webpush/app.rb
488
+ - lib/rpush/client/redis/webpush/notification.rb
461
489
  - lib/rpush/client/redis/wns/app.rb
462
490
  - lib/rpush/client/redis/wns/badge_notification.rb
463
491
  - lib/rpush/client/redis/wns/notification.rb
@@ -512,6 +540,8 @@ files:
512
540
  - lib/rpush/daemon/string_helpers.rb
513
541
  - lib/rpush/daemon/synchronizer.rb
514
542
  - lib/rpush/daemon/tcp_connection.rb
543
+ - lib/rpush/daemon/webpush.rb
544
+ - lib/rpush/daemon/webpush/delivery.rb
515
545
  - lib/rpush/daemon/wns.rb
516
546
  - lib/rpush/daemon/wns/badge_request.rb
517
547
  - lib/rpush/daemon/wns/delivery.rb
@@ -538,11 +568,13 @@ files:
538
568
  - spec/functional/apns_spec.rb
539
569
  - spec/functional/cli_spec.rb
540
570
  - spec/functional/embed_spec.rb
571
+ - spec/functional/gcm_priority_spec.rb
541
572
  - spec/functional/gcm_spec.rb
542
573
  - spec/functional/new_app_spec.rb
543
574
  - spec/functional/pushy_spec.rb
544
575
  - spec/functional/retry_spec.rb
545
576
  - spec/functional/synchronization_spec.rb
577
+ - spec/functional/webpush_spec.rb
546
578
  - spec/functional/wpns_spec.rb
547
579
  - spec/functional_spec_helper.rb
548
580
  - spec/spec_helper.rb
@@ -559,16 +591,60 @@ files:
559
591
  - spec/unit/client/active_record/apns/app_spec.rb
560
592
  - spec/unit/client/active_record/apns/feedback_spec.rb
561
593
  - spec/unit/client/active_record/apns/notification_spec.rb
594
+ - spec/unit/client/active_record/apns2/app_spec.rb
595
+ - spec/unit/client/active_record/apns2/notification_spec.rb
596
+ - spec/unit/client/active_record/apnsp8/notification_spec.rb
562
597
  - spec/unit/client/active_record/app_spec.rb
563
598
  - spec/unit/client/active_record/gcm/app_spec.rb
564
599
  - spec/unit/client/active_record/gcm/notification_spec.rb
565
600
  - spec/unit/client/active_record/notification_spec.rb
566
601
  - spec/unit/client/active_record/pushy/app_spec.rb
567
602
  - spec/unit/client/active_record/pushy/notification_spec.rb
603
+ - spec/unit/client/active_record/shared/app.rb
604
+ - spec/unit/client/active_record/shared/notification.rb
605
+ - spec/unit/client/active_record/webpush/app_spec.rb
606
+ - spec/unit/client/active_record/webpush/notification_spec.rb
568
607
  - spec/unit/client/active_record/wns/badge_notification_spec.rb
569
608
  - spec/unit/client/active_record/wns/raw_notification_spec.rb
570
609
  - spec/unit/client/active_record/wpns/app_spec.rb
571
610
  - spec/unit/client/active_record/wpns/notification_spec.rb
611
+ - spec/unit/client/redis/adm/app_spec.rb
612
+ - spec/unit/client/redis/adm/notification_spec.rb
613
+ - spec/unit/client/redis/apns/app_spec.rb
614
+ - spec/unit/client/redis/apns/feedback_spec.rb
615
+ - spec/unit/client/redis/apns/notification_spec.rb
616
+ - spec/unit/client/redis/apns2/app_spec.rb
617
+ - spec/unit/client/redis/apns2/notification_spec.rb
618
+ - spec/unit/client/redis/apnsp8/notification_spec.rb
619
+ - spec/unit/client/redis/app_spec.rb
620
+ - spec/unit/client/redis/gcm/app_spec.rb
621
+ - spec/unit/client/redis/gcm/notification_spec.rb
622
+ - spec/unit/client/redis/notification_spec.rb
623
+ - spec/unit/client/redis/pushy/app_spec.rb
624
+ - spec/unit/client/redis/pushy/notification_spec.rb
625
+ - spec/unit/client/redis/webpush/app_spec.rb
626
+ - spec/unit/client/redis/webpush/notification_spec.rb
627
+ - spec/unit/client/redis/wns/badge_notification_spec.rb
628
+ - spec/unit/client/redis/wns/raw_notification_spec.rb
629
+ - spec/unit/client/redis/wpns/app_spec.rb
630
+ - spec/unit/client/redis/wpns/notification_spec.rb
631
+ - spec/unit/client/shared/adm/app.rb
632
+ - spec/unit/client/shared/adm/notification.rb
633
+ - spec/unit/client/shared/apns/app.rb
634
+ - spec/unit/client/shared/apns/feedback.rb
635
+ - spec/unit/client/shared/apns/notification.rb
636
+ - spec/unit/client/shared/app.rb
637
+ - spec/unit/client/shared/gcm/app.rb
638
+ - spec/unit/client/shared/gcm/notification.rb
639
+ - spec/unit/client/shared/notification.rb
640
+ - spec/unit/client/shared/pushy/app.rb
641
+ - spec/unit/client/shared/pushy/notification.rb
642
+ - spec/unit/client/shared/webpush/app.rb
643
+ - spec/unit/client/shared/webpush/notification.rb
644
+ - spec/unit/client/shared/wns/badge_notification.rb
645
+ - spec/unit/client/shared/wns/raw_notification.rb
646
+ - spec/unit/client/shared/wpns/app.rb
647
+ - spec/unit/client/shared/wpns/notification.rb
572
648
  - spec/unit/configuration_spec.rb
573
649
  - spec/unit/daemon/adm/delivery_spec.rb
574
650
  - spec/unit/daemon/apns/certificate_expired_error_spec.rb
@@ -587,11 +663,13 @@ files:
587
663
  - spec/unit/daemon/pushy/delivery_spec.rb
588
664
  - spec/unit/daemon/retryable_error_spec.rb
589
665
  - spec/unit/daemon/service_config_methods_spec.rb
666
+ - spec/unit/daemon/shared/store.rb
590
667
  - spec/unit/daemon/signal_handler_spec.rb
591
668
  - spec/unit/daemon/store/active_record/reconnectable_spec.rb
592
669
  - spec/unit/daemon/store/active_record_spec.rb
593
670
  - spec/unit/daemon/store/redis_spec.rb
594
671
  - spec/unit/daemon/tcp_connection_spec.rb
672
+ - spec/unit/daemon/webpush/delivery_spec.rb
595
673
  - spec/unit/daemon/wns/delivery_spec.rb
596
674
  - spec/unit/daemon/wns/post_request_spec.rb
597
675
  - spec/unit/daemon/wpns/delivery_spec.rb
@@ -600,7 +678,6 @@ files:
600
678
  - spec/unit/deprecation_spec.rb
601
679
  - spec/unit/embed_spec.rb
602
680
  - spec/unit/logger_spec.rb
603
- - spec/unit/notification_shared.rb
604
681
  - spec/unit/plugin_spec.rb
605
682
  - spec/unit/push_spec.rb
606
683
  - spec/unit/reflectable_spec.rb
@@ -610,7 +687,10 @@ files:
610
687
  homepage: https://github.com/rpush/rpush
611
688
  licenses:
612
689
  - MIT
613
- metadata: {}
690
+ metadata:
691
+ bug_tracker_uri: https://github.com/rpush/rpush/issues
692
+ changelog_uri: https://github.com/rpush/rpush/blob/master/CHANGELOG.md
693
+ source_code_uri: https://github.com/rpush/rpush
614
694
  post_install_message: |
615
695
  When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations.
616
696
 
@@ -630,8 +710,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
630
710
  - !ruby/object:Gem::Version
631
711
  version: '0'
632
712
  requirements: []
633
- rubygems_version: 3.0.3
634
- signing_key:
713
+ rubygems_version: 3.1.4
714
+ signing_key:
635
715
  specification_version: 4
636
716
  summary: The push notification service for Ruby.
637
717
  test_files:
@@ -641,11 +721,13 @@ test_files:
641
721
  - spec/functional/apns_spec.rb
642
722
  - spec/functional/cli_spec.rb
643
723
  - spec/functional/embed_spec.rb
724
+ - spec/functional/gcm_priority_spec.rb
644
725
  - spec/functional/gcm_spec.rb
645
726
  - spec/functional/new_app_spec.rb
646
727
  - spec/functional/pushy_spec.rb
647
728
  - spec/functional/retry_spec.rb
648
729
  - spec/functional/synchronization_spec.rb
730
+ - spec/functional/webpush_spec.rb
649
731
  - spec/functional/wpns_spec.rb
650
732
  - spec/functional_spec_helper.rb
651
733
  - spec/spec_helper.rb
@@ -662,16 +744,60 @@ test_files:
662
744
  - spec/unit/client/active_record/apns/app_spec.rb
663
745
  - spec/unit/client/active_record/apns/feedback_spec.rb
664
746
  - spec/unit/client/active_record/apns/notification_spec.rb
747
+ - spec/unit/client/active_record/apns2/app_spec.rb
748
+ - spec/unit/client/active_record/apns2/notification_spec.rb
749
+ - spec/unit/client/active_record/apnsp8/notification_spec.rb
665
750
  - spec/unit/client/active_record/app_spec.rb
666
751
  - spec/unit/client/active_record/gcm/app_spec.rb
667
752
  - spec/unit/client/active_record/gcm/notification_spec.rb
668
753
  - spec/unit/client/active_record/notification_spec.rb
669
754
  - spec/unit/client/active_record/pushy/app_spec.rb
670
755
  - spec/unit/client/active_record/pushy/notification_spec.rb
756
+ - spec/unit/client/active_record/shared/app.rb
757
+ - spec/unit/client/active_record/shared/notification.rb
758
+ - spec/unit/client/active_record/webpush/app_spec.rb
759
+ - spec/unit/client/active_record/webpush/notification_spec.rb
671
760
  - spec/unit/client/active_record/wns/badge_notification_spec.rb
672
761
  - spec/unit/client/active_record/wns/raw_notification_spec.rb
673
762
  - spec/unit/client/active_record/wpns/app_spec.rb
674
763
  - spec/unit/client/active_record/wpns/notification_spec.rb
764
+ - spec/unit/client/redis/adm/app_spec.rb
765
+ - spec/unit/client/redis/adm/notification_spec.rb
766
+ - spec/unit/client/redis/apns/app_spec.rb
767
+ - spec/unit/client/redis/apns/feedback_spec.rb
768
+ - spec/unit/client/redis/apns/notification_spec.rb
769
+ - spec/unit/client/redis/apns2/app_spec.rb
770
+ - spec/unit/client/redis/apns2/notification_spec.rb
771
+ - spec/unit/client/redis/apnsp8/notification_spec.rb
772
+ - spec/unit/client/redis/app_spec.rb
773
+ - spec/unit/client/redis/gcm/app_spec.rb
774
+ - spec/unit/client/redis/gcm/notification_spec.rb
775
+ - spec/unit/client/redis/notification_spec.rb
776
+ - spec/unit/client/redis/pushy/app_spec.rb
777
+ - spec/unit/client/redis/pushy/notification_spec.rb
778
+ - spec/unit/client/redis/webpush/app_spec.rb
779
+ - spec/unit/client/redis/webpush/notification_spec.rb
780
+ - spec/unit/client/redis/wns/badge_notification_spec.rb
781
+ - spec/unit/client/redis/wns/raw_notification_spec.rb
782
+ - spec/unit/client/redis/wpns/app_spec.rb
783
+ - spec/unit/client/redis/wpns/notification_spec.rb
784
+ - spec/unit/client/shared/adm/app.rb
785
+ - spec/unit/client/shared/adm/notification.rb
786
+ - spec/unit/client/shared/apns/app.rb
787
+ - spec/unit/client/shared/apns/feedback.rb
788
+ - spec/unit/client/shared/apns/notification.rb
789
+ - spec/unit/client/shared/app.rb
790
+ - spec/unit/client/shared/gcm/app.rb
791
+ - spec/unit/client/shared/gcm/notification.rb
792
+ - spec/unit/client/shared/notification.rb
793
+ - spec/unit/client/shared/pushy/app.rb
794
+ - spec/unit/client/shared/pushy/notification.rb
795
+ - spec/unit/client/shared/webpush/app.rb
796
+ - spec/unit/client/shared/webpush/notification.rb
797
+ - spec/unit/client/shared/wns/badge_notification.rb
798
+ - spec/unit/client/shared/wns/raw_notification.rb
799
+ - spec/unit/client/shared/wpns/app.rb
800
+ - spec/unit/client/shared/wpns/notification.rb
675
801
  - spec/unit/configuration_spec.rb
676
802
  - spec/unit/daemon/adm/delivery_spec.rb
677
803
  - spec/unit/daemon/apns/certificate_expired_error_spec.rb
@@ -690,11 +816,13 @@ test_files:
690
816
  - spec/unit/daemon/pushy/delivery_spec.rb
691
817
  - spec/unit/daemon/retryable_error_spec.rb
692
818
  - spec/unit/daemon/service_config_methods_spec.rb
819
+ - spec/unit/daemon/shared/store.rb
693
820
  - spec/unit/daemon/signal_handler_spec.rb
694
821
  - spec/unit/daemon/store/active_record/reconnectable_spec.rb
695
822
  - spec/unit/daemon/store/active_record_spec.rb
696
823
  - spec/unit/daemon/store/redis_spec.rb
697
824
  - spec/unit/daemon/tcp_connection_spec.rb
825
+ - spec/unit/daemon/webpush/delivery_spec.rb
698
826
  - spec/unit/daemon/wns/delivery_spec.rb
699
827
  - spec/unit/daemon/wns/post_request_spec.rb
700
828
  - spec/unit/daemon/wpns/delivery_spec.rb
@@ -703,7 +831,6 @@ test_files:
703
831
  - spec/unit/deprecation_spec.rb
704
832
  - spec/unit/embed_spec.rb
705
833
  - spec/unit/logger_spec.rb
706
- - spec/unit/notification_shared.rb
707
834
  - spec/unit/plugin_spec.rb
708
835
  - spec/unit/push_spec.rb
709
836
  - spec/unit/reflectable_spec.rb