rpush 2.0.0 → 2.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 +4 -0
- data/README.md +8 -10
- data/lib/generators/templates/rpush.rb +4 -0
- data/lib/generators/templates/rpush_2_0_0_updates.rb +1 -1
- data/lib/rpush/daemon/tcp_connection.rb +6 -0
- data/lib/rpush/reflection.rb +1 -1
- data/lib/rpush/version.rb +1 -1
- data/spec/unit/daemon/tcp_connection_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ba458f1bce103da495d96eb5c823d75a8dbb65
|
4
|
+
data.tar.gz: 39fd41cb301888ba9e93f6b01a76b3688ed2cf08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6818f8d0a1adc9990e1d7f28b2a4b4299ab1d38a9f43be7b23eb281a74d2743d72ab4bbc75dc7cf51c610afee9160f77ef2a929d344570d64f6da58053e6979
|
7
|
+
data.tar.gz: 1eb53814eefda8f89a74f97dc85d7f8d54ff679041eb81ce1793c18be91655f7aae2e5518fceeaf61ad3ffbb127664a0b9e5446db2c307c67ff75e22ec8921ef
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 2.0.1 (Sept 13, 2014)
|
2
|
+
* Add ssl_certificate_revoked reflection (#68).
|
3
|
+
* Fix for Postgis support in 2.0.0 migration (#70).
|
4
|
+
|
1
5
|
## 2.0.0 (Sept 6, 2014)
|
2
6
|
* Use APNs enhanced binary format version 2.
|
3
7
|
* Support running multiple Rpush processes when using ActiveRecord and Redis.
|
data/README.md
CHANGED
@@ -8,19 +8,17 @@
|
|
8
8
|
### Rpush. The push notification service for Ruby.
|
9
9
|
|
10
10
|
* Supported services:
|
11
|
-
* **Apple Push Notification Service**
|
12
|
-
* **Google Cloud Messaging**
|
13
|
-
* **Amazon Device Messaging**
|
14
|
-
* **Windows Phone Push Notification Service**
|
15
|
-
|
11
|
+
* [**Apple Push Notification Service**](#apple-push-notification-service)
|
12
|
+
* [**Google Cloud Messaging**](#google-cloud-messaging)
|
13
|
+
* [**Amazon Device Messaging**](#amazon-device-messaging)
|
14
|
+
* [**Windows Phone Push Notification Service**](#windows-phone-notification-service)
|
16
15
|
|
17
16
|
* Supported storage backends:
|
18
|
-
* ActiveRecord
|
19
|
-
* Redis
|
20
|
-
* More coming
|
21
|
-
|
17
|
+
* **ActiveRecord**
|
18
|
+
* **Redis**
|
19
|
+
* More coming!
|
22
20
|
|
23
|
-
* Seamless Rails (3
|
21
|
+
* Seamless Rails integration (3 & 4) .
|
24
22
|
* Scales vertically (threading) and horizontally (multiple processes).
|
25
23
|
* Designed for uptime - new apps are loaded automatically, signal `HUP` to update running apps.
|
26
24
|
* Run as a daemon or inside an [existing process](https://github.com/rpush/rpush/wiki/Embedding-API).
|
@@ -106,6 +106,10 @@ Rpush.reflect do |on|
|
|
106
106
|
# on.ssl_certificate_will_expire do |app, expiration_time|
|
107
107
|
# end
|
108
108
|
|
109
|
+
# Called when an SSL certificate has been revoked.
|
110
|
+
# on.ssl_certificate_revoked do |app, error|
|
111
|
+
# end
|
112
|
+
|
109
113
|
# Called when the ADM returns a canonical registration ID.
|
110
114
|
# You will need to replace old_id with canonical_id in your records.
|
111
115
|
# on.adm_canonical_id do |old_id, canonical_id|
|
@@ -108,6 +108,12 @@ module Rpush
|
|
108
108
|
ssl_socket.sync = true
|
109
109
|
ssl_socket.connect
|
110
110
|
[tcp_socket, ssl_socket]
|
111
|
+
rescue StandardError => error
|
112
|
+
if error.message =~ /certificate revoked/i
|
113
|
+
log_warn('Certificate has been revoked.')
|
114
|
+
reflect(:ssl_certificate_revoked, @app, error)
|
115
|
+
end
|
116
|
+
raise
|
111
117
|
end
|
112
118
|
|
113
119
|
def check_certificate_expiration
|
data/lib/rpush/reflection.rb
CHANGED
@@ -15,7 +15,7 @@ module Rpush
|
|
15
15
|
:notification_failed, :notification_will_retry, :gcm_delivered_to_recipient,
|
16
16
|
:gcm_failed_to_recipient, :gcm_canonical_id, :gcm_invalid_registration_id,
|
17
17
|
:error, :adm_canonical_id, :adm_failed_to_recipient,
|
18
|
-
:tcp_connection_lost, :ssl_certificate_will_expire,
|
18
|
+
:tcp_connection_lost, :ssl_certificate_will_expire, :ssl_certificate_revoked,
|
19
19
|
:notification_id_will_retry, :notification_id_failed
|
20
20
|
]
|
21
21
|
|
data/lib/rpush/version.rb
CHANGED
@@ -113,6 +113,23 @@ describe Rpush::Daemon::TcpConnection do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
describe 'certificate revocation' do
|
118
|
+
let(:cert_revoked_error) { OpenSSL::SSL::SSLError.new('certificate revoked') }
|
119
|
+
before do
|
120
|
+
ssl_socket.stub(:connect).and_raise(cert_revoked_error)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'reflects that the certificate has been revoked' do
|
124
|
+
connection.should_receive(:reflect).with(:ssl_certificate_revoked, app, cert_revoked_error)
|
125
|
+
expect { connection.connect }.to raise_error(cert_revoked_error)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'logs that the certificate has been revoked' do
|
129
|
+
logger.should_receive(:warn).with('[Connection 0] Certificate has been revoked.')
|
130
|
+
expect { connection.connect }.to raise_error(cert_revoked_error)
|
131
|
+
end
|
132
|
+
end
|
116
133
|
end
|
117
134
|
|
118
135
|
describe "when shuting down the connection" do
|
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: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|