Commit Graph

250 Commits (2e4c11f4b9dc033412c47551d65b1cffb2a1c632)

Author SHA1 Message Date
Morgan Pretty 4380f1975c Further work on the DB refactoring
Added the rest of the interaction structure to the database (testing some migration logic now - still needs to be finalised)
Updated the YDBToGRDB migrations to wrap their inserts in autorelease pools (helps memory slightly, unfortunately it's caching the YDB data which uses the most memory but we have opted for speed over RAM at the moment)
Updated the MockDataGenerator so it should now "chunk" the code generation (crazy large figures were previously resulting in excessive memory usage)
2 years ago
Morgan Pretty cf66edb723 Further work on SessionMessagingKit migrations
Added migrations for contacts and started working through thread migration (have contact and closed group threads migrating)
Deprecated usage of ECKeyPair in the migrations (want to be able to remove Curve25519Kit in the future)
2 years ago
Morgan Pretty 4ee4b3ffb3 Started adding migration logic for contacts
Updated the getUserHexEncodedPublicKey to take an optional db value so we can retrieve it during the initial migration
2 years ago
Morgan Pretty 410f37f0d5 Updated the SnodeSet table name to match the type
Shifted all GRDB Snode convenience methods to be extensions on Snode (instead of SnodeSet) for consistency
2 years ago
Morgan Pretty 63db2a4e3d Updated the 'SwarmSnode' to use the 'port_https' key instead of the 'port' key (deprecated) 2 years ago
Morgan Pretty a1b4554cdb Migrated the SessionSnodeKit from YapDatabase to GRDB
Changed the min OS version to iOS 13.0 (support for 'Identifiable')
Removed the alternate approaches to fetching the userKeyPair and userPublicKeyHexString (no consistently routed through the caching method)
Migrated the 'OWSIdentityManager' logic to use the new 'Identity' type
Added the 'Setting' table and got the pattern working fairly nicely (unfortunately there isn't a good way to avoid key collision without proper enums)
Updated the SessionSnodeKit to migration it's data from YDB to GRDB
Updated the SessionSnodeKit to use GRDB throughout it's logic
2 years ago
Morgan Pretty e65682ae9b Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SessionSnodeKit/SnodeAPI.swift
2 years ago
Morgan Pretty 529e416dd1 Started work on GRDB logic and migrations
Setup a migration pattern
Setup the database configuration and security
Started defining the database schema
Started working on the migrations for SessionSnodeKit
2 years ago
Morgan Pretty 5ca227434b Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Database/Storage+OpenGroups.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift
#	SessionMessagingKit/Storage.swift
#	SessionMessagingKit/Utilities/General.swift
#	SessionSnodeKit/SnodeAPI.swift
#	SessionUtilitiesKit/General/Atomic.swift
2 years ago
Morgan Pretty b90904ebbd Updated the code to only update the last message hash once the MessageReceiveJobs have been created 2 years ago
Ryan Zhao 6bc0177bd4 fix path building crash 2 years ago
Morgan Pretty cb27da48b7 Updated the code to handle a clock out of sync error (different error code from v2 & v3) 2 years ago
Morgan Pretty 17a9e510c5 Further work on unit tests (and a couple of bug fixes found when testing)
Removed a couple remaining TODOs
Added 'standardUserDefaults' to the 'Dependencies' type
Tweaked the OpenGroupAPI to only update the 'lastOpen' timestamp if it successfully polls
Refactored a couple of methods in the ConversationViewItem into swift so we can clean up the OpenGroupAPI more
Updated the OpenGroupAPI so it no longer has static variables for state (shifted to the OpenGroupManager and made them instance variables)
Fixed an encoding issue with the Capabilities.Capability
2 years ago
Morgan Pretty 81f563229f Renamed FileServerAPIV2 to FileServerAPI
Updated the direct file upload/download to use the non-base64 approaches as well
Updated the attachment 'serverId' value to be a string instead of a UInt64 (future-proofing)
Updated the OnionRequest V4 response handling to avoid converting the "response body" part to a string and processing that, instead just slice the byte array (ie. stopped it from being broken from multiple conversions)
Removed the base64-based file upload/download endpoints (no use including them when they are inefficient and we don't want to use them)
2 years ago
Morgan Pretty 1c474955de File upload working, further code cleanup
Got the updated file upload working
Removed the legacy 'room' header
Consolidated a number of types between SOGS, FileServer and general requests
Updated the OnionRequestAPI to deal with a Data payload (rather than encoding it to a string and then back to data)
2 years ago
Morgan Pretty 6936f35f2a Fixed a few issues uncovered while testing and some cleanup
Fixed an incorrect optional in RoomPollInfo
Fixed an incorrect parameter name in the ClosedGroupRequestBody
Fixed a crash due to a change in the ContactUtilities
Cleaned up the duplicate code in the OnionRequestAPI, HTTP and SnodeAPI to all use 'Data' response types
Updated the SnodeAPI to casting types to Any (made it hard to catch breaking changes with HTTP and OnionRequestAPI)
2 years ago
Morgan Pretty cc2a077a6c Started working on `MessageRequestResponse` handling for SOGS message requests
Pointing Curve25519 to use a fork that exposes an XEd25519 conversion method
Fixed an issue where I had broken all message sending due to the SnodeAPI casting Onion responses to `Any`
2 years ago
Morgan Pretty ef09d4d5aa Additional encryption work on id blinding
Got the updated blinding logic working (at least when authenticating a request - still need to deal with message signing and verification)
Storing the server capabilities in the database now so we can correctly blind requests based on them
Renamed the remaining 'v2' functions and classes to just be 'OpenGroup' since there isn't a 'V2' anymore
Cleaned up a few TODOs and functions
2 years ago
Morgan Pretty eb927c36a9 Started cleaning up some of the SOGS and Onion Requests structure
Cleaned up the OnionRequestAPI so we don't need the LegacyOnionRequestAPI
Added requests for the user endpoints
Added deprecated flags to the legacy endpoints and functions
Added some logic to start handling the new poll (batch) response
Started adding unit tests for the OpenGroupAPI functions
2 years ago
Morgan Pretty c90f346d6a Further SOGS V4 integration work
Added in the v4 onion requests logic
Added in the new pin/unpin APIs
Split up additional legacy methods to try and simplify the refactoring
Added a number of TODOs around usage of legacy request methods
2 years ago
Morgan Pretty 4f3900771e More work on getting SOGS V4 integrated
Updated the MessageSendJob to support V4 messages (V2 messages will be upgraded to V4 if they get re-encoded)
Renamed the Message+Destination from 'openGroup' & 'openGroupV2' to 'legacyOpenGroup' and 'openGroup'
Started plugging in more of the V4 APIs
Renamed a number of the V2 APIs to start with 'legacy'
2 years ago
Morgan Pretty 2284375fc0 Started work on updated SOGS support
Split the OpenGroupAPIV2 into separate files
Started working on the new auth and blinded-id approaches (new auth working with un-blinded id suggesting blinded-id code is incorrect)
Updated the SOGS request/response types to use Codable
Updated the SOGS Request type to use enums instead of strings for keys (to reduce likelihood of typos breaking things)
Updated SessionMessagingKit to use Codable and JSONEncoder/JSONDecoder instead of the legacy JSONSerialization
Cleaned up some naming conventions in the SessionMessagingKit (calling a URLRequest body 'parameters' is very confusing...)
Removed the custom TSRequest class (just using standard URLRequest everywhere instead)
Added a number of extension functions to enable some more functional-coding styles
Added extensions to Sodium methods to allow scalar multiplication and the ability to hash providing a salt and a personalisation value (both needed for new SOGS auth)
Fixed an issue where the legacy auth for SOGS could crash due to threading issues (multiple threads accessing the same variable)
Fixed an issue where if you were in two rooms in a single SOGS and deleted one of them, the other room would stop getting updates as the server public key was getting removed
2 years ago
Morgan Pretty 394b0646a3 Updated the code to support additional session id prefixes 2 years ago
Morgan Pretty 03fb5cbeeb Cleanup and tweaks
Fixed some compilation issues.
Removed an unused dependency.
Cleaned up the Podfile to minimise duplication.
Pointed at an oxen fork of SignalCoreKit instead of a personal one.
2 years ago
Ryan Zhao 5f6da0739e delete message on storage server 3 years ago
Ryan Zhao e8f0d0d124 WIP: delete from storage server 3 years ago
Ryan Zhao c68350f3d8 store hash value for outgoing messages 3 years ago
Niels Andriesse 1a237557ff Add documentation 3 years ago
Niels Andriesse 140f07df96 Disable authenticated retrieval for now 3 years ago
Niels Andriesse 2360af5993 Implement authenticated message retrieval 3 years ago
Niels Andriesse 81820c0013 Remove unnecessary check 3 years ago
Niels Andriesse 8a29469eb5 Handle incorrect clock setting 3 years ago
Niels Andriesse 41fe33525c Don't unnecessarily open sync transactions 3 years ago
Niels Andriesse 498f5a73b0 Don't unnecessarily open sync transactions 3 years ago
Niels Andriesse e84fc1aa04 Include destination info in error messages 3 years ago
Niels Andriesse bea80c67b3 Make error more descriptive 3 years ago
Niels Andriesse ef2eab7e9f Implement SnodeAPI.clearAllData() 3 years ago
Niels Andriesse a774d5f004 Re-use existing build paths promise if possible 3 years ago
nielsandriesse 1b68c109ee Fix build 3 years ago
nielsandriesse 5c699d6bb7 Fix inverted operation 3 years ago
nielsandriesse b694777a71 Fix snode pool updating bug 3 years ago
Niels Andriesse e93af07b61 Fix ONS 3 years ago
Niels Andriesse 371222098b Fix snode pool updating bug 3 years ago
Niels Andriesse be382a6031 Add fix for temporary path building issue 3 years ago
Niels Andriesse e9df213bfe Put feature flags in one place 3 years ago
Niels Andriesse 1561b9436f Fix missing query parameters 3 years ago
nielsandriesse 583f5e3483 Clean 3 years ago
nielsandriesse fec4bfb836 Debug 3 years ago
Niels Andriesse 66181baf2b Debug 3 years ago
Niels Andriesse d39387bf01 Debug 3 years ago
Niels Andriesse 2f67073a5a Implement new snode pool updating method 3 years ago
Niels Andriesse 8aa25af4d5 Rework things in advance of new snode pool updating method 3 years ago
Niels Andriesse 1002cc51ae Remove PoW too low error code handling 3 years ago
Niels Andriesse 727dccfbb7 Remove PoW too low error code handling 3 years ago
Niels Andriesse 2feae0dea4 Debug 3 years ago
Niels Andriesse 8375b598ad Don't hardcode scheme and port 3 years ago
Niels Andriesse fac376bf55 Use HTTP for default session open group server 3 years ago
nielsandriesse 8433c2d4ab Remove debug code 3 years ago
nielsandriesse a76c43973f Increase TTL & remove PoW 3 years ago
Niels Andriesse 89b96447e1
Merge pull request #378 from oxen-io/tls
Self-Signed Seed Node Certificates
3 years ago
nielsandriesse 75f5591fe0 Store certificates in DER format 3 years ago
Niels Andriesse 58748471a4 Set up skeleton code 3 years ago
Ryan ZHAO 4fd34005dc fix opening transactions in filter. 3 years ago
Niels Andriesse 34bbff1ab4 Implement OpenGroupAPIV2 3 years ago
nielsandriesse 66d46f3dd0 Debug 3 years ago
Niels Andriesse 4958d3d368 Implement ONS API 3 years ago
Niels Andriesse cf07fc1b1a Implement nicknames 3 years ago
Niels Andriesse 8477f75426 Fix unnecessary path rebuilding 3 years ago
Niels Andriesse 647bdb0d10 Fix error copy 3 years ago
Niels Andriesse ee1d4b1bd5 Debug & make UI clearer 4 years ago
Niels Andriesse 40d199a90b Clean up SnodeAPI 4 years ago
nielsandriesse 9ebb448b5f Fix crash 4 years ago
nielsandriesse 7ca3b73fd8 Fix crash 4 years ago
Niels Andriesse efe8f1c8bb Clean 4 years ago
Niels Andriesse 905b829de2 Refresh snode pool at least once a day 4 years ago
Niels Andriesse 557a851dce Enforce assumptions 4 years ago
nielsandriesse d6c115bc2a Fix module linking issue 4 years ago
Niels Andriesse f6b78f9e99 Adjust snode API parameters 4 years ago
nielsandriesse 5dfd4b1965 Restructure 4 years ago
nielsandriesse 6dc3184b2a Merge branch 'dev' into refactor-3 4 years ago
nielsandriesse 5d8d468826 Implement SessionSnodeKit & SessionProtocolKit conformances 4 years ago
nielsandriesse 000e907d47 Clean up Podfile 4 years ago
nielsandriesse 7e213c71d5 Make everything build again 4 years ago
nielsandriesse c475f895e8 Create SignalUtilitiesKit 4 years ago
nielsandriesse a3382f41d4 Re-organize files 4 years ago
nielsandriesse b9f2881c9d Implement destination coding 4 years ago
nielsandriesse 28172b4ed2 Create AttachmentUploadJob & AttachmentDownloadJob
Also conform SnodeMessage to NSCoding
4 years ago
nielsandriesse 4b63588f1a Create MessageSendJob & MessageReceiveJob
Also implement message sending notifications & custom TTL for typing indicators
4 years ago
nielsandriesse 21fe9558a4 Partially implement messaging kit encryption & decryption 4 years ago
nielsandriesse 2d618cc6e9 Re-add proof of work 4 years ago
nielsandriesse d735568e94 Partially implement sending pipeline 4 years ago
nielsandriesse 3fe57b7765 Implement read receipt 4 years ago
nielsandriesse 48f166b893 Implement typing indicator proto conversion 4 years ago
nielsandriesse fbc41a857a Stub sending & receiving pipelines 4 years ago
nielsandriesse 74b104af45 Clean 4 years ago
nielsandriesse 10582e0381 Add SSKs to SessionProtocolKit 4 years ago
nielsandriesse c1196a6921 Start SessionMessagingKit 4 years ago
nielsandriesse 9806f1880b Rename various things 4 years ago
nielsandriesse f3753abe5a Create SessionUtilities framework 4 years ago
nielsandriesse 2b1e322832 Create SessionSnodeKit 4 years ago