Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End-to-end encryption support #264

Merged
merged 76 commits into from
Apr 24, 2020
Merged

End-to-end encryption support #264

merged 76 commits into from
Apr 24, 2020

Conversation

TomKemp
Copy link
Contributor

@TomKemp TomKemp commented Apr 22, 2020

This PR adds support for end-to-end encryption by introducing a new PusherSwiftWithEncryption target.

This PR also:

  • Adds "Consumption Tests" to ensure the library can incorporated into projects using the minimum and maximum supported Swift version and deployment targets. Both PusherSwift and PusherSwiftWithEncryption are tested. Currently, these can only run locally.
  • Increases the minimum deployment target for macOS to 10.11 due to the minimum deployment target of the Sodium dependency.
  • Upgrades the Swift version to Swift 5.0 and bumps Reachability/Starscream dependencies accordingly.
  • Renames the encrypted config option to useTLS in order make it clear that option isn't related to end-to-end encryption.

There are breaking changes in this PR (the minimum deployment target bump and the config option change) so the changes will be released as a new major version.

OliverPearmain-Pusher and others added 30 commits March 24, 2020 10:53
…d from an event but at present its necessary to hardcode your decryption key which in future will be provided in the auth response from the server.
…oad of Pusher 'System' events (that have event names prefixed "pusher:" or "pusher_internal:")
…kspace/projects are setup so that the demo apps copy the Carthage frameworks.
…toSwift convenience functions which are unavilable now that CryptoSwift has been removed.
Store shared secret for private encrypted channels
* Removed empty Images.xcassets reference from`iOS Example Swift.xcodeproj`

* Consumption-test: Added shared code

* Consumption-tests: adding .gitignore

* Consumption-tests: adding first pass at Carthage tests.

* Consumption-tests: add macOS targets.

* Consumption-tests: resolved a couple of build warnings.

* Consumption-tests: updated scripts so they can be executed from any directory,

* Consumption-tests: adding `Carthage-MinimumXcode` for testing Xcode 11.

* Consumption-tests: moved important build settings into xcconfig.

* Consumption-tests: renamed Carthage-LatestXcode to Carthage-Latest and Carthage-MinimumXcode to Carthage-Minimum (since they verify more than just the Xcode version, also swift versions and deployment_targets)

* Consumption-tests: introduced a `config.xconfig` to shortcut to X_SUPPORTED_VERSIONS.xcconfig because this means that the xcodeproj's are identical and can be copied and pasted.

* Consumption-tests: added `run-tests-LOCALLY.sh`

* Consumption-tests: added `say` command for Xcode missing failure.

* Consumption-tests: updated projects so that `carthage-copy-platform-specific-frameworks.sh` is only invoked if its a Carthage based project (this will allow us to use the same project for Cocoapods).

* Consumption-tests: fixed `carthage-checkout.sh` in the event that working copy is clean.

* Consumption-tests: TEMPORARILY removed tvOS support so that things actually compile successfully.

* Consumption-tests:  ensure script exits with error code so a calling script does not continue if carthage update fails.

* Consumption-tests:  improved console output (so its clearer which test/scheme failed)

* Consumption-tests:  corrected accidental check in.

* Consumption-tests: added `-allowProvisioningUpdates` flag to `xcodebuild` so that it pulls latest provisioning profiles from Apple.

* Consumption-tests: moved `assignXcodeAppPathFor` function into dedicated file so it can be shared between scripts.

* Consumption-tests: added option of specifying flags with the `run-tests-LOCALLY.sh` script to skip certain aspects.

* Consumption-tests: rijigged some of the script operations in preparation of adding Cocoapods support.

* Consumption-tests: removed Carthage specific FRAMEWORK_SEARCH_PATHS out of project and into xcconfig.

* Consumption-tests: simplified checkout.sh scripts.

* Consumption-tests: removed hardcoding of X_SUPPORTED_XCODE_VERSION in favour of deriving the value from the directory name.

* Consumption-tests: further removal of hardcoded X_SUPPORTED_XCODE_VERSION in favour of deriving the value from the directory name.  Has allowed me to get rid of some scripts altogether.

* Consumption-tests: added Cocoapods-Latest support.

