Skip to content

Conversation

@daniellevass
Copy link
Contributor

@daniellevass daniellevass commented Apr 7, 2020

What

This is everything for private encrypted channels.

The PrivateEncryptedChannelExampleApp works as intended, and I have confirmed that it also works in an Android app:

private encrypted channel recording

todo

  • update versions inside lib
  • update changelog
  • update readme
  • update docs

marekoid and others added 30 commits March 23, 2020 16:53
Copied relevant bits for our decryption needs from:
https://github.com/freeeve/nacl-java/blob/0369ed1b166591db9f7a2d511a3554c2376871dd/src/main/java/com/caligochat/nacl/SecretBox.java
adjusting the entry point to take the key in the constructor,
have preconditions checked and better signalling AuthenticityException,
and added the clearKey method.

Added MIT License to the copied files.
Add NaCl's symmetric key authenticated decryption code
Add Truth assertion lib — approved by Mike.
Improve naming

Follow up Mike's feedback:
#236 (comment)
As it's not a temporary store for I/O.
Simplify exclude rules making it more clear they refer
to package names not file paths relative to project's root.
Add a test for crypto authenticity failure
Those are automatic IntelliJ's proposed fixes.
Fix warnings about manual array copying
* Add a PrivateEncryptedChannel

* Add an example PrivateEncryptedChannel app

* Ensure the PrivateEncryptedChannelImpl prepares itself before subscribing

* Add tests for the PrivateEncryptedChannelImpl prepare method

* Save PrivateEncryptedChannel shared secret to the secretbox and clear when unsubscribing

* PrivateEncryptedChannelImpl handle sharedSecret better

* Save the auth token more securely in the PrivateEncryptedChannelImpl

* Remove empty line in ChannelManager

* Use Marek's base64 decode to decode the shared secret

* Make the PrivateEncryptedChannelImpl error message more clear

* Fix PrivateEncryptedChannelImpl raising the correct exceptions

* Update the PrivateEncryptedChannelImplTest to check we're raising the correct exceptions

* Add space character in Pusher.java when creating a PrivateEncryptedChannelImpl

* Keep the auth token in an byte array for as long as possible in PrivateEncryptedChannelImpl

* Update src/main/java/com/pusher/client/channel/PrivateEncryptedChannel.java

Co-Authored-By: Marek <[email protected]>

* Update src/main/java/com/pusher/client/channel/PrivateEncryptedChannelEventListener.java

Co-Authored-By: Marek <[email protected]>

* Refactor new pieces to fit 100 characters maxline length better

* Remove rogue space character in PrivateEncrptedChanneImplTest

* Remove PrivateEncryptedChannel custom method calls from the ChannelManager

* Make the PrivateEncryptedChannelEventListener extend PrivateChannelEventListener

* Refactor clearDownSubscription to handleAuthenticationFailure

* Update src/main/java/com/pusher/client/channel/impl/PrivateEncryptedChannelImpl.java

Co-Authored-By: Marek <[email protected]>

* Refactor PrivateEncryptedChannelImpl prepareChannel to checkAuthentication

* Refactor PrivateEncryptedChannelImplTest

* Refactor PrivateEncryptedChannelImplTest titles and valid authorizer

* Import Base64 util in PrivateEncryptedChannelImpl properly

* Refactor Arrays.fill to fill for readability improvement

* Refactor PrivateEncryptedChannelImpl to remove channelData

* Don't log any secret info

* Refactor unit tests for PrivateEncryptedChannelImpl to assert throws errors differently

* Add private-encrypted channel name tests

* Make the PrivateEncryptedChannelImplTests extend the ChannelImplTest and implement overrides

* Fix PrivateEncryptedChannelImplTest for testReturnsCorrectSubscribeMessage

* Fix PrivateEncryptedChannelImplTests for unsubscribing

* Add Tests for SecretBoxOpener

* Update AuthorizationFailureException in PrivateEncryptedChannelImpl

* Update src/test/java/com/pusher/client/channel/impl/PrivateEncryptedChannelImplTest.java

Co-Authored-By: Marek <[email protected]>

* wip for gson deserialising

* Put the PrivateEncryptedChannelImpl authoriser data back to String

* Add dash to the end of ChannelManager to check for private-encrypted-

* Add dash to the end of ChannelManager to check for private-encrypted-

* Remove the demo apikey

* Ensure getDisallowedNameExpression ends with dash

* Remove unused imports and comments

* Rename checkAuthentication to authenticate and make private

* Use auth consistently

* Add SecretBoxOpenerFactory

* Make auth a String

Co-authored-by: Marek <[email protected]>
marekoid and others added 18 commits April 3, 2020 17:31
Consistently tidy up PrivateEncryptedChannelImplTest
Add clearing of shared secret on disconnected
…ges get a retry to the authorization endpoint
@daniellevass daniellevass self-assigned this Apr 7, 2020
daniellevass and others added 4 commits April 7, 2020 16:06
* add some Private Encrypted Channels docs

* Update Private Encrypted Channels docs

* Feedback to docs

* Document the example app better

* Feedback on docs

* Delete duplicated parts of the docs
/**
* Interface to listen to private encrypted channel events.
* Note: This needs to extend the PrivateChannelEventListener because of the ChannelManager clearDownSubscription
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment should be updated to say handleAuthenticationFailure as we refactored that method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated.

@daniellevass daniellevass marked this pull request as ready for review April 8, 2020 11:08
@daniellevass daniellevass requested a review from mdpye April 8, 2020 11:25
@daniellevass daniellevass merged commit 979d537 into master Apr 8, 2020
@daniellevass daniellevass deleted the decrypt-integration branch April 8, 2020 13:45
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.

4 participants