feat(agent): implement package broker#1847
feat(agent): implement package broker#1847Vladyslav Nikonov (vnikonov-devolutions) wants to merge 4 commits into
Conversation
Let maintainers know that an action is required on their side
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2158cf9 to
83fa0b1
Compare
There was a problem hiding this comment.
Pull request overview
Implements an early Windows package broker for Devolutions Agent.
Changes:
- Adds policy loading, evaluation, live reload, and sample scenarios.
- Adds authenticated named-pipe APIs, operation tracking, and status polling.
- Adds WinGet/PowerShell command builders and elevated execution.
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
.gitattributes |
Adds asset and YAML attributes. |
Cargo.lock |
Locks new broker dependencies. |
devolutions-agent/Cargo.toml |
Adds broker dependencies and Windows features. |
devolutions-agent/src/lib.rs |
Exposes Windows broker modules. |
devolutions-agent/src/service.rs |
Starts the configured broker task. |
devolutions-agent/src/config.rs |
Adds broker and debug configuration. |
devolutions-agent/src/code_signing.rs |
Centralizes signature validation. |
devolutions-agent/src/updater/package.rs |
Reuses signature helpers. |
devolutions-agent/src/broker/mod.rs |
Defines broker modules. |
devolutions-agent/src/broker/auth.rs |
Authenticates pipe clients. |
devolutions-agent/src/broker/task.rs |
Coordinates broker subsystems. |
devolutions-agent/src/broker/pipe.rs |
Implements named-pipe transport. |
devolutions-agent/src/broker/policy_loader.rs |
Loads JSON/YAML policies. |
devolutions-agent/src/broker/policy_watcher.rs |
Implements policy hot reload. |
devolutions-agent/src/broker/operation_tracker.rs |
Tracks asynchronous operations. |
devolutions-agent/src/broker/server/mod.rs |
Implements broker API behavior. |
devolutions-agent/src/broker/server/connection.rs |
Serves HTTP pipe connections. |
devolutions-agent/src/broker/server/execution.rs |
Runs background operations. |
devolutions-agent/src/broker/server/responses.rs |
Builds API responses. |
devolutions-agent/src/broker/executor/mod.rs |
Defines execution abstractions. |
devolutions-agent/src/broker/executor/output.rs |
Handles output and exit codes. |
devolutions-agent/src/broker/executor/windows/mod.rs |
Implements Windows execution plans. |
devolutions-agent/src/broker/executor/windows/process.rs |
Creates user-token processes. |
devolutions-agent/src/broker/executor/windows/token.rs |
Resolves sessions and tokens. |
devolutions-agent/src/broker/command_builder/mod.rs |
Dispatches command construction. |
devolutions-agent/src/broker/command_builder/winget.rs |
Builds WinGet commands. |
devolutions-agent/src/broker/command_builder/powershell.rs |
Builds PowerShell commands. |
devolutions-agent/src/broker/evaluator/mod.rs |
Implements policy precedence. |
devolutions-agent/src/broker/evaluator/matching.rs |
Matches request attributes. |
devolutions-agent/src/broker/evaluator/constraints.rs |
Enforces rule constraints. |
devolutions-agent/src/broker/evaluator/version.rs |
Matches version ranges. |
devolutions-agent/src/broker/evaluator/wildcard.rs |
Implements wildcard matching. |
devolutions-agent/src/broker/evaluator/tests.rs |
Tests policy evaluation. |
devolutions-agent/src/broker/scenario_tests.rs |
Runs sample scenarios. |
devolutions-agent/src/broker/assets/samples/corporate-allowlist.policy.json |
Adds allowlist policy sample. |
devolutions-agent/src/broker/assets/samples/deny-risky-options.policy.json |
Adds deny-list policy sample. |
devolutions-agent/src/broker/assets/samples/scenarios/baseline.scenarios.json |
Defines baseline scenarios. |
devolutions-agent/src/broker/assets/samples/requests/winget-vscode-install.request.json |
Adds allowed request sample. |
devolutions-agent/src/broker/assets/samples/requests/winget-vscode-skiphash.request.json |
Adds risky request sample. |
devolutions-agent/src/broker/assets/samples/requests/winget-unknown-install.request.json |
Adds denied request sample. |
crates/devolutions-agent-shared/Cargo.toml |
Adds temporary-file dependencies. |
crates/devolutions-agent-shared/src/lib.rs |
Exposes temporary-file utilities. |
crates/devolutions-agent-shared/src/temp_file.rs |
Adds shared temporary-script handling. |
devolutions-session/Cargo.toml |
Removes direct tempfile dependency. |
devolutions-session/src/main.rs |
Removes obsolete dependency import. |
devolutions-session/src/dvc/fs.rs |
Re-exports the shared guard. |
devolutions-session/src/dvc/task.rs |
Uses shared script utilities. |
devolutions-session/src/dvc/process.rs |
Converts I/O execution errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Current improvements list (generated by Copilot):
Suggested parallel split:
|
|
Given the diff size, I’ll honestly not be able to review as well as I wish I could. For the sake of merging quickly, do you think you could flag me some areas that you think are worth spending extra time reviewing on my end? Can you double check that nothing that is stable today is affected by this? The idea is that it’s okay to merge a POC in a somewhat unfinished state for improved velocity, so it’s easier to iterate together with follow up PRs against master, but it should not impact negatively any other stable component. Anything that is affecting other stable modules should be extracted in a dedicated PR so I can perform the usual hardened review. Otherwise, I’ll just conduct a minimal review and approve possibly with follow up suggestions. How does that sound? |
I think mostly windows executor need some review for critical security issues, and the code from devolutions-agent/updater which was moved to shared code but other than that, I think everything stable is untouched |
Implements now package broker (Also see UniGetUI WIP branch Devolutions/UniGetUI#4826)
Implemented
Not implemented yet
Steps to run this branch:
"PackageBroker":{"Enabled":true, "PolicyPath": "C:/path/to/policy.json"}"__debug__": { "skip_broker_signature_validation": true }UseAgentBrokerfile at%LOCALAPPDATA%/UniGetUI/Configuration(UniGetUI uses file-based config)Do not merge yet, testing in progress