Commit Graph

30 Commits

Author SHA1 Message Date
marc-signal
c706b7f5ce Expose getUploadForm() to clients
Co-authored-by: Jordan Rose <jrose@signal.org>
2026-03-24 14:32:59 -04:00
marc-signal
a47ba487a7 Add getPreKeys() client library 2026-03-17 13:18:06 -04:00
Jordan Rose
3103b37faf swift: Expose Net.connectProvisioning and ProvisioningConnection 2025-12-15 16:03:35 -08:00
Jordan Rose
2d48bf8441 swift: Expose UnauthUsernamesService.lookUpUsernameLink(_:entropy:) 2025-10-17 12:15:05 -07:00
Jordan Rose
2b6c801fb6 bridge: Expose sendMultiRecipientMessage in UnauthMessagesService 2025-10-14 18:17:25 -07:00
moiseev-signal
0e9c85c354 keytrans: Unify errors with other typed APIs 2025-09-26 11:47:40 -07:00
andrew-signal
bc0227873e Bridge look_up_username_hash to app languages
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-09-02 15:59:27 -07:00
gram-signal
72935510d4 Immediately after a restore, use the same enc_salt/pw_salt for the next backup.
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-07-30 20:14:26 -07:00
Jordan Rose
7c9bc53358 Bridge SVR-B to Swift
Co-authored-by: Andrew <andrew@signal.org>
2025-07-28 13:21:18 -07:00
Alex Bakon
303b6313bd Expose SVR-B logic from Rust 2025-07-25 17:36:12 -04:00
Jordan Rose
9e13263581 Switch to swift-format for formatting instead of swiftformat
swift-format is owned by the Swift project and is generally less
opinionated than swiftformat (but better at formatting to a limited
line length).
2025-06-25 11:24:57 -07:00
Jordan Rose
7a257f0d36 swift: Remove conditionals for pre-6.0 Swift versions 2025-06-12 11:23:38 -07:00
moiseev-signal
70c342bb5d keytrans: Bridge to ffi 2025-05-27 17:03:39 -07:00
Alex Bakon
840f14d2b3 Bridge register account method to Swift 2025-05-14 12:29:24 -04:00
Alex Bakon
478ae16c3b Bridge registration session verification fns to Swift 2025-05-06 16:10:29 -04:00
Alex Bakon
9bf0c894b0 Bridge RegistrationService.createSession to Swift 2025-05-06 11:21:51 -04:00
Alex Bakon
b34d84575f Remove chat service from bridge 2025-02-07 15:30:38 -05:00
Alex Konradi
33b8e9c3d8 Use strong pointer types for Swift bridge
Wrap the raw pointers exposed across the bridge as named types that approximate 
Swift's OpaquePointer?. Parameterize NativeHandleOwner with the native handle 
type.
2024-12-18 10:00:07 -05:00
moiseev-signal
cf98c1a054 Remove SVR3 bridge from all platforms 2024-12-12 17:11:26 -08:00
Alex Konradi
f5a4d7f013 Bridge new chat to Swift 2024-12-10 13:24:04 -05:00
Jordan Rose
e2b453fb18 swift: Initial audit for Sendable
- All public Swift-defined structs except CdsiLookupResponse,
  which wraps LookupResponseEntryList, which can *probably* be made
  Sendable but I didn't spend time on it.

- All public Swift-defined enums except those being used purely as
  namespaces.

- All zkgroup types, since they are immutable and can be serialized
  and deserialized to send them anyway

- ServiceId and its subclasses, an immutable class hierarchy

- ProtocolAddress, PinHash, SenderCertificate and ServerCertificate,
  and all public and private Key types, immutable wrappers around
  immutable Rust objects

More of our wrapper types could be made Sendable as well if there's a
need to. See CODING_GUIDELINES for more info.
2024-10-23 13:10:16 -07:00
Jordan Rose
7dc63b99af ffi: Expose cancellation to Swift 2024-05-17 11:30:24 -07:00
Jordan Rose
6d3c192208 ffi: Wrap promise callbacks and contexts in a struct
...and pass that struct by reference.

This has some benefits and some drawbacks:

+ Type inference is (usually) more reliable; invokeAsyncFunction no
  longer needs a "returning:" parameter for disambiguation.

+ We can add more fields to the promise structs as needed.

+ We can use the same argument for input and output.

- Before, every promise that produced an OpaquePointer could share one
  protocol implementation on the Swift side. Now, they're separate.

- The manual type erasure code in the implementation of Completer has
  gotten worse.

- Using the same argument for input and output may be confusing.
2024-05-17 11:30:24 -07:00
Jordan Rose
96fce497db Bridge unauthenticated connection to Swift
- Remove From<http::header::ToStrError> for ChatServiceError
- bridge: Response -> ChatResponse, DebugInfo -> ChatServiceDebugInfo
2024-04-01 09:24:46 -07:00
moiseev-signal
d7d2576ae6 SVR3: FFI bridge 2024-02-29 18:22:59 -08:00
moiseev-signal
58f43107ab Enforce Swift code formatting 2024-02-23 09:56:38 -08:00
Alex Konradi
5b5b85e715 Expose CDSI lookup via FFI 2024-02-22 10:31:01 -05:00
Alex Konradi
1f2d761889 Allow returning handle types from Swift invokeAsyncFunction
Implement the Completable protocol for OpaquePointer and add a test that runs
futures that return handle types to prove that it works.
2023-12-04 16:39:32 -05:00
Jordan Rose
55a1958a15 Test various error and panic scenarios for bridge_fn and bridge_io 2023-10-12 12:23:22 -07:00
Jordan Rose
17d97859ec bridge: Implement bridge_io for Swift
On the Rust side, this expects a typical C callback function with a
"context" parameter. On the Swift side, we pass a manually-refcounted
object as that "context" which can be used to complete a
CheckedContinuation, bridging into the language 'async' functionality.

The main obstacle to this approach is that Swift does not allow C
function pointers to be used in generic ways, due to its run-time
generics model. AsyncUtils.swift describes the workarounds needed to
deal with this.
2023-10-10 11:52:45 -07:00