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
The lack of a constructor for the Client type made this unnecessarily
complicated and late failing, but it is compatible
At next major version, let's introduce one.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
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
+23-12Lines changed: 23 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -149,20 +149,31 @@ 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:
158
+
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-`.
164
175
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.
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-.**
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