Skip to content

Commit 2250d49

Browse files
committed
feat(preview): proxy Labelary through Rust, tighten desktop CSP
The webview no longer fetches previews (CSP drops http:/https:); the Rust proxy validates host/path and blocks redirects. The API key is a host-bound, rust-only keychain credential the proxy reads itself, so it never enters webview memory and can't be replayed against a foreign host.
1 parent 60d6e54 commit 2250d49

16 files changed

Lines changed: 799 additions & 131 deletions

src-tauri/Cargo.lock

Lines changed: 153 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ tauri = { version = "2.11.3", features = [] }
2121
serde_json = "1"
2222
serde = { version = "1", features = ["derive"] }
2323
tokio = { version = "1", features = ["net", "time", "io-util", "rt"] }
24+
# Preview proxy only (redirects disabled there); rustls to match sqlx.
25+
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
26+
base64 = "0.22"
2427
# Stream a query's rows (db.rs) instead of fetch_all so a huge result is bounded
2528
# by a byte budget and errors instead of OOMing. Already transitive via sqlx;
2629
# tokio-stream keeps us in the tokio ecosystem we already depend on directly.

src-tauri/THIRD-PARTY-LICENSES-RUST.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ drifts from the locked dependencies.
88

99
## Overview
1010

11-
- MIT License (443)
11+
- MIT License (445)
1212
- Unicode License v3 (19)
13-
- Apache License 2.0 (6)
13+
- Apache License 2.0 (7)
1414
- BSD 3-Clause "New" or "Revised" License (5)
1515
- Mozilla Public License 2.0 (5)
1616
- ISC License (3)
@@ -883,6 +883,7 @@ Apache License
883883

884884
Used by:
885885

886+
- [ryu 1.0.23](https://github.com/dtolnay/ryu)
886887
- [sync_wrapper 1.0.2](https://github.com/Actyx/sync_wrapper)
887888
````
888889
Apache License
@@ -2365,6 +2366,40 @@ DEALINGS IN THE SOFTWARE.
23652366

23662367
Used by:
23672368

2369+
- [serde_urlencoded 0.7.1](https://github.com/nox/serde_urlencoded)
2370+
````
2371+
Copyright (c) 2016 Anthony Ramine
2372+
2373+
Permission is hereby granted, free of charge, to any
2374+
person obtaining a copy of this software and associated
2375+
documentation files (the "Software"), to deal in the
2376+
Software without restriction, including without
2377+
limitation the rights to use, copy, modify, merge,
2378+
publish, distribute, sublicense, and/or sell copies of
2379+
the Software, and to permit persons to whom the Software
2380+
is furnished to do so, subject to the following
2381+
conditions:
2382+
2383+
The above copyright notice and this permission notice
2384+
shall be included in all copies or substantial portions
2385+
of the Software.
2386+
2387+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
2388+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
2389+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
2390+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
2391+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2392+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2393+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
2394+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2395+
DEALINGS IN THE SOFTWARE.
2396+
2397+
````
2398+
2399+
### MIT License
2400+
2401+
Used by:
2402+
23682403
- [webkit2gtk-sys 2.0.2](https://github.com/tauri-apps/webkit2gtk-rs)
23692404
````
23702405
Copyright (c) 2016 Boucher, Antoni <bouanto@zoho.com>
@@ -2659,6 +2694,35 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
26592694
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26602695
DEALINGS IN THE SOFTWARE.
26612696
2697+
````
2698+
2699+
### MIT License
2700+
2701+
Used by:
2702+
2703+
- [reqwest 0.12.28](https://github.com/seanmonstar/reqwest)
2704+
````
2705+
Copyright (c) 2016-2025 Sean McArthur
2706+
2707+
Permission is hereby granted, free of charge, to any person obtaining a copy
2708+
of this software and associated documentation files (the "Software"), to deal
2709+
in the Software without restriction, including without limitation the rights
2710+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2711+
copies of the Software, and to permit persons to whom the Software is
2712+
furnished to do so, subject to the following conditions:
2713+
2714+
The above copyright notice and this permission notice shall be included in
2715+
all copies or substantial portions of the Software.
2716+
2717+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2718+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2719+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2720+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2721+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2722+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2723+
THE SOFTWARE.
2724+
2725+
26622726
````
26632727

26642728
### MIT License

0 commit comments

Comments
 (0)