Commit Graph

146 Commits

Author SHA1 Message Date
Samuel Hawksby-Robinson 5a993e8f98 Added functionality to slow stop UDP beacon multicast/listen 2023-04-17 12:01:38 +01:00
Samuel Hawksby-Robinson 552c58bb9c Intergrated with external API endpoint 2023-04-17 12:01:38 +01:00
Samuel Hawksby-Robinson 419700f2c3 Improved separation of concerns, added more robust tests 2023-04-17 12:01:38 +01:00
Samuel Hawksby-Robinson 0177e10c15 Refined local pairing peer discovery architecture 2023-04-17 12:01:38 +01:00
Samuel Hawksby-Robinson 17bc1e9f5d Rough initial proof of concept for udp network checking 2023-04-17 12:01:38 +01:00
Samuel Hawksby-Robinson 170ae0d455 Removed HandlerServer interface
closes #3370
2023-04-04 15:29:13 +01:00
Samuel Hawksby-Robinson 465afd0131 Refactored BasePayloadReceiver to handle Receive()
Additionally to allow this process flow I refactored RawMessagePayloadReceiver and InstallationPayloadHandler to use a dedicated Marshaller type. Also added a fix to struct extention functionality, we want to ignore the process if there is no public key because that will key encoding. Seems an unnecessary bug to have to handle when you know there is no key.
2023-04-04 11:56:40 +01:00
Samuel Hawksby-Robinson 44a1379fbe Removed redudant PayloadMounter types 2023-04-04 11:56:40 +01:00
Samuel Hawksby-Robinson d0396cdd35 Implemented base Mount() func
This uses Load, MarshalProtobuf and encrypt process flow for any PayloadMounter type. In fact the concept of a PayloadMounter type is only useful now in the instantiation context.
2023-04-04 11:56:40 +01:00
Samuel Hawksby-Robinson e028bb8ac0 Implemented structure of BasePayloadMounter.Mount() 2023-04-04 11:56:40 +01:00
Samuel Hawksby-Robinson 20a5b09433 Rolled LockPayload, ToSend and Received funcs into dedicated types 2023-04-04 11:56:40 +01:00
Samuel Hawksby-Robinson e4f70e89b7 Fixed local pairing Server connection events firing early 2023-04-03 09:52:53 +01:00
frank bb6139aef1
add validation on config (#3350) 2023-03-29 23:51:01 +08:00
frank 268cd72e96
init currentMessageState when sync protobuf.ContactUpdate (#3332) 2023-03-28 11:45:54 +08:00
Samuel Hawksby-Robinson fae7e8dba5 Removed server mode from pairing 2023-03-24 17:53:29 +00:00
Samuel Hawksby-Robinson 013c5addd6 Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
Samuel Hawksby-Robinson 374898d7c2 Reconciled shared test components into servertest 2023-03-24 17:31:34 +00:00
Samuel Hawksby-Robinson b16631bbc3 Addressed feedback from @ilmotta 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson 43c2bc24d7 Immplemented limiting client IP to first that requests a challenge 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson 231ded6a7b Added challenge middleware to handleSendInstallation 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson 79d8094dc2 Implemented and integrated challenge update after every successful challenge 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson 4019689df1 Implemented and integrated ChallengeTaker 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson 4ec064ec9c Integrated ChallengeGiver into SenderServer 2023-03-24 16:47:43 +00:00
Samuel Hawksby-Robinson cc8552a782 Added main scafolding for ChallengeGiver 2023-03-24 16:47:43 +00:00
Andrea Maria Piana e2082bf5bd Add customization color 2023-03-24 14:22:29 +00:00
Samuel Hawksby-Robinson 7cd7430d31
Improved Local Pairing Separation of Concerns (#3248)
* Moved all configs into config.go

* Completed build out of new config structures

* Completed SenderClient process flow

* Completed sync data Mounter and client integration

* Completed installation data Mounter and client integration

* House keeping, small refactor to match conventions.

PayloadEncryptor is passed by value and used as a pointer to the instance value and not a shared pointer.

* Reintroduced explicit Mounter field type

* Completed ReceiverClient structs and flows

* Finished BaseClient function parity with old acc

* Integrated new Clients into tests

Solved some test breaks caused by encryptors sharing pointers to their managed payloads

* Built out SenderServer and ReceiverServer structs

With all associated functions and integrated with endpoints.

* Updated tests to handle new Server types

* Added docs and additional refinement

* Renamed some files to better match the content of those files

* Added json tags to config fields that were missing explicit tags.

* fix tests relating to payload locking

* Addressing feedback from @ilmotta

* Addressed feedback from @qfrank
2023-03-23 11:44:15 +00:00
Siddarth Kumar 6ac2308ee1
Re-organise the code to be more modular (#3172) 2023-03-01 17:23:17 +05:30
frank 837bf2ca42
support local pairing after logged in as receiver; pair installation;(#3202) 2023-02-28 20:32:45 +08:00
Samuel Hawksby-Robinson 90d4dde64b
Added a signal to emit after the AccountPayloadManager processes the multiaccounts.Account (#3228) 2023-02-27 11:46:46 +00:00
frank e64091c779
support passing kdf and node config from receiver when local pairing (#3179) 2023-02-17 21:02:42 +08:00
Andrea Maria Piana dab0e5d6d3 Make sure message has correctly set contact notification state
In case we received a message with propagated state, the message state
wasn't correctly set in the database.
2023-02-16 16:14:59 +00:00
Samuel Hawksby-Robinson 90d54b1a3d
Added timeout functionality to Servers (#3192)
* Added timeout functionality to servers

currently only possible on the pairnig serve

* Removed logging (like a mad man)

* handling linter erroring
2023-02-15 15:50:30 +00:00
Igor Sirotin 4d491da8de
LocalPairing minor fixes. `ValidateConnectionString` method. (#3184)
* fix(pairing): Added ConnectionParams::FromString input length check
* feat: Added `IsValidConnectionString` method
* Renamed IsValidConnectionString to ValidateConnectionString
* Bump version
2023-02-15 10:42:12 -04:00
Siddarth Kumar cf84c40320
PR to fix media server sleep issue (#3189)
* fix media-server sleep wake up issue

we now use waku v2 and hence messenger was nil.
Since it was nil, the logic in place responsible for triggering app state events was not firing and hence media server would become un-responsive after a sleep event.

this commit fixes that.

Co-Authored-By: Andrea Maria Piana <andrea.maria.piana@gmail.com>


---------

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2023-02-15 13:44:00 +05:30
frank 5ea8906dda
temporary fix: data/log dir looks weired after local pair sync (#3159) 2023-02-06 17:55:41 +08:00
Andrea Maria Piana 1c660c3525 Move images to shared namespace 2023-02-02 19:18:06 +00:00
Siddarth Kumar efee11d28a
Introduce QR code generation & serve it via the media server (#3154)
* introduce QR code generation
2023-02-02 19:26:00 +05:30
frank 4a970683d1
throw error if account already exist when doing local pairing on receiver side (#3091) 2023-02-01 20:28:32 +08:00
frank 2c38b9e673
reorder pair action by the order of occurrence (#3082) 2023-01-31 16:47:30 +08:00
Andrea Maria Piana ed9ca8392c Upgrade linter to 1.50.0 2023-01-13 17:52:03 +00:00
frank a29511b921
update account name if necessary (#3072) 2023-01-12 11:00:24 +08:00
frank dc87d6bb0f
get messenger from account service when local pairing (#3069) 2023-01-11 19:30:54 +08:00
frank ec7c0e9c7d
Sync all devices after initial pairing (#3047) 2023-01-06 20:21:14 +08:00
Jakub Sokołowski cceba787fa
replace deprecated ioutil.TempDir with os.MkdirTemp
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-01-03 15:40:11 +01:00
Samuel Hawksby-Robinson eadb698603 ColourHash is a distinct type that has a discrete pattern
This change codifies that a ColourHash is a slice of [2]int, as code depends on the inner slice to have exactly 2 indexes
2022-11-28 16:26:07 +00:00
Samuel Hawksby-Robinson 3e8eed5faf Added device name set on Messenger.Start() 2022-11-25 11:33:58 +00:00
Samuel Hawksby-Robinson f33c1cec38 Added payload locking to prevent multiple requests for the pairing data
Signed-off-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2022-11-08 13:50:52 +00:00
Samuel Hawksby-Robinson 95eba8c123 Fixed PairingPayloadMarshaller logger issue 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 71170e7099 Added comprehensive logging 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson a56e389bd1 Change of strategy, using a for loop wait 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 9a7f38fcdf Added portManager debug logging 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 8fb069286c Added dumps to payload parsing 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 4cbe874dea Added 2 mutexes to prevent weird race conditions when reading and writing from separate threads 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson a88ebe3a9f Added docs to new functionality 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 70bc492779 Added functionality to ensure that Make...URL() funcs wait until the port is ready. Adapted tests to check for wait. 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson 6cdd24a048 Added fix for pairing server race on port 2022-10-26 10:26:59 +01:00
Samuel Hawksby-Robinson dde0c71cfc Added string identifier for Connection String 2022-10-05 12:58:32 +01:00
Samuel Hawksby-Robinson 61904182c5 check and make keystore if required on receiving device 2022-10-05 12:20:26 +01:00
Pascal Precht 1eb8a5cc2c feat(MediaServer): add support for discord author and attachment URLs 2022-09-29 16:33:15 +02:00
Richard Ramos b8fd999b54
fix: lint (#2845)
Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2022-09-27 18:59:02 -04:00
Richard Ramos bf9abfc350
feat: make kdf iterations configurable when creating a multiaccount (#2796) 2022-09-27 16:27:20 -04:00
frank 6e4ac1c495 Use image server for all kind of images and integrate identity rings 2022-09-16 09:52:08 +01:00
frank 325efd01d0 Implement identity ring 2022-09-16 09:52:08 +01:00
Andrea Maria Piana f58fd4517f WIP 2022-09-16 09:52:08 +01:00
Samuel Hawksby-Robinson 1d5e19cf96 Refactor and tie in of signal events 2022-09-09 13:24:56 +01:00
Samuel Hawksby-Robinson 67088b1ab1 Added StartUpPairingClient and refactored client endpoints 2022-09-09 13:24:56 +01:00
Samuel Hawksby-Robinson 9fda3a968e Added and integrated StartUpPairingServer
Also moved Mount() calls into the respective Server/Client send() funcs
2022-09-09 13:24:56 +01:00
Samuel Hawksby-Robinson ea3ae8b213 Added PairingPayloadSourceConfig to group app client params 2022-09-09 13:24:56 +01:00
Samuel Hawksby-Robinson 32dccf1359 Added MakeFullPairingServer 2022-09-09 13:24:56 +01:00
Samuel Hawksby-Robinson 7affd6f488 fix for flaky payloadManager test 2022-09-05 16:08:23 +01:00
Samuel Hawksby-Robinson 1e55797ec8 Added challenge middleware 2022-08-25 00:02:32 +01:00
Samuel Hawksby-Robinson 6b1a008719 Added nolit gosec to InsecureSkipVerify, see PR for details 2022-08-24 23:30:09 +01:00
Samuel Hawksby-Robinson 8a4f561c6d Moved cert related functionality into cert.go 2022-08-24 23:30:09 +01:00
Samuel Hawksby-Robinson b1def931eb Integrated server side only tls, public key and aes key connection string 2022-08-24 23:30:09 +01:00
Samuel Hawksby-Robinson f7cbe0b1e8 Get server cert, run validation on cert 2022-08-24 23:30:09 +01:00
Samuel Hawksby-Robinson 344272ee08 Moved protobuf marshalling closer to the structs that get marshalled 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 06f4b85792 undoing the rookie things I did 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 5eb8e5a34f Added payload reset on PayloadManager level 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 48abeedc53 Added func comments and Refactor to use shared *PairingPayload 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 215dbac09a More refactor to increase testability 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 0e878d55d2 Base refactor of PairingPayloadManager 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 46be086b60 Added tests for PayloadMarshaller 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 83db7fc795 Added payload store functionality 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 38c8e8a1fe Added payload marshal and unmarshal to/from protobuf 2022-08-22 13:27:59 +01:00
Samuel Hawksby-Robinson 62e212abf4 Fixed Suite test 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 36f62a3f64 Added encrytion and dectription via PayloadManager 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 566db2e3df Added PayloadManager and outbound pairing tests 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 366c088ec5 Fix cycle import and added private key to Client 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson ddd990b645 Added basic client functionality 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 0dc91b72ff Added ConnectionParams struct and related funcs 2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 7c57a2b65c Implemented lan connection string functionality
Also added more robust testing
2022-06-20 15:33:09 +01:00
Samuel Hawksby-Robinson 05b8ddf57a
LAN connection string (#2653)
* Version bump

* Implemented lan connection string functionality

Also added more robust testing

* Added ConnectionParams struct and related funcs

* Add server mode to ConnectionParams
2022-06-15 16:36:17 +01:00
Samuel Hawksby-Robinson 7f149f93c1
Get preferred network IP and refactor server package to increase reusability (#2626)
* Added function to get preffered network IP

Also done some refactor work oon server package to make a lot more reusable

* Added server.Option and simplified handler funcs

* Added serial number deterministically generated from pk

* Debugging TLS server connection

* Implemented configurable server ip

When accessing over the network the server needs to listen on the network port and not localhost or 127.0.0.1 . Also the cert can now have a dedicated IP

* Refactor of URL funcs to use the url package

* Removed redundant Options pattern in favour of config param

* Added full server test using GetOutboundIP

* Remove references and usage of Server.port

The application does not need to set the port, we rely on the net.Listener to pick a port.

* Version bump

* Added ToECDSA func and improved cert testing

* Added error check in test

* Split Server types, embedding raw Server funcs into specialised server types

* localhost

* Implemented DNS and IP based cert gen

ios doesn't allow for restricted ip addresses to be used in a valid tls cert

* Replace listener handling with original port store

Also added handlers as a parameter of the Server
2022-06-15 15:49:31 +01:00
Richard Ramos 0048aaebcc
feat: add IPFS rate limiter for downloading stickers and use http server for retrieving stickers (#2611) 2022-05-09 09:07:57 -04:00
Samuel Hawksby-Robinson b8f309a47c
Created dedicated Exported funcs for x509 cert and pem generation (#2601) 2022-03-28 13:37:58 +01:00
andrey 598b83757c load audio from http server 2022-03-01 15:58:32 +01:00