diff --git a/.gitignore b/.gitignore index e586912..004fc92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target/ /dev/.state/ /dist/ +/.cargo/ diff --git a/Cargo.lock b/Cargo.lock index dff23d9..48fd03b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1996,7 +1996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid 0.9.6", - "der_derive", + "der_derive 0.7.3", "flagset", "pem-rfc7468 0.7.0", "zeroize", @@ -2009,6 +2009,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a878c850e9e421b20262e9b41f9c860e4785fa07541c266b62ff9d1ef998a80a" dependencies = [ "const-oid 0.10.2", + "der_derive 0.8.0", + "flagset", "pem-rfc7468 1.0.0", "zeroize", ] @@ -2038,6 +2040,17 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "der_derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59600e2c2d636fde9b65e99cc6445ac770c63d3628195ff39932b8d6d7409903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "deranged" version = "0.5.8" @@ -2134,7 +2147,7 @@ dependencies = [ "spki 0.7.3", "subtle", "time", - "x509-cert", + "x509-cert 0.2.5", ] [[package]] @@ -9560,6 +9573,23 @@ dependencies = [ "voelin-model", ] +[[package]] +name = "voelin-identity" +version = "0.2.0" +source = "git+ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git?rev=64808ccbb1e3aa10213392724f2f436bc25fd36f#64808ccbb1e3aa10213392724f2f436bc25fd36f" +dependencies = [ + "aws-lc-rs", + "base64 0.23.1", + "prost", + "rcgen", + "serde", + "serde_json", + "thiserror 2.0.21", + "voelin-proto", + "x509-cert 0.3.0", + "zeroize", +] + [[package]] name = "voelin-media" version = "0.1.0" @@ -9639,6 +9669,17 @@ dependencies = [ "zbus", ] +[[package]] +name = "voelin-proto" +version = "0.2.0" +source = "git+ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git?rev=64808ccbb1e3aa10213392724f2f436bc25fd36f#64808ccbb1e3aa10213392724f2f436bc25fd36f" +dependencies = [ + "bytes", + "prost", + "thiserror 2.0.21", + "tokio", +] + [[package]] name = "voelin-query" version = "0.1.0" @@ -9663,6 +9704,7 @@ dependencies = [ "serde_json", "thiserror 2.0.21", "tsclientlib", + "voelin-identity", ] [[package]] @@ -10850,6 +10892,17 @@ dependencies = [ "spki 0.7.3", ] +[[package]] +name = "x509-cert" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "105ef4642d9cb137ef83d623d0e4bf08b8adf69e9918ca904a174adb6d3d038b" +dependencies = [ + "const-oid 0.10.2", + "der 0.8.2", + "spki 0.8.0", +] + [[package]] name = "x509-parser" version = "0.18.1" diff --git a/Cargo.toml b/Cargo.toml index db62918..8fcb1d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,14 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/Faumaray/Voelin" publish = false +[workspace.dependencies] +# The protocol repository is private (VoelinProtocol). This is the SSH URL its +# docs/development.md names, so that a per-developer .cargo/config.toml [patch] +# can point it at a sibling checkout (docs/building.md, "Working with a sibling +# VoelinProtocol checkout"). Pinned by commit until the protocol tags a release +# that has the account-bound KeyStore (its Phase 2 task 28). +voelin-identity = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", rev = "64808ccbb1e3aa10213392724f2f436bc25fd36f" } + [workspace.lints.rust] # deny, not forbid: generated code (Slint) needs a local allow. unsafe_code = "deny" diff --git a/crates/voelin-store/Cargo.toml b/crates/voelin-store/Cargo.toml index 94f9b2b..b20313f 100644 --- a/crates/voelin-store/Cargo.toml +++ b/crates/voelin-store/Cargo.toml @@ -20,6 +20,7 @@ serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.151" thiserror = "2.0.21" tsclientlib = { path = "../proto/tsclientlib" } +voelin-identity = { workspace = true } [lints] workspace = true diff --git a/deny.toml b/deny.toml index b121807..13bc519 100644 --- a/deny.toml +++ b/deny.toml @@ -48,3 +48,6 @@ allow-wildcard-paths = true [sources] unknown-registry = "deny" unknown-git = "deny" +# The private protocol repository (voelin-identity and its voelin-proto); +# docs/building.md, "Depending on VoelinProtocol". +allow-git = ["ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git"] diff --git a/docs/building.md b/docs/building.md index 576a31b..68c70f9 100644 --- a/docs/building.md +++ b/docs/building.md @@ -124,3 +124,58 @@ the proxy is on localhost. If the proxy inspects TLS, set `scripts/flatpak-build.sh` writes `dist/flatpak/voelin.flatpak` using the release builder image. It requires a privileged container for Flatpak's nested sandbox; do not use it on an untrusted build host. + +## Depending on VoelinProtocol + +`voelin-store` uses `voelin-identity` (the identity blobs, the account-bound +`KeyStore` and the sign-out rules) from the **private** VoelinProtocol +repository, as a Cargo git dependency in the workspace `Cargo.toml`: + +```toml +[workspace.dependencies] +voelin-identity = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", rev = "…" } +``` + +It is pinned by commit until the protocol tags a release that has it; moving +to a newer protocol means changing the `rev` (later a `tag`) and committing +the resulting `Cargo.lock`. Cargo fetches it over SSH, so the machine needs +an SSH key that can read VoelinProtocol (an `ssh-agent` or a +`~/.ssh/config` entry for `git.faumaray.com`); if Cargo's built-in git client +cannot use your SSH setup, set `net.git-fetch-with-cli = true` in +`~/.cargo/config.toml`. `voelin-identity` builds AWS-LC from source +(`aws-lc-sys`), which needs a C compiler (gcc or clang) and cmake. +`deny.toml` allows this one git source. + +**CI and the Docker builds need read access to that repository too**: an SSH +deploy key (a repository secret written to `~/.ssh`, with the server's host key +in `known_hosts`) or an access token (rewrite the SSH URL to HTTPS with +`git config --global url."https://@git.faumaray.com/".insteadOf ssh://gitea@git.faumaray.com/` +and set `CARGO_NET_GIT_FETCH_WITH_CLI=true`). Without it `cargo` cannot fetch +the dependency and a fresh checkout does not build; the details are in +VoelinProtocol's `docs/development.md` ("Depending on VoelinProtocol"). + +### Working with a sibling VoelinProtocol checkout + +To change the protocol and this client together, check VoelinProtocol out next +to this repository (`Projects/Voelin/VoelinProtocol` beside +`Projects/Voelin/VoelinClient`) and redirect the git dependency to it with a +per-developer `.cargo/config.toml` in the root of this repository: + +```toml +# VoelinClient/.cargo/config.toml (per developer, never committed) +[patch."ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git"] +voelin-identity = { path = "../VoelinProtocol/crates/voelin-identity" } +# voelin-proto is a dependency of voelin-identity from the same repository: +voelin-proto = { path = "../VoelinProtocol/crates/voelin-proto" } +``` + +- Relative paths in a Cargo config file resolve from the directory that + contains `.cargo`, so `../VoelinProtocol` is the sibling checkout. (A git + worktree of this repository, such as `.wt/`, uses the matching number + of `../` or an absolute path.) +- The URL must be spelled exactly as in the workspace `Cargo.toml`. +- `/.cargo/` is in `.gitignore`: the file is yours and is never committed. +- With the patch active Cargo rewrites `Cargo.lock` (the patched crates lose + their git `source`). Do not commit that: run `git checkout Cargo.lock` before + committing, or remove the file and run `cargo update -p voelin-identity` + after changing the `rev`. CI builds with `--locked` and has no patch. diff --git a/docs/ci.md b/docs/ci.md index 44b844c..64678b7 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -55,7 +55,12 @@ the separate `release.yml` workflow below. 3. Allow network access from the runner and job container to the Gitea instance, GitHub (checkout action, dependencies and RustSec advisories), GHCR (runner image), Ubuntu apt mirrors, rustup distribution servers, - crates.io and dependency/license sources used by cargo-about. + crates.io and dependency/license sources used by cargo-about. The + workspace also depends on the **private** VoelinProtocol repository + (`voelin-identity`, over SSH), so the job needs read access to it: an SSH + deploy key or an access token, set up as in + [building.md](building.md#depending-on-voelinprotocol). Until a runner has + it, a fresh checkout does not build there. 4. Provision enough RAM, swap and free disk for a full Slint workspace build plus cargo-deny/cargo-about compilation. These are large builds; monitor the first run and size the runner accordingly. The workflow limits Cargo