Jack Lloyd
334231fbf0
Merge pull request #178 from signalapp/jack/remove-displayable-format
...
Remove DisplayableFingerprint_Format from bridge
2021-02-04 16:40:39 -05:00
Jack Lloyd
26d46e3d2d
Remove DisplayableFingerprint_Format from bridge
...
This should only be done by the fingerprint generator.
Was exposed in Java but never called by Android. Not even exposed in Swift
2021-02-04 16:18:18 -05:00
Jordan Rose
512d0226bc
Reject SenderCertificates without UUIDs
...
Additionally, never look up a session by e164 when decrypting
sealed-sender messages.
This is an API-breaking change for both Java and Swift clients;
certain fields and arguments are no longer Optional. On top of that,
some tests may need to be updated to provide UUIDs instead of just
phone numbers.
2021-02-04 11:25:33 -08:00
Jordan Rose
3df874ab21
Move Fingerprint generation into bridge/shared/
...
JNI keeps its implementation separate because it takes untyped
buffers, but it's still simpler using bridge_fn.
2021-02-03 17:48:47 -08:00
Jordan Rose
b522c42526
Bridge: use Node's bridge_fn HKDF for JNI as well
...
FFI's is still separate because it generates its output into an
existing buffer, which is a different signature than the other two.
2021-02-03 17:01:11 -08:00
Jordan Rose
9add3ec440
Move remaining FFI accessors into bridge/shared
2021-02-03 16:57:26 -08:00
Jordan Rose
478e178ac4
Add bridge_fn_void and use it for SessionRecord_ArchiveCurrentState
...
This also builds on the mutable borrow groundwork in the previous
commit.
2021-02-03 15:38:34 -08:00
Jack Lloyd
079c23b269
Add HKDF to Node via bridge
2021-02-03 17:26:11 -05:00
Jack Lloyd
cad920850a
More Node bindings
...
Aes256GcmSiv
ProtocolAddress
PreKeyRecord
PreKeyBundle
PreKeySignalMessage
SignalMessage
2021-02-03 15:10:06 -05:00
Jack Lloyd
13715b7ebf
CamelCase arguments in libsignal_client.d.ts
2021-02-02 17:01:24 -05:00
Jordan Rose
c05ec3368f
Bridge: move last ffi/jni macro-based APIs over to regular bridge_fns
...
Slightly more verbose than a dedicated macro, but not worth keeping
around.
2021-02-01 18:33:48 -08:00
Jordan Rose
6e46c905f4
Bridge: move remaining int-returning APIs to plain bridge_fns
...
They don't fit in bridge_get! because they have extra logic, but
that's okay.
2021-02-01 18:33:48 -08:00
Jordan Rose
1187d3c1de
Bridge: move simple object returns to bridge_get! as well
2021-02-01 18:33:48 -08:00
Jordan Rose
3d95678b76
Bridge: add a general bridge_get! and use it for strings and ints
2021-02-01 18:33:48 -08:00
Jordan Rose
1683b28da4
Bridge: Optimistically assume Node doesn't need anything FFI doesn't
2021-02-01 18:18:42 -08:00
Jordan Rose
e65fff9433
Bridge: bridge_handle! should imply bridge_destroy!
2021-02-01 18:18:42 -08:00
Jordan Rose
f92e670bfd
Bridge: move PreKeyBundle_New into bridge_fn
...
This is the first use of Option<&PublicKey> as an argument type.
2021-02-01 18:18:42 -08:00
Jordan Rose
dffb8864c6
Bridge: implement bridge_get[_optional]_string using bridge_fn
...
Replaces per-bridge implementations. Unfortunately, the other macros
are a little harder:
- bridge_deserialize and bridge_destroy allow customizing the /type/
name rather than the final function name
- bridge_get[_optional]_bytearray avoids extra copies differently from
bridge_fn_buffer
This reorders the FFI arguments to put the output at the front, a
convention we've been slowly moving towards anyway.
2021-01-28 17:59:11 -08:00
Jordan Rose
6320fad629
Merge pull request #156 from signalapp/jrose/generate-ts-interface
...
Node: Autogenerate libsignal_client.d.ts like we do Native.java
2021-01-28 16:04:35 -08:00
Jordan Rose
2138efe861
Merge pull request #154 from signalapp/jrose/node-logging
...
Node: Add an entry point for logging
2021-01-28 16:04:13 -08:00
Jack Lloyd
b8674f713b
Use LTO for building Node cdylib
2021-01-28 18:23:21 -05:00
Jack Lloyd
abfc1bff3f
Tweak copy_repo script
2021-01-28 18:23:21 -05:00
Jack Lloyd
34d74250b3
Copy lib to expected location
2021-01-28 18:23:21 -05:00
Jack Lloyd
810af28150
Fix the script
2021-01-28 18:23:21 -05:00
Jack Lloyd
346ea73f43
Add a copy_repo script
2021-01-28 18:23:21 -05:00
Jack Lloyd
222ece9f92
Changes to support building Node library on Windows
2021-01-28 18:23:19 -05:00
Jordan Rose
de9f7454c5
Node: Sort libsignal_client.d.ts
...
This groups related functions (but does little else for organization)
2021-01-26 15:48:13 -08:00
Jordan Rose
fdceb3abb8
Node: standardize on "Foo_Bar" for functions exposed from Rust
...
This is easier for the Rust macros to generate than "Foo_bar", and
it's also the same as what we've been doing for Java.
2021-01-26 15:48:13 -08:00
Jordan Rose
7210f6b86f
Node: Autogenerate libsignal_client.d.ts like we do Native.java
...
This collects doc comments of the form "ts: <some TS declaration>",
which can be written manually *or* generated by the various "bridge"
macros. If the declaration looks like a function, it also does some
substitution of Rust types for TypeScript types, to make
autogeneration easier.
2021-01-26 15:48:13 -08:00
Jordan Rose
4a476eb52a
Node: Add an entry point for logging
2021-01-26 10:53:53 -08:00
Jordan Rose
448923ff43
Use the linkme crate to avoid registering Node functions manually
...
This only works on functions using the macros in libsignal-bridge; for
anything else we'll keep using neon::ModuleContext::export_function
manually, at least for now.
2021-01-21 18:06:41 -08:00
Jordan Rose
951d2a9183
Node: name native library as libsignal_client_PLATFORM.node
...
This makes it easier to have a combined artifact root for all
supported platforms.
2021-01-14 09:45:47 -08:00
Jack Lloyd
16dfd3acb0
Add PublicKey and PrivateKey operations to Node layer
2020-12-18 17:33:28 -05:00
Jordan Rose
4b398a8d77
Merge pull request #101 from signalapp/jrose/java-small-test-fixes
...
Get local and Android device tests working correctly
2020-12-09 11:19:56 -08:00
Jordan Rose
d05089e6e8
Java: get local tests working on Mac as well
2020-12-08 17:24:03 -08:00
Jordan Rose
2a7f8c040a
Node: Fix case typo in build_node_bridge.sh
2020-12-04 10:45:01 -08:00
Jordan Rose
9a21e7babc
Node: Switch to Neon's napi-runtime and JsBox
...
We lose the ability to define classes in Rust, but we probably want to
be doing that in TypeScript anyway.
2020-12-04 10:44:58 -08:00
Jordan Rose
6bc0541c4d
Fix quoting in Swift and Node build scripts
2020-11-16 11:02:39 -08:00
Jordan Rose
932d4a3438
Move wrapper-specific shell scripts into subfolders
...
And use bash instead of plain sh for stricter checking.
2020-11-11 11:15:25 -08:00
Jordan Rose
7bfee717bf
Switch ESLint configuration to more closely match Signal-Desktop
2020-11-11 11:06:05 -08:00
Jordan Rose
23bbf7ab11
Node: Enforce license header in ESLint
2020-11-11 11:06:05 -08:00
Jordan Rose
9a8265bfc7
Switch from TSLint to ESLint, which now supports TypeScript
...
TSLint was deprecated in 2019, and this gives us more of a clean slate
for linting options.
2020-11-11 11:06:05 -08:00
Jordan Rose
b4a34f48ad
node: Support for electron-rebuild
...
This allows the Desktop client to add this module as a dependency and
have its existing build process take care of building it against the
correct version of Electron. (Within the repo, `yarn build` calling
`electron-build-env` is still necessary; a plain `electron-rebuild`
seems to get confused.)
2020-11-11 11:06:05 -08:00
Jordan Rose
be56945a70
Add a Yarn-based Node package for signal-client
...
There's very little here yet, just enough to test something.
2020-11-10 11:00:54 -08:00