refactor(agent): extract package broker into dedicated crate - #1927
Conversation
Move the package broker subsystem out of the devolutions-agent binary into a new crates/now-package-broker crate, keeping the agent manifest lean and giving the broker-only dependency set (axum, hyper-util, notify, now-policy, ...) its own home. The crate compiles to an empty library on non-Windows platforms. Extract code_signing into devolutions-agent-shared so it is shared between the updater and the broker, which previously reached back into the agent crate for it. The agent forwards the development-only dev-skip-broker-signature feature to the broker crate. Issue: DGW-417 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Let maintainers know that an action is required on their side
|
|
Implementation notes:
Note LLM-assisted content (no human feedback). |
There was a problem hiding this comment.
Pull request overview
Extracts the Windows package broker into a dedicated crate and moves shared Authenticode validation into devolutions-agent-shared.
Changes:
- Introduces
now-package-brokerwith broker logic, dependencies, tests, and assets. - Rewires the agent service and development feature forwarding.
- Shares code-signing utilities between the broker and updater.
Reviewed changes
Copilot reviewed 25 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.gitattributes |
Updates generated-asset path. |
Cargo.lock |
Registers the new crate and dependencies. |
devolutions-agent/Cargo.toml |
Replaces broker dependencies with the new crate. |
devolutions-agent/src/broker/mod.rs |
Removes the embedded broker module. |
devolutions-agent/src/broker/pipe.rs |
Removes the embedded pipe transport. |
devolutions-agent/src/lib.rs |
Removes broker and code-signing modules. |
devolutions-agent/src/service.rs |
Starts the extracted broker crate. |
devolutions-agent/src/updater/package.rs |
Uses shared code-signing helpers. |
crates/devolutions-agent-shared/Cargo.toml |
Adds Windows code-signing dependencies. |
crates/devolutions-agent-shared/src/windows/mod.rs |
Exports code-signing utilities. |
crates/devolutions-agent-shared/src/windows/code_signing.rs |
Provides shared Authenticode validation. |
crates/now-package-broker/Cargo.toml |
Defines the broker crate and feature set. |
crates/now-package-broker/src/lib.rs |
Defines the Windows-only public modules. |
crates/now-package-broker/src/auth.rs |
Authenticates named-pipe clients. |
crates/now-package-broker/src/task.rs |
Implements broker lifecycle management. |
crates/now-package-broker/src/pipe.rs |
Hosts the Windows named-pipe server. |
crates/now-package-broker/src/policy_loader.rs |
Loads and validates policies. |
crates/now-package-broker/src/policy_watcher.rs |
Hot-reloads policy files. |
crates/now-package-broker/src/operation_tracker.rs |
Tracks broker operations. |
crates/now-package-broker/src/scenario_tests.rs |
Updates sample-asset lookup. |
crates/now-package-broker/src/server/mod.rs |
Implements broker API behavior. |
crates/now-package-broker/src/server/connection.rs |
Serves HTTP connections. |
crates/now-package-broker/src/server/execution.rs |
Runs asynchronous operations. |
crates/now-package-broker/src/server/responses.rs |
Builds broker responses and capabilities. |
crates/now-package-broker/src/executor/mod.rs |
Defines executor abstractions. |
crates/now-package-broker/src/executor/output.rs |
Captures output and describes exit codes. |
crates/now-package-broker/src/executor/windows/mod.rs |
Implements Windows execution. |
crates/now-package-broker/src/executor/windows/process.rs |
Creates and supervises processes. |
crates/now-package-broker/src/executor/windows/privileges.rs |
Coordinates process privileges. |
crates/now-package-broker/src/executor/windows/token.rs |
Resolves sessions and tokens. |
crates/now-package-broker/src/evaluator/mod.rs |
Coordinates policy evaluation. |
crates/now-package-broker/src/evaluator/constraints.rs |
Applies policy constraints. |
crates/now-package-broker/src/evaluator/matching.rs |
Matches requests against rules. |
crates/now-package-broker/src/evaluator/tests.rs |
Tests policy decisions. |
crates/now-package-broker/src/evaluator/version.rs |
Matches semantic versions. |
crates/now-package-broker/src/evaluator/wildcard.rs |
Matches wildcard patterns. |
crates/now-package-broker/src/command_builder/mod.rs |
Dispatches package-manager builders. |
crates/now-package-broker/src/command_builder/bun.rs |
Builds Bun commands. |
crates/now-package-broker/src/command_builder/cargo.rs |
Builds Cargo commands. |
crates/now-package-broker/src/command_builder/chocolatey.rs |
Builds Chocolatey commands. |
crates/now-package-broker/src/command_builder/dotnet.rs |
Builds .NET tool commands. |
crates/now-package-broker/src/command_builder/npm.rs |
Builds npm commands. |
crates/now-package-broker/src/command_builder/pip.rs |
Builds pip commands. |
crates/now-package-broker/src/command_builder/powershell.rs |
Builds PowerShell package commands. |
crates/now-package-broker/src/command_builder/scoop.rs |
Builds Scoop commands. |
crates/now-package-broker/src/command_builder/vcpkg.rs |
Builds vcpkg commands. |
crates/now-package-broker/src/command_builder/winget.rs |
Builds WinGet commands. |
crates/now-package-broker/src/assets/samples/scenarios/baseline.scenarios.json |
Adds baseline scenarios. |
crates/now-package-broker/src/assets/samples/requests/winget-vscode-install.request.json |
Adds an allowed request sample. |
crates/now-package-broker/src/assets/samples/requests/winget-vscode-skiphash.request.json |
Adds a risky-option sample. |
crates/now-package-broker/src/assets/samples/requests/winget-unknown-install.request.json |
Adds an unapproved-package sample. |
crates/now-package-broker/src/assets/samples/corporate-allowlist.policy.json |
Adds an allow-list policy sample. |
crates/now-package-broker/src/assets/samples/deny-risky-options.policy.json |
Adds a risky-option policy sample. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| hyper-util = { version = "0.1", features = ["tokio", "server", "server-auto", "service"] } | ||
| notify = { version = "7", default-features = false } | ||
| now-policy = "0.2" | ||
| now-policy-api = { version = "0.3", features = ["policy-compat"] } |
The hostname suggestion list did not set its own text colour, so options were painted with whatever colour the PrimeNG theme supplied. When that colour was close to the panel background the suggestions were invisible until the pointer moved over them. The styles meant to prevent this had been written against PrimeNG 18 class names and stopped matching anything when the app moved to PrimeNG 20. They are now ported to the current class names and the suggestion list is themed like every other dropdown, so options stay readable in both light and dark themes. Issue: DGW-337 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The step was hardcoded to gateway-client, so the four other packages published by this workflow were never pulled into npm-remote-cache and consumers got a 403 on their first install.
Support the explicit VMConnect RDCleanPath shape from Devolutions/IronRDP#1505. Generic PCBs keep the ordinary X.224-first path. VMConnect requests carry a Unicode payload with no X.224; Gateway encodes the binary PCB, writes it before TLS (bounded by the MS-RDPEPS 10s deadline), then leaves CredSSP and X.224 to the client. Credential injection is rejected for this ordering. Depends-on: Devolutions/IronRDP#1505 Issue: Devolutions/IronRDP#1505 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bumps [openssl-probe](https://github.com/rustls/openssl-probe) from 0.1.6 to 0.2.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/rustls/openssl-probe/releases">openssl-probe's releases</a>.</em></p> <blockquote> <h2>0.2.1</h2> <ul> <li>Support for OpenHarmony.</li> <li>Corrections to crate metadata.</li> </ul> <h2>What's Changed</h2> <ul> <li>feat: add openharmony platform preset certs folder by <a href="https://github.com/richerfu"><code>@richerfu</code></a> in <a href="https://redirect.github.com/rustls/openssl-probe/pull/42">rustls/openssl-probe#42</a></li> <li>docs: clarify lib description, update README by <a href="https://github.com/cpu"><code>@cpu</code></a> in <a href="https://redirect.github.com/rustls/openssl-probe/pull/47">rustls/openssl-probe#47</a></li> <li>Prepare 0.2.1 by <a href="https://github.com/ctz"><code>@ctz</code></a> in <a href="https://redirect.github.com/rustls/openssl-probe/pull/46">rustls/openssl-probe#46</a></li> </ul> <p>0.2.0 is the first release after openssl-probe maintenance has been handed over to the rustls team. Thanks to <a href="https://github.com/alexcrichton"><code>@alexcrichton</code></a> for creating and maintaining it for the past 9 years. We're happy to address any feedback you have for this crate.</p> <h2>Breaking changes</h2> <ul> <li><code>ProbeResult::cert_dir</code> is now a <code>Vec<PathBuf></code> rather than an <code>Option<PathBuf></code>, allowing the library to yield multiple suggestions for directories which may contain certificate files.</li> <li>Rather than using a single list of locations for certificate files and certificate directories, openssl-probe now uses much shorter per-platform lists. This should make the API faster and make it less likely to accidentally pick up locations that are unidiomatic for the platform.</li> <li>Removed deprecated API</li> </ul> <h2>What's Changed</h2> <ul> <li>Clean up deprecated API, module structure by <a href="https://github.com/djc"><code>@djc</code></a> in <a href="https://redirect.github.com/rustls/openssl-probe/pull/40">rustls/openssl-probe#40</a></li> <li>Per-platform candidates, multiple directories by <a href="https://github.com/djc"><code>@djc</code></a> in <a href="https://redirect.github.com/rustls/openssl-probe/pull/41">rustls/openssl-probe#41</a></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rustls/openssl-probe/commit/9181752ff5eab32339111dbdcc6cdc9f5a5eb06e"><code>9181752</code></a> Prepare 0.2.1</li> <li><a href="https://github.com/rustls/openssl-probe/commit/2a23322fcd331d00cf109eb5ced0e90736f628f2"><code>2a23322</code></a> docs: clarify lib description, update README</li> <li><a href="https://github.com/rustls/openssl-probe/commit/5e18d538b7fd1b8317f07ed8d99976676be9a915"><code>5e18d53</code></a> feat: add openharmony platform preset certs folder</li> <li><a href="https://github.com/rustls/openssl-probe/commit/df769f449bf942b20de5e39facdd5135657b662d"><code>df769f4</code></a> Update repo URL in Cargo metadata</li> <li><a href="https://github.com/rustls/openssl-probe/commit/cc52ac707bf6e8d2d62292ffdca3b2f03c4a6cc1"><code>cc52ac7</code></a> ci: check cargo-deny (and fix up SPDX metadata)</li> <li><a href="https://github.com/rustls/openssl-probe/commit/4cfa0952d67031604a0f1e975d22707dc553ca4e"><code>4cfa095</code></a> ci: check semver compatibility</li> <li><a href="https://github.com/rustls/openssl-probe/commit/04e7058a36320c0e19f2ad525b1859a8d597dbe5"><code>04e7058</code></a> ci: check clippy</li> <li><a href="https://github.com/rustls/openssl-probe/commit/fbce3247f81d8a63f0b5a3966acde5e8abbb9d25"><code>fbce324</code></a> ci: check code formatting</li> <li><a href="https://github.com/rustls/openssl-probe/commit/11fba1bdf7d81d11a1879ba12be6d96e9dddf599"><code>11fba1b</code></a> ci: setup duplicate workflow cancellation</li> <li><a href="https://github.com/rustls/openssl-probe/commit/a44b6f114a837e229450f40a299894bfc682e0c4"><code>a44b6f1</code></a> ci: restrict workflow permissions</li> <li>Additional commits viewable in <a href="https://github.com/rustls/openssl-probe/compare/0.1.6...0.2.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The pstools Chocolatey package downloads PSTools.zip from Microsoft at install time and pins a checksum that breaks whenever Microsoft updates the zip; the latest package version currently fails this way and breaks the PEDM simulator CI job, while older versions skip verification entirely. Download PSTools.zip directly from Microsoft and verify it against a checksum pinned in the workflow, so installs stay integrity-checked and the hash is bumped deliberately when Microsoft publishes a new PSTools. --------- Co-authored-by: Vladyslav Nikonov <mail@pacmancoder.xyz> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the package broker subsystem out of the devolutions-agent binary into a new crates/now-package-broker crate, keeping the agent manifest lean and giving the broker-only dependency set (axum, hyper-util, notify, now-policy, ...) its own home. The crate compiles to an empty library on non-Windows platforms. Extract code_signing into devolutions-agent-shared so it is shared between the updater and the broker, which previously reached back into the agent crate for it. The agent forwards the development-only dev-skip-broker-signature feature to the broker crate. Issue: DGW-417 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…-devolutions-dgw-417-extract-package-broker-crate
Move the package broker subsystem out of the devolutions-agent binary into a new crates/now-package-broker crate, keeping the agent manifest lean and giving the broker-only dependency set (axum, hyper-util, notify, now-policy, ...) its own home. The crate compiles to an empty library on non-Windows platforms.
Extract code_signing into devolutions-agent-shared so it is shared between the updater and the broker, which previously reached back into the agent crate for it. The agent forwards the development-only dev-skip-broker-signature feature to the broker crate.
Issue: DGW-417