Commit Graph

50 Commits

Author SHA1 Message Date
Marshall Bowers
c84da37030
rpc: Add support for OAEP-based encryption format (#15058)
This PR adds support for a new encryption format for exchanging access
tokens during the authentication flow.

The new format uses Optimal Asymmetric Encryption Padding (OAEP) instead
of PKCS#1 v1.5, which is known to be vulnerable to side-channel attacks.

**Note: We are not yet encrypting access tokens using the new format, as
this is a breaking change between the client and the server. This PR
only adds support for it, and makes it so the client and server can
decrypt either format moving forward.**

This required bumping the RSA key size from 1024 bits to 2048 bits. This
is necessary to be able to encode the access token into the ciphertext
when using OAEP.

This also follows OWASP recommendations:

> If ECC is not available and RSA must be used, then ensure that the key
is at least 2048 bits.
>
> —
[source](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#algorithms)

Release Notes:

- N/A
2024-07-23 21:25:25 -04:00
Marshall Bowers
edf7f6defe
Upgrade rsa to v0.9.6 (#15055)
This PR upgrades the `rsa` crate to v0.9.6.

The version we were using was rather old, and for something
security-sensitive we should be using a recent version.

No behavioral changes have been made, just updates to account for
changes in the crate's API.

Release Notes:

- N/A
2024-07-23 20:11:48 -04:00
Mikayla Maki
855048041d
Update http crate name (#15041)
Release Notes:

- N/A
2024-07-23 15:01:05 -07:00
Piotr Osiewicz
4d65f7eea3
chore: Bump async-tungstenite to 0.23 (and tungstenite to 0.20.1) (#15039)
Release Notes:

- N/A
2024-07-23 23:18:00 +02:00
Conrad Irwin
fe7d53cb96
Dynamicer builds (#13074)
Fixes https://github.com/zed-industries/zed/issues/13073

Note that, contrary to the issue's text, we're still shipping a
statically bundled sqlite3 after this PR. We use enough new features of
sqlite, like `sqlite3_error_offset` and `STRICT`, that our minimum
version (v3.38.0) is higher than is presumably accessible on Ubuntu.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-21 16:32:32 -07:00
Antonio Scandurra
77e88c1ded
Extract a proto crate out of rpc (#12852)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-06-10 12:49:53 -06:00
Max Brunsfeld
5adc51f113
Add telemetry events for loading extensions (#9793)
* Store extensions versions' wasm API version in the database
* Share a common struct for extension API responses between collab and
client
* Add wasm API version and schema version to extension API responses

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-25 17:30:48 -04:00
Tobias Decking
1e1fb21c81
Merge prost dependecies (#9522)
This patch puts the prost, prost-build, and prost-types dependencies
together and unifies their version. This improves organization a bit in
addition to improving build time slightly, since a redundant version of
prost is now removed.

The dependencies are _not_ updated to the newest versions, because the
newest versions add a dependency on the `protoc` application, which is
not provided by cargo and thus breaks the building process.
2024-03-18 20:33:20 -06:00
Conrad Irwin
75a42c27db
Migrate from scrypt to sha256. (#8969)
This reduces the server time to compute the hash from 40ms to 5µs,
which should remove this as a noticable chunk of CPU time in production.

(An attacker who has access to our database will now need only 10^54
years of CPU time instead of 10^58 to brute force a token).

Release Notes:

- Improved sign in latency by 40ms.
2024-03-06 20:51:43 -07:00
Marshall Bowers
22fe03913c
Move Clippy configuration to the workspace level (#8891)
This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A
2024-03-05 12:01:17 -05:00
Dzmitry Malyshau
a44fc24445
Clean up many small dependencies (part 3) (#8425)
Follow-up to #8353

Release Notes:
- N/A
2024-02-26 11:08:57 +02:00
Dzmitry Malyshau
83f493b387
Clean up deps for file_finder, language_selector, task, rpc, storybook (#8353)
Following-up on #8330

Invocation
```bash
cargo-machete --with-metadata --skip-target-dir --fix
````

There is more stuff to fix, but it chokes on `async-lock`:
```
cargo-machete found the following unused dependencies in /x/Code/zed:
rpc -- /x/Code/zed/crates/rpc/Cargo.toml:
        async_lock
        prost_build
        serde_derive
Error: Dependency async_lock not found
```

Release Notes:
- N/A
2024-02-25 10:10:07 +02:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Marshall Bowers
0cb8b0e451
Clean up Cargo.toml files (#7044)
This PR cleans up some inconsistencies in the `Cargo.toml` files that
were driving me crazy.

Release Notes:

- N/A
2024-01-29 23:47:20 -05:00
Piotr Osiewicz
0a0a866dd5
Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535)
Release Notes:
- N/A
2024-01-27 13:51:16 +01:00
Julian Braha
fd6f71d287 Replace tempdir crate with tempfile 2024-01-24 17:58:09 +00:00
Piotr Osiewicz
f2ff7fa4d5
chore: Change AGPL-licensed crates to GPL (except for collab) (#4231)
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?

Release Notes:
- N/A
2024-01-24 00:26:58 +01:00
Piotr Osiewicz
21e6b09361
Remove license-file from Cargo.toml as it is apparently redundant (#4218)
Release Notes:

- N/A
2024-01-23 17:40:30 +01:00
Piotr Osiewicz
678bdddd7d
chore: Add crate licenses. (#4158)
- GPUI and all dependencies: Apache 2
- Everything else: AGPL

Here's a script that I've generated for it:
https://gist.github.com/osiewicz/6afdd6626e517da24a2092807e6f0b6e

Release Notes:
- N/A

---------

Co-authored-by: David <david@zed.dev>
2024-01-23 16:56:22 +01:00
Max Brunsfeld
f5ba22659b Remove 2 suffix from gpui
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:59:39 -08:00
Max Brunsfeld
5ddd298b4d Remove 2 suffix for fs, db, semantic_index, prettier
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:09:42 -08:00
Max Brunsfeld
3241128840 Make notification db representation more flexible 2023-10-12 17:42:32 -07:00
Max Brunsfeld
cf6ce0dbad Start work on storing notifications in the database 2023-10-12 17:41:07 -07:00
Max Brunsfeld
ff5035ea37
Start work on storing channel buffers 2023-08-23 18:34:43 -07:00
Max Brunsfeld
ebbe52e6b0 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld
abdccf7393 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -07:00
Antonio Scandurra
5471217089 Use the same serde version across the entire workspace 2023-03-28 09:42:00 -07:00
Antonio Scandurra
1af8f4be19 Deserialize Theme directly into the heap to avoid stack overflow
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-03-17 15:58:52 +01:00
Mikayla Maki
d060114f00 Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Isaac Clayton
f6b6d19041 Add wasmtime and fix zstd version conflict 2022-07-07 15:01:15 +02:00
Max Brunsfeld
a14b626927 Enable env log in peer tests 2022-06-22 14:42:20 -07:00
Max Brunsfeld
724affc442 Upgrade deps to avoid multiple versions of transitive deps
* env_logger
* prost-build
* bindgen
2022-06-02 17:38:33 -07:00
Antonio Scandurra
339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Nathan Sobo
de555e3423 Enable logging of rpc crate trace events when no subscriber is present
This allows these events to be logged in the Zed client (until we setup tracing there).

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-12 10:17:37 -06:00
Nathan Sobo
9ca6e29a17 Use tracing instead of log in collab and rpc crates
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-12 10:05:49 -06:00
Nathan Sobo
9f6e82720d WIP: Enhance tracing in Peer
- Add a bunch of events to Peer's async connection handling logic
- Use an EnvFilter to allow more control over the verbosity level of tracing on a per-module basis
- Wire up logging to emit trace events (we actually probably want to do this the other way around)

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-12 09:58:17 -06:00
Nathan Sobo
17195e615e
Merge pull request #781 from zed-industries/structured-logging
Introduce structured logging
2022-04-09 07:40:24 -06:00
Nathan Sobo
7e5a3f9f6b Introduce structured logging
We're enabling the log crate feature everywhere, but only using it on the server for now.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-08 10:06:51 -06:00
Antonio Scandurra
24cb44fb00 Remove postage from rpc
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-08 16:13:37 +02:00
Antonio Scandurra
fae9048a2a Remove non-determinism from Peer caused by using std's HashMap 2022-04-08 11:28:19 +02:00
Max Brunsfeld
9017a1363b Send websocket pings from both the client and the server
Remove the client-only logic for sending protobuf pings.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 15:21:18 -08:00
Max Brunsfeld
05df1dfae9 Disable doctests for all libraries
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00
Max Brunsfeld
0e55f0ccaa Use Rust 2021 edition in all crates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:50:31 -08:00
Max Brunsfeld
2b8685c1a2 Insert random delays when sending and receiving websocket messages in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-24 16:37:22 -08:00
Nathan Sobo
30225678c0 Test ordering of responses with respect to uni-directional messages
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-12 11:19:17 -07:00
Max Brunsfeld
a080ae98c6 Allow the zed app to connect to both the old and new rpc endpoints
In the case of the new Next.js app, the app will follow a redirect
from 'zed.dev/rpc' to the subdomain where the rust service is hosted.
Until then, the app will connect directly to zed.dev/rpc.
2022-01-03 15:29:26 -08:00
Nathan Sobo
1445ce10b5 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Max Brunsfeld
7474813a17 Impose a timeout on writing RPC messages
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-22 13:23:55 -08:00
Nathan Sobo
d5b60ad124 Rename zrpc to rpc
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-10-04 13:28:00 -06:00