Commit Graph

43 Commits

Author SHA1 Message Date
Eng Zer Jun 83ad76637a
test: use `T.TempDir` to create temporary test directory (#2746)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-26 21:39:51 +01:00
frank a2ed1b78dd
feat:support backup/sync ens name (#3415) 2023-04-26 23:37:18 +08:00
Igor Sirotin b8209cbc7d
fix(pairing): Received installation event (#3422) 2023-04-26 14:48:49 +03:00
frank 272173c939
feat:support backup/sync social settings (#3407)
* feat:support backup/sync social settings

* update binddata.go

* fix lint issue

* addressed feedback from @saledjenic @osmaczko

* addressed feedback from @saledjenic @osmaczko

* add corresponding test for local pairing

* addressed feedback from @saledjenic
2023-04-20 06:59:09 +08:00
Samuel Hawksby-Robinson 8c94c5f3f1 Added versioning package and addressed feedback 2023-04-17 12:01:38 +01:00
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
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
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
frank 5ea8906dda
temporary fix: data/log dir looks weired after local pair sync (#3159) 2023-02-06 17:55:41 +08:00
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