Skip to content

feat(agent): add Chocolatey package broker support - #1874

Draft
Vladyslav Nikonov (vnikonov-devolutions) wants to merge 1 commit into
masterfrom
vnikonov-devolutions-broker-chocolatey
Draft

feat(agent): add Chocolatey package broker support#1874
Vladyslav Nikonov (vnikonov-devolutions) wants to merge 1 commit into
masterfrom
vnikonov-devolutions-broker-chocolatey

Conversation

@vnikonov-devolutions

Copy link
Copy Markdown
Contributor

Adds Chocolatey as a Windows package broker manager so the Devolutions Agent can build and execute install, update, and uninstall operations through choco.exe.

This is a draft because it depends on the shared protocol package publishing ManagerName::Chocolatey. Local validation was performed with temporary [patch.crates-io] entries pointing at D:\now-proto\policies\rust\...; those local absolute-path patches are intentionally not included in this PR.

Issue: TBD

Add Chocolatey command construction, capabilities, and Windows executor hardening for the package broker.

Issue: TBD

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vnikonov-devolutions

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Adds a dedicated Chocolatey command builder for install, upgrade, and uninstall operations.
  • Mirrors UniGetUI Chocolatey semantics where applicable: install, upgrade, uninstall, -y, --no-progress, --source, --notsilent, --forcex86, --prerelease, --ignore-checksums --force, and version pinning with --allow-downgrade.
  • Rejects unsupported or security-sensitive options explicitly instead of silently ignoring them: package channels, user scope, ARM64/neutral architecture, architecture on uninstall, custom install locations, arbitrary custom parameters, no-upgrade, uninstall-previous, and install-only flags on uninstall.
  • Extends Windows executor preparation so Chocolatey commands run through the protected temporary batch wrapper and resolve cmd.exe from System32.
  • Resolves Chocolatey through ChocolateyInstall, defaulting to %ProgramData%\chocolatey, and currently accepts only the trusted system Chocolatey folder path; broader SID/ACL-based trust checks are intentionally left for follow-up.
  • Adds focused unit coverage for Chocolatey command construction, rejection behavior, capabilities, and executor script preparation.

Testing:

  • cargo test -p devolutions-agent chocolatey -- --nocapture
  • cargo test -p devolutions-agent broker::command_builder -- --nocapture
  • cargo clippy -p devolutions-agent --tests -- -D warnings

Protocol dependency:

  • This draft depends on the shared now-policy-api crate publishing ManagerName::Chocolatey.
  • Local validation used temporary root [patch.crates-io] entries pointing to D:\now-proto\policies\rust\...; those local patches are not committed to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants