Skip to content

Commit

Permalink
v8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TomKemp authored Apr 27, 2020
1 parent 67aedfd commit c1214f8
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/pusher/pusher-websocket-swift/compare/7.2.0...HEAD)
## [Unreleased](https://github.com/pusher/pusher-websocket-swift/compare/8.0.0...HEAD)

## [8.0.0](https://github.com/pusher/pusher-websocket-swift/compare/7.2.0...8.0.0) - 2020-04-27

### Added

- Added support for [end-to-end encryption](https://pusher.com/docs/channels/using_channels/encrypted-channels). There is a new target: `PusherSwiftWithEncryption` and a new dependency for that target `Sodium`. The original `PusherSwift` target does not require `Sodium` and has all the same features as `PusherSwiftWithEncryption` except the ability to decrypt events. You can find details about how to use `PusherSwiftWithEncryption` in the [README](https://github.com/pusher/pusher-websocket-swift#private-encrypted-channels-beta). As part of this feature, there is a new function in the `PusherDelegate`: `failedToDecryptEvent`, and channel names prefixed with `private-encrypted-` are now interpreted as encrypted channels in both targets.

### Changed

- The `encrypted` parameter for `PusherClientOptions` has been renamed to `useTLS`. Its behavior and default value (`true`) are unchanged.
- Updated to Swift 5.0 and updated dependencies ([@JonathanDowning](https://github.com/JonathanDowning)).

### Removed

- CryptoSwift is no longer a dependency.

## [7.2.0](https://github.com/pusher/pusher-websocket-swift/compare/7.1.0...7.2.0) - 2019-10-18

Expand Down
2 changes: 1 addition & 1 deletion PusherSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'PusherSwift'
s.version = '7.2.0'
s.version = '8.0.0'
s.summary = 'A Pusher client library in Swift'
s.homepage = 'https://github.com/pusher/pusher-websocket-swift'
s.license = 'MIT'
Expand Down
2 changes: 1 addition & 1 deletion PusherSwiftWithEncryption.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'PusherSwiftWithEncryption'
s.version = '7.2.0'
s.version = '8.0.0'
s.summary = 'A Pusher client library in Swift that supports encrypted channels'
s.homepage = 'https://github.com/pusher/pusher-websocket-swift'
s.license = 'MIT'
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

pod 'PusherSwift', '~> 7.2'
pod 'PusherSwift', '~> 8.0'
```

Then, run the following command:
Expand Down Expand Up @@ -141,7 +141,7 @@ let package = Package(
targets: ["YourPackage"]),
],
dependencies: [
.package(url: "https://github.com/pusher/pusher-websocket-swift.git", from: "7.2.0"),
.package(url: "https://github.com/pusher/pusher-websocket-swift.git", from: "8.0.0"),
],
targets: [
.target(
Expand Down Expand Up @@ -618,15 +618,19 @@ Subscribing to private channels involves the client being authenticated. See the
Similar to Private channels, you can also subscribe to a [private encrypted channel](https://pusher.com/docs/channels/using_channels/encrypted-channels). This library now fully supports end-to-end encryption. This means that only you and your connected clients will be able to read your messages. Pusher cannot decrypt them.
Like with private channels, you must provide an authentication endpoint. That endpoint must be using a [server client that supports end-to-end encryption](https://pusher.com/docs/channels/using_channels/encrypted-channels#server). There is a [demonstration endpoint to look at using nodejs](https://github.com/pusher/pusher-channels-auth-example#using-e2e-encryption). The shared secret used to decrypt events is loaded from the same auth endpoint request that is used to authorize your subscription. There is also a mechanism for reloading the shared secret if your encryption master key changes. If an event is encountered that cannot be decrypted, a request is made to your auth endpoint to attempt to load the new shared secret. If that request fails or if the returned secret still cannot decrypt the event then that event will be skipped, the `failedToDecryptEvent` connection delegate function will be called, and the next received event will be processed. Because of the requirement to reload the shared secret on demand, you can only use the following [auth method](#configuration): `endpoint`, `authRequestBuilder`, `authorizer`. It is not possible to pass an instance of `PusherAuth` to the `subscribe` function if you are subscribing to an encrypted channel.
Like with private channels, you must provide an authentication endpoint. That endpoint must be using a [server client that supports end-to-end encryption](https://pusher.com/docs/channels/using_channels/encrypted-channels#server). There is a [demonstration endpoint to look at using nodejs](https://github.com/pusher/pusher-channels-auth-example#using-e2e-encryption).
The shared secret used to decrypt events is loaded from the same auth endpoint request that is used to authorize your subscription. There is also a mechanism for reloading the shared secret if your encryption master key changes. If an event is encountered that cannot be decrypted, a request is made to your auth endpoint to attempt to load the new shared secret. If that request fails or if the returned secret still cannot decrypt the event then that event will be skipped, the `failedToDecryptEvent` connection delegate function will be called, and the next received event will be processed.
Because of the requirement to reload the shared secret on demand, you can only use the following [auth method](#configuration): `endpoint`, `authRequestBuilder`, `authorizer`. It is not possible to pass an instance of `PusherAuth` to the `subscribe` function if you are subscribing to an encrypted channel.
### Installation
#### CocoaPods
Importing using CocoaPods will require a separate pod which has not yet been published.
Update your podfile to include `PusherSwiftWithEncryption` instead of `PusherSwift`.
#### Carthage
You do not need to change your Cartfile. However, you will need to import the `PusherSwiftWithEncryption` framework into your project, instead of PusherSwift. You will also need to import the `Sodium` framework into your project.
You do not need to change your Cartfile. However, you will need to import the `PusherSwiftWithEncryption` framework into your project, instead of `PusherSwift`. You will also need to import the `Sodium` framework into your project.
#### Swift Package Manager
PusherSwiftWithEncryption is not yet compatible with the Swift Package Manager.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>7.2.0</string>
<string>8.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/PusherSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Starscream

let PROTOCOL = 7
let VERSION = "7.2.0"
let VERSION = "8.0.0"
let CLIENT_NAME = "pusher-websocket-swift"

@objcMembers
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>7.2.0</string>
<string>8.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Tests/PusherClientInitializationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import XCTest
@testable import PusherSwift
#endif

let VERSION = "7.2.0"
let VERSION = "8.0.0"

class ClientInitializationTests: XCTestCase {
var key: String!
Expand Down

0 comments on commit c1214f8

Please sign in to comment.