* *** Because Sodium has a MACOSX_DEPLOYMENT_TARGET of 10.11 we must increase our MACOSX_DEPLOYMENT_TARGET to 10.11. ***

* Consumption-tests: added Cocoapods-Minimum support.

* Consumption-tests: removed explicit reference to PusherSwift.framework from the projects.  This means all the projects are identical.

* Added `PusherSwiftWithEncryption` target/framework.

* Updated .travis.yml to use `xcode11`

* Updated SUPPORTED_PLATFORMS so that PusherSwift supports iOS, macOS and tvOS but PusherSwiftWithEncryption only supports iOS & macOS (since Sodium doesn't work with tvOS).

* Updated simulator device now we're using Xcode 11.

* Consumption-tests: Added *-WithEncryption support.

* Removed all DEPLOYMENT_TARGET values from *targets* because it is already defined in the *project* settings.

* Consumption-tests: removed `pod deintegrate` step because this was causing the project files to change on every run (and pollute the working copy)

* Consumption-tests: removed "Recovered References" from projects.

* Consumption-tests: Added SwiftPackageManager support.

* Removed `Sodium` from list of copied Carthage frameworks in `PusherSwiftTests` since its no longer used.  This was causing the tvOS tests to fail.

* Updated README.md to say that only Xcode 11 and above is supported.

* First draft of `Consumption-Tests/README.md`

* Further updates to `Consumption-Tests/README.md`

* `Consumption-Tests/README.md` anchor fixes.

* `Consumption-Tests/README.md` anchor fixes.

* Consumption-tests: Added scripts for CI.

* Removed tvos `PusherSwiftWithEncryption.podspec` since this framework does not support tvOS.

* Updated SWIFT_VERSION to 4.2 since this is what we say we support in the main README.md.  Also improvements to `Consumption-Tests/README.md`.

* Fixed a small issue with updating SWIFT_VERSION to 4.2

* Add tvOS tests (#250)

* Consumption-tests: fixed issues where certain DEPLOYMENT_TARGETs were harcoded in the project file and therefore not being derived from the xcconfig.  This has resolved the weird issue with not being able set the latest IPHONEOS_DEPLOYMENT_TARGET higher than 10.

* Consumption-tests: The previous commit/fix has also resolved an issue I was having with Cocoapods and has allow me to remove the custom setting of `MACOSX_DEPLOYMENT_TARGET`.

Co-authored-by: Oliver Pearmain <oliverpearmain@gmail.com>
Co-authored-by: Tom Kemp <TomKemp@users.noreply.github.com>
…cket-swift into e2e-functional-tests

* 'e2e-functional-tests' of github.com:pusher/pusher-websocket-swift:
  Add test for subscribing to private encrypted channel
@TomKemp TomKemp requested review from daniellevass and mdpye April 22, 2020 15:35
@codecov-io
Copy link

codecov-io commented Apr 24, 2020

Codecov Report

Merging #264 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #264   +/-   ##
=======================================
  Coverage   89.53%   89.53%           
=======================================
  Files          39       39           
  Lines        3411     3411           
=======================================
  Hits         3054     3054           
  Misses        357      357           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bda777d...bda777d. Read the comment docs.

@TomKemp TomKemp requested review from mdpye and daniellevass April 24, 2020 14:09
README.md Outdated Show resolved Hide resolved
Co-Authored-By: Mike Pye <mail@mdpye.co.uk>
@TomKemp TomKemp merged commit bcfd351 into master Apr 24, 2020
@TomKemp TomKemp deleted the e2e branch April 24, 2020 15:32
Kory2019 added a commit to swaglive/pusher-websocket-swift that referenced this pull request Jul 27, 2020
* pusher-master:
  Fixed a few typos in README (pusher#271)
  Clarify Carthage frameworks in README (pusher#268)
  Remove beta label from private encrypted channel docs (pusher#267)
  v8.0.0
  Temporary message (pusher#266)
  Disable extension safe API for WithEncryption (pusher#265)
  End-to-end encryption support (pusher#264)

# Conflicts:
#	PusherSwift.podspec
#	PusherSwift.xcodeproj/project.pbxproj
#	Sources/PusherConnection.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants