You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
next
2
+
====
3
+
4
+
* Added EncryptionMasterKeyBase64 parameter
5
+
* Deprecated EncryptionMasterKey parameter
6
+
1
7
4.0.0 / 2019-05-31
2
8
==================
3
9
* This release modifies the entire repo to respect the go linter. This is a significant API breaking change and will likely require you to correct references to the names that were changed in your code. All future releases will respect the linter. A summary of the changes:
Copy file name to clipboardExpand all lines: README.md
+25-16
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@ By default, this is `"api.pusherapp.com"`.
138
138
139
139
Setting the `pusher.Client`'s `Cluster` property will make sure requests are sent to the cluster where you created your app.
140
140
141
-
*NOTE! If `Host` is set then `Cluster` will be ignored.
141
+
*NOTE! If `Host` is set then `Cluster` will be ignored.*
142
142
143
143
```go
144
144
pusherClient.Cluster = "eu"// in this case requests will be made to api-eu.pusher.com.
@@ -149,26 +149,37 @@ This library supports end to end encryption of your private channels. This means
149
149
150
150
1. You should first set up Private channels. This involves [creating an authentication endpoint on your server](https://pusher.com/docs/authenticating_users).
151
151
152
-
2. Next, Specify your 32 character `EncryptionMasterKey`. This is secret and you should never share this with anyone. Not even Pusher.
152
+
2. Next, generate a 32 byte master encryption key, base64 encode it and store
3. Channels where you wish to use end to end encryption should be prefixed with `private-encrypted-`.
155
+
This is secret and you should never share this with anyone. Not even Pusher.
156
+
157
+
To generate a suitable key from a secure random source, you could use:
164
158
165
-
4. Subscribe to these channels in your client, and you're done! You can verify it is working by checking out the debug console on the https://dashboard.pusher.com/ and seeing the scrambled ciphertext.
159
+
```bash
160
+
openssl rand -base64 32
161
+
```
162
+
163
+
3. Pass the encoded key when constructing your pusher.Client
164
+
165
+
```go
166
+
pusherClient:= pusher.Client{
167
+
AppID: "APP_ID",
168
+
Key: "APP_KEY",
169
+
Secret: "APP_SECRET",
170
+
Cluster: "APP_CLUSTER",
171
+
EncryptionMasterKeyBase64"<output from command above>",
172
+
}
173
+
```
174
+
4. Channels where you wish to use end to end encryption should be prefixed with `private-encrypted-`.
175
+
176
+
5. Subscribe to these channels in your client, and you're done! You can verify it is working by checking out the debug console on the https://dashboard.pusher.com/ and seeing the scrambled ciphertext.
166
177
167
178
**Important note: This will not encrypt messages on channels that are not prefixed by private-encrypted-.**
168
179
169
180
### Google App Engine
170
181
171
-
As of version 1.0.0, this library is compatible with Google App Engine's urlfetch library. Simply pass in the HTTP client returned by `urlfetch.Client` to your Pusher Channels initialization struct.
182
+
As of version 1.0.0, this library is compatible with Google App Engine's urlfetch library. Pass in the HTTP client returned by `urlfetch.Client` to your Pusher Channels initialization struct.
172
183
173
184
```go
174
185
package helloworldapp
@@ -613,8 +624,6 @@ Feel more than free to fork this repo, improve it in any way you'd prefer, and s
returnnil, errors.New("Do not specify both EncryptionMasterKey and EncryptionMasterKeyBase64. EncryptionMasterKey is deprecated, specify only EncryptionMasterKeyBase64")
516
+
}
517
+
518
+
ifc.EncryptionMasterKey!="" {
519
+
iflen(c.EncryptionMasterKey) !=32 {
520
+
returnnil, errors.New("EncryptionMasterKey must be 32 bytes. It is also deprecated, use EncryptionMasterKeyBase64")
0 commit comments