ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/

rename key_agent to agent

+98 -115
+60 -77
Cargo.lock
··· 18 checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 19 20 [[package]] 21 name = "aho-corasick" 22 version = "1.1.4" 23 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 296 "heck", 297 "proc-macro2", 298 "quote", 299 - "syn 2.0.111", 300 ] 301 302 [[package]] ··· 327 checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 328 329 [[package]] 330 - name = "convert_case" 331 - version = "0.10.0" 332 - source = "registry+https://github.com/rust-lang/crates.io-index" 333 - checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" 334 - dependencies = [ 335 - "unicode-segmentation", 336 - ] 337 - 338 - [[package]] 339 name = "cpufeatures" 340 version = "0.2.17" 341 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 346 347 [[package]] 348 name = "crc" 349 - version = "3.3.0" 350 source = "registry+https://github.com/rust-lang/crates.io-index" 351 - checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" 352 dependencies = [ 353 "crc-catalog", 354 ] ··· 408 dependencies = [ 409 "proc-macro2", 410 "quote", 411 - "syn 2.0.111", 412 ] 413 414 [[package]] ··· 432 "proc-macro2", 433 "quote", 434 "strsim", 435 - "syn 2.0.111", 436 ] 437 438 [[package]] ··· 443 dependencies = [ 444 "darling_core", 445 "quote", 446 - "syn 2.0.111", 447 ] 448 449 [[package]] ··· 465 466 [[package]] 467 name = "derive_more" 468 - version = "2.1.0" 469 source = "registry+https://github.com/rust-lang/crates.io-index" 470 - checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" 471 dependencies = [ 472 "derive_more-impl", 473 ] 474 475 [[package]] 476 name = "derive_more-impl" 477 - version = "2.1.0" 478 source = "registry+https://github.com/rust-lang/crates.io-index" 479 - checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" 480 dependencies = [ 481 - "convert_case", 482 "proc-macro2", 483 "quote", 484 - "rustc_version", 485 - "syn 2.0.111", 486 "unicode-xid", 487 ] 488 ··· 522 dependencies = [ 523 "proc-macro2", 524 "quote", 525 - "syn 2.0.111", 526 ] 527 528 [[package]] ··· 590 "once_cell", 591 "proc-macro2", 592 "quote", 593 - "syn 2.0.111", 594 ] 595 596 [[package]] ··· 771 dependencies = [ 772 "proc-macro2", 773 "quote", 774 - "syn 2.0.111", 775 ] 776 777 [[package]] ··· 1117 dependencies = [ 1118 "getrandom 0.3.3", 1119 "libc", 1120 - ] 1121 - 1122 - [[package]] 1123 - name = "key_agent" 1124 - version = "1.0.0-beta.0" 1125 - dependencies = [ 1126 - "anyhow", 1127 - "base64", 1128 - "futures-util", 1129 - "nix 0.30.1", 1130 - "prost", 1131 - "prost-build", 1132 - "sha2", 1133 - "tokio", 1134 - "tokio-util", 1135 ] 1136 1137 [[package]] ··· 1147 name = "lib" 1148 version = "1.0.0-beta.0" 1149 dependencies = [ 1150 "aho-corasick", 1151 "anyhow", 1152 "base64", ··· 1157 "gjson", 1158 "im", 1159 "itertools", 1160 - "key_agent", 1161 "miette", 1162 "nix 0.30.1", 1163 "nix-compat", ··· 1172 "sha2", 1173 "sqlx", 1174 "strip-ansi-escapes", 1175 - "syn 2.0.111", 1176 "tempdir", 1177 "termion", 1178 "thiserror 2.0.17", ··· 1297 dependencies = [ 1298 "proc-macro2", 1299 "quote", 1300 - "syn 2.0.111", 1301 ] 1302 1303 [[package]] ··· 1399 dependencies = [ 1400 "proc-macro2", 1401 "quote", 1402 - "syn 2.0.111", 1403 ] 1404 1405 [[package]] ··· 1485 "proc-macro-crate", 1486 "proc-macro2", 1487 "quote", 1488 - "syn 2.0.111", 1489 ] 1490 1491 [[package]] ··· 1664 checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" 1665 dependencies = [ 1666 "proc-macro2", 1667 - "syn 2.0.111", 1668 ] 1669 1670 [[package]] ··· 1711 "prost", 1712 "prost-types", 1713 "regex", 1714 - "syn 2.0.111", 1715 "tempfile", 1716 ] 1717 ··· 1725 "itertools", 1726 "proc-macro2", 1727 "quote", 1728 - "syn 2.0.111", 1729 ] 1730 1731 [[package]] ··· 2009 dependencies = [ 2010 "proc-macro2", 2011 "quote", 2012 - "syn 2.0.111", 2013 ] 2014 2015 [[package]] ··· 2056 "darling", 2057 "proc-macro2", 2058 "quote", 2059 - "syn 2.0.111", 2060 ] 2061 2062 [[package]] ··· 2253 "quote", 2254 "sqlx-core", 2255 "sqlx-macros-core", 2256 - "syn 2.0.111", 2257 ] 2258 2259 [[package]] ··· 2276 "sqlx-mysql", 2277 "sqlx-postgres", 2278 "sqlx-sqlite", 2279 - "syn 2.0.111", 2280 "tokio", 2281 "url", 2282 ] ··· 2466 2467 [[package]] 2468 name = "syn" 2469 - version = "2.0.111" 2470 source = "registry+https://github.com/rust-lang/crates.io-index" 2471 - checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" 2472 dependencies = [ 2473 "proc-macro2", 2474 "quote", ··· 2483 dependencies = [ 2484 "proc-macro2", 2485 "quote", 2486 - "syn 2.0.111", 2487 ] 2488 2489 [[package]] ··· 2565 dependencies = [ 2566 "proc-macro2", 2567 "quote", 2568 - "syn 2.0.111", 2569 ] 2570 2571 [[package]] ··· 2576 dependencies = [ 2577 "proc-macro2", 2578 "quote", 2579 - "syn 2.0.111", 2580 ] 2581 2582 [[package]] ··· 2644 dependencies = [ 2645 "proc-macro2", 2646 "quote", 2647 - "syn 2.0.111", 2648 ] 2649 2650 [[package]] ··· 2703 2704 [[package]] 2705 name = "tracing" 2706 - version = "0.1.43" 2707 source = "registry+https://github.com/rust-lang/crates.io-index" 2708 - checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" 2709 dependencies = [ 2710 "log", 2711 "pin-project-lite", ··· 2715 2716 [[package]] 2717 name = "tracing-attributes" 2718 - version = "0.1.31" 2719 source = "registry+https://github.com/rust-lang/crates.io-index" 2720 - checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" 2721 dependencies = [ 2722 "proc-macro2", 2723 "quote", 2724 - "syn 2.0.111", 2725 ] 2726 2727 [[package]] 2728 name = "tracing-core" 2729 - version = "0.1.35" 2730 source = "registry+https://github.com/rust-lang/crates.io-index" 2731 - checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" 2732 dependencies = [ 2733 "once_cell", 2734 "valuable", ··· 2747 2748 [[package]] 2749 name = "tracing-subscriber" 2750 - version = "0.3.22" 2751 source = "registry+https://github.com/rust-lang/crates.io-index" 2752 - checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" 2753 dependencies = [ 2754 "nu-ansi-term", 2755 "sharded-slab", ··· 2797 version = "0.1.4" 2798 source = "registry+https://github.com/rust-lang/crates.io-index" 2799 checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" 2800 - 2801 - [[package]] 2802 - name = "unicode-segmentation" 2803 - version = "1.12.0" 2804 - source = "registry+https://github.com/rust-lang/crates.io-index" 2805 - checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" 2806 2807 [[package]] 2808 name = "unicode-width" ··· 3249 dependencies = [ 3250 "proc-macro2", 3251 "quote", 3252 - "syn 2.0.111", 3253 "synstructure", 3254 ] 3255 ··· 3270 dependencies = [ 3271 "proc-macro2", 3272 "quote", 3273 - "syn 2.0.111", 3274 ] 3275 3276 [[package]] ··· 3290 dependencies = [ 3291 "proc-macro2", 3292 "quote", 3293 - "syn 2.0.111", 3294 "synstructure", 3295 ] 3296 ··· 3330 dependencies = [ 3331 "proc-macro2", 3332 "quote", 3333 - "syn 2.0.111", 3334 ] 3335 3336 [[package]]
··· 18 checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 19 20 [[package]] 21 + name = "agent" 22 + version = "1.0.0-beta.0" 23 + dependencies = [ 24 + "anyhow", 25 + "base64", 26 + "futures-util", 27 + "nix 0.30.1", 28 + "prost", 29 + "prost-build", 30 + "sha2", 31 + "tokio", 32 + "tokio-util", 33 + ] 34 + 35 + [[package]] 36 name = "aho-corasick" 37 version = "1.1.4" 38 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 311 "heck", 312 "proc-macro2", 313 "quote", 314 + "syn 2.0.110", 315 ] 316 317 [[package]] ··· 342 checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 343 344 [[package]] 345 name = "cpufeatures" 346 version = "0.2.17" 347 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 352 353 [[package]] 354 name = "crc" 355 + version = "3.4.0" 356 source = "registry+https://github.com/rust-lang/crates.io-index" 357 + checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" 358 dependencies = [ 359 "crc-catalog", 360 ] ··· 414 dependencies = [ 415 "proc-macro2", 416 "quote", 417 + "syn 2.0.110", 418 ] 419 420 [[package]] ··· 438 "proc-macro2", 439 "quote", 440 "strsim", 441 + "syn 2.0.110", 442 ] 443 444 [[package]] ··· 449 dependencies = [ 450 "darling_core", 451 "quote", 452 + "syn 2.0.110", 453 ] 454 455 [[package]] ··· 471 472 [[package]] 473 name = "derive_more" 474 + version = "2.0.1" 475 source = "registry+https://github.com/rust-lang/crates.io-index" 476 + checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" 477 dependencies = [ 478 "derive_more-impl", 479 ] 480 481 [[package]] 482 name = "derive_more-impl" 483 + version = "2.0.1" 484 source = "registry+https://github.com/rust-lang/crates.io-index" 485 + checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" 486 dependencies = [ 487 "proc-macro2", 488 "quote", 489 + "syn 2.0.110", 490 "unicode-xid", 491 ] 492 ··· 526 dependencies = [ 527 "proc-macro2", 528 "quote", 529 + "syn 2.0.110", 530 ] 531 532 [[package]] ··· 594 "once_cell", 595 "proc-macro2", 596 "quote", 597 + "syn 2.0.110", 598 ] 599 600 [[package]] ··· 775 dependencies = [ 776 "proc-macro2", 777 "quote", 778 + "syn 2.0.110", 779 ] 780 781 [[package]] ··· 1121 dependencies = [ 1122 "getrandom 0.3.3", 1123 "libc", 1124 ] 1125 1126 [[package]] ··· 1136 name = "lib" 1137 version = "1.0.0-beta.0" 1138 dependencies = [ 1139 + "agent", 1140 "aho-corasick", 1141 "anyhow", 1142 "base64", ··· 1147 "gjson", 1148 "im", 1149 "itertools", 1150 "miette", 1151 "nix 0.30.1", 1152 "nix-compat", ··· 1161 "sha2", 1162 "sqlx", 1163 "strip-ansi-escapes", 1164 + "syn 2.0.110", 1165 "tempdir", 1166 "termion", 1167 "thiserror 2.0.17", ··· 1286 dependencies = [ 1287 "proc-macro2", 1288 "quote", 1289 + "syn 2.0.110", 1290 ] 1291 1292 [[package]] ··· 1388 dependencies = [ 1389 "proc-macro2", 1390 "quote", 1391 + "syn 2.0.110", 1392 ] 1393 1394 [[package]] ··· 1474 "proc-macro-crate", 1475 "proc-macro2", 1476 "quote", 1477 + "syn 2.0.110", 1478 ] 1479 1480 [[package]] ··· 1653 checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" 1654 dependencies = [ 1655 "proc-macro2", 1656 + "syn 2.0.110", 1657 ] 1658 1659 [[package]] ··· 1700 "prost", 1701 "prost-types", 1702 "regex", 1703 + "syn 2.0.110", 1704 "tempfile", 1705 ] 1706 ··· 1714 "itertools", 1715 "proc-macro2", 1716 "quote", 1717 + "syn 2.0.110", 1718 ] 1719 1720 [[package]] ··· 1998 dependencies = [ 1999 "proc-macro2", 2000 "quote", 2001 + "syn 2.0.110", 2002 ] 2003 2004 [[package]] ··· 2045 "darling", 2046 "proc-macro2", 2047 "quote", 2048 + "syn 2.0.110", 2049 ] 2050 2051 [[package]] ··· 2242 "quote", 2243 "sqlx-core", 2244 "sqlx-macros-core", 2245 + "syn 2.0.110", 2246 ] 2247 2248 [[package]] ··· 2265 "sqlx-mysql", 2266 "sqlx-postgres", 2267 "sqlx-sqlite", 2268 + "syn 2.0.110", 2269 "tokio", 2270 "url", 2271 ] ··· 2455 2456 [[package]] 2457 name = "syn" 2458 + version = "2.0.110" 2459 source = "registry+https://github.com/rust-lang/crates.io-index" 2460 + checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" 2461 dependencies = [ 2462 "proc-macro2", 2463 "quote", ··· 2472 dependencies = [ 2473 "proc-macro2", 2474 "quote", 2475 + "syn 2.0.110", 2476 ] 2477 2478 [[package]] ··· 2554 dependencies = [ 2555 "proc-macro2", 2556 "quote", 2557 + "syn 2.0.110", 2558 ] 2559 2560 [[package]] ··· 2565 dependencies = [ 2566 "proc-macro2", 2567 "quote", 2568 + "syn 2.0.110", 2569 ] 2570 2571 [[package]] ··· 2633 dependencies = [ 2634 "proc-macro2", 2635 "quote", 2636 + "syn 2.0.110", 2637 ] 2638 2639 [[package]] ··· 2692 2693 [[package]] 2694 name = "tracing" 2695 + version = "0.1.41" 2696 source = "registry+https://github.com/rust-lang/crates.io-index" 2697 + checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 2698 dependencies = [ 2699 "log", 2700 "pin-project-lite", ··· 2704 2705 [[package]] 2706 name = "tracing-attributes" 2707 + version = "0.1.30" 2708 source = "registry+https://github.com/rust-lang/crates.io-index" 2709 + checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" 2710 dependencies = [ 2711 "proc-macro2", 2712 "quote", 2713 + "syn 2.0.110", 2714 ] 2715 2716 [[package]] 2717 name = "tracing-core" 2718 + version = "0.1.34" 2719 source = "registry+https://github.com/rust-lang/crates.io-index" 2720 + checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 2721 dependencies = [ 2722 "once_cell", 2723 "valuable", ··· 2736 2737 [[package]] 2738 name = "tracing-subscriber" 2739 + version = "0.3.20" 2740 source = "registry+https://github.com/rust-lang/crates.io-index" 2741 + checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" 2742 dependencies = [ 2743 "nu-ansi-term", 2744 "sharded-slab", ··· 2786 version = "0.1.4" 2787 source = "registry+https://github.com/rust-lang/crates.io-index" 2788 checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" 2789 2790 [[package]] 2791 name = "unicode-width" ··· 3232 dependencies = [ 3233 "proc-macro2", 3234 "quote", 3235 + "syn 2.0.110", 3236 "synstructure", 3237 ] 3238 ··· 3253 dependencies = [ 3254 "proc-macro2", 3255 "quote", 3256 + "syn 2.0.110", 3257 ] 3258 3259 [[package]] ··· 3273 dependencies = [ 3274 "proc-macro2", 3275 "quote", 3276 + "syn 2.0.110", 3277 "synstructure", 3278 ] 3279 ··· 3313 dependencies = [ 3314 "proc-macro2", 3315 "quote", 3316 + "syn 2.0.110", 3317 ] 3318 3319 [[package]]
+1 -1
Cargo.toml
··· 1 [workspace] 2 - members = ["wire/key_agent", "wire/lib", "wire/cli"] 3 resolver = "2" 4 package.edition = "2024" 5 package.version = "1.0.0-beta.0"
··· 1 [workspace] 2 + members = ["wire/agent", "wire/lib", "wire/cli"] 3 resolver = "2" 4 package.edition = "2024" 5 package.version = "1.0.0-beta.0"
+1 -1
README.md
··· 15 │ │ └── Rust library containing business logic, consumed by `wire` 16 │ ├── cli 17 │ │ └── Rust binary, using `lib` 18 - │ └── key_agent 19 │ └── Rust binary ran on a target node. receives key file bytes and metadata w/ protobuf over SSH stdin 20 ├── doc 21 │ └── a [vitepress](https://vitepress.dev/) site
··· 15 │ │ └── Rust library containing business logic, consumed by `wire` 16 │ ├── cli 17 │ │ └── Rust binary, using `lib` 18 + │ └── agent 19 │ └── Rust binary ran on a target node. receives key file bytes and metadata w/ protobuf over SSH stdin 20 ├── doc 21 │ └── a [vitepress](https://vitepress.dev/) site
+1 -1
doc/guides/keys.md
··· 38 Otherwise, you may see errors such as: 39 40 ``` 41 - error: cannot add path '/nix/store/...-wire-tool-key_agent-x86_64-linux-...' because it lacks a signature by a trusted key 42 ``` 43 44 This is a requirement because `nix copy` is used to copy the binary.
··· 38 Otherwise, you may see errors such as: 39 40 ``` 41 + error: cannot add path '/nix/store/...-wire-tool-agent-x86_64-linux-...' because it lacks a signature by a trusted key 42 ``` 43 44 This is a requirement because `nix copy` is used to copy the binary.
+1 -1
doc/guides/non-root-user.md
··· 56 INFO eval_hive: evaluating hive Flake("/path/to/hive") 57 ... 58 INFO media | step="Upload key @ NoFilter" progress="3/4" 59 - deploy-user@node:22 | Authenticate for "sudo /nix/store/.../bin/key_agent": 60 [sudo] password for deploy-user: 61 ``` 62
··· 56 INFO eval_hive: evaluating hive Flake("/path/to/hive") 57 ... 58 INFO media | step="Upload key @ NoFilter" progress="3/4" 59 + deploy-user@node:22 | Authenticate for "sudo /nix/store/.../bin/agent": 60 [sudo] password for deploy-user: 61 ``` 62
+1 -1
flake.nix
··· 38 ./nix/shells.nix 39 ./nix/tests.nix 40 ./wire/cli 41 - ./wire/key_agent 42 ./doc 43 ./tests/nix 44 ./runtime
··· 38 ./nix/shells.nix 39 ./nix/tests.nix 40 ./wire/cli 41 + ./wire/agent 42 ./doc 43 ./tests/nix 44 ./runtime
+1 -1
justfile
··· 4 cargo build --profile profiling --features dhat-heap 5 @echo 'dhat binaries in target/profiling' 6 @echo 'Example:' 7 - @echo 'WIRE_KEY_AGENT=/nix/store/...-key_agent-0.1.0 PROJECT/target/profiling/wire apply ...'
··· 4 cargo build --profile profiling --features dhat-heap 5 @echo 'dhat binaries in target/profiling' 6 @echo 'Example:' 7 + @echo 'WIRE_AGENT=/nix/store/...-agent-0.1.0 PROJECT/target/profiling/wire apply ...'
+1 -1
nix/tests.nix
··· 20 21 installPhaseCommand = '' 22 mkdir -p $out 23 - cp $(ls target/debug/deps/{wire,lib,key_agent}-* | grep -v "\.d") $out 24 ''; 25 } 26 // commonArgs
··· 20 21 installPhaseCommand = '' 22 mkdir -p $out 23 + cp $(ls target/debug/deps/{wire,lib,agent}-* | grep -v "\.d") $out 24 ''; 25 } 26 // commonArgs
+17
wire/agent/default.nix
···
··· 1 + { 2 + perSystem = 3 + { 4 + buildRustProgram, 5 + system, 6 + ... 7 + }: 8 + { 9 + packages = { 10 + agent = buildRustProgram { 11 + name = "agent"; 12 + pname = "wire-tool-agent-${system}"; 13 + cargoExtraArgs = "-p agent"; 14 + }; 15 + }; 16 + }; 17 + }
+2 -2
wire/cli/default.nix
··· 12 let 13 cleanSystem = system: lib.replaceStrings [ "-" ] [ "_" ] system; 14 agents = lib.strings.concatMapStrings ( 15 - system: "--set WIRE_KEY_AGENT_${cleanSystem system} ${(getSystem system).packages.agent} " 16 ) (import inputs.linux-systems); 17 in 18 { ··· 70 pkgs.makeWrapper 71 ]; 72 postBuild = '' 73 - wrapProgram $out/bin/wire --set WIRE_KEY_AGENT_${cleanSystem system} ${self'.packages.agent} 74 ''; 75 meta.mainProgram = "wire"; 76 };
··· 12 let 13 cleanSystem = system: lib.replaceStrings [ "-" ] [ "_" ] system; 14 agents = lib.strings.concatMapStrings ( 15 + system: "--set WIRE_AGENT_${cleanSystem system} ${(getSystem system).packages.agent} " 16 ) (import inputs.linux-systems); 17 in 18 { ··· 70 pkgs.makeWrapper 71 ]; 72 postBuild = '' 73 + wrapProgram $out/bin/wire --set WIRE_AGENT_${cleanSystem system} ${self'.packages.agent} 74 ''; 75 meta.mainProgram = "wire"; 76 };
+1 -1
wire/key_agent/Cargo.toml wire/agent/Cargo.toml
··· 1 [package] 2 - name = "key_agent" 3 edition.workspace = true 4 version.workspace = true 5
··· 1 [package] 2 + name = "agent" 3 edition.workspace = true 4 version.workspace = true 5
wire/key_agent/build.rs wire/agent/build.rs
-17
wire/key_agent/default.nix
··· 1 - { 2 - perSystem = 3 - { 4 - buildRustProgram, 5 - system, 6 - ... 7 - }: 8 - { 9 - packages = { 10 - agent = buildRustProgram { 11 - name = "key_agent"; 12 - pname = "wire-tool-key_agent-${system}"; 13 - cargoExtraArgs = "-p key_agent"; 14 - }; 15 - }; 16 - }; 17 - }
···
+1 -1
wire/key_agent/src/keys.proto wire/agent/src/keys.proto
··· 3 4 syntax = "proto3"; 5 6 - package key_agent.keys; 7 8 message KeySpec { 9 string destination = 1;
··· 3 4 syntax = "proto3"; 5 6 + package agent.keys; 7 8 message KeySpec { 9 string destination = 1;
+1 -1
wire/key_agent/src/lib.rs wire/agent/src/lib.rs
··· 2 // Copyright 2024-2025 wire Contributors 3 4 pub mod keys { 5 - include!(concat!(env!("OUT_DIR"), "/key_agent.keys.rs")); 6 }
··· 2 // Copyright 2024-2025 wire Contributors 3 4 pub mod keys { 5 + include!(concat!(env!("OUT_DIR"), "/agent.keys.rs")); 6 }
+1 -1
wire/key_agent/src/main.rs wire/agent/src/main.rs
··· 5 use base64::Engine; 6 use base64::prelude::BASE64_STANDARD; 7 use futures_util::stream::StreamExt; 8 - use key_agent::keys::KeySpec; 9 use nix::unistd::{Group, User}; 10 use prost::Message; 11 use prost::bytes::Bytes;
··· 5 use base64::Engine; 6 use base64::prelude::BASE64_STANDARD; 7 use futures_util::stream::StreamExt; 8 + use agent::keys::KeySpec; 9 use nix::unistd::{Group, User}; 10 use prost::Message; 11 use prost::bytes::Bytes;
+1 -1
wire/lib/Cargo.toml
··· 17 im = { workspace = true } 18 thiserror = "2.0.17" 19 derive_more = { version = "2.0.1", features = ["display"] } 20 - key_agent = { path = "../key_agent" } 21 futures = "0.3.31" 22 prost = { workspace = true } 23 gethostname = "1.1.0"
··· 17 im = { workspace = true } 18 thiserror = "2.0.17" 19 derive_more = { version = "2.0.1", features = ["display"] } 20 + agent = { path = "../agent" } 21 futures = "0.3.31" 22 prost = { workspace = true } 23 gethostname = "1.1.0"
+1 -1
wire/lib/src/hive/node.rs
··· 291 pub evaluation: Option<Derivation>, 292 pub evaluation_rx: Option<oneshot::Receiver<Result<Derivation, HiveLibError>>>, 293 pub build: Option<String>, 294 - pub key_agent_directory: Option<String>, 295 } 296 297 pub struct Context<'a> {
··· 291 pub evaluation: Option<Derivation>, 292 pub evaluation_rx: Option<oneshot::Receiver<Result<Derivation, HiveLibError>>>, 293 pub build: Option<String>, 294 + pub agent_directory: Option<String>, 295 } 296 297 pub struct Context<'a> {
+6 -6
wire/lib/src/hive/steps/keys.rs
··· 125 } 126 } 127 128 - async fn process_key(key: &Key) -> Result<(key_agent::keys::KeySpec, Vec<u8>), KeyError> { 129 let mut reader = create_reader(key).await?; 130 131 let mut buf = Vec::new(); ··· 140 debug!("Staging push to {}", destination.clone().display()); 141 142 Ok(( 143 - key_agent::keys::KeySpec { 144 length: buf 145 .len() 146 .try_into() ··· 221 222 #[instrument(skip_all, name = "keys")] 223 async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> { 224 - let agent_directory = ctx.state.key_agent_directory.as_ref().unwrap(); 225 226 let futures = ctx 227 .node ··· 249 return Ok(()); 250 } 251 252 - let command_string = format!("{agent_directory}/bin/key_agent"); 253 254 let mut child = run_command( 255 &CommandArguments::new(command_string, ctx.modifiers) ··· 305 #[instrument(skip_all, name = "push_agent")] 306 async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> { 307 let arg_name = format!( 308 - "WIRE_KEY_AGENT_{platform}", 309 platform = ctx.node.host_platform.replace('-', "_") 310 ); 311 ··· 322 push(ctx, Push::Path(&agent_directory)).await?; 323 } 324 325 - ctx.state.key_agent_directory = Some(agent_directory); 326 327 Ok(()) 328 }
··· 125 } 126 } 127 128 + async fn process_key(key: &Key) -> Result<(agent::keys::KeySpec, Vec<u8>), KeyError> { 129 let mut reader = create_reader(key).await?; 130 131 let mut buf = Vec::new(); ··· 140 debug!("Staging push to {}", destination.clone().display()); 141 142 Ok(( 143 + agent::keys::KeySpec { 144 length: buf 145 .len() 146 .try_into() ··· 221 222 #[instrument(skip_all, name = "keys")] 223 async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> { 224 + let agent_directory = ctx.state.agent_directory.as_ref().unwrap(); 225 226 let futures = ctx 227 .node ··· 249 return Ok(()); 250 } 251 252 + let command_string = format!("{agent_directory}/bin/agent"); 253 254 let mut child = run_command( 255 &CommandArguments::new(command_string, ctx.modifiers) ··· 305 #[instrument(skip_all, name = "push_agent")] 306 async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> { 307 let arg_name = format!( 308 + "WIRE_AGENT_{platform}", 309 platform = ctx.node.host_platform.replace('-', "_") 310 ); 311 ··· 322 push(ctx, Push::Path(&agent_directory)).await?; 323 } 324 325 + ctx.state.agent_directory = Some(agent_directory); 326 327 Ok(()) 328 }