feat(agent): expose active package policy - #1937
feat(agent): expose active package policy#1937Benoît Cortier (CBenoit) wants to merge 2 commits into
Conversation
Expose the validated active package-broker policy through the shared authenticated GET /v1/policy route. Return a structured unavailable error without leaking policy source or file-security details. This requires now-policy-api and now-policy-server-template 0.4.0 from Devolutions/now-libraries#93 before the change can ship. Issue: Devolutions/now-libraries#93 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Implementation notes:
Validated against frozen shared commit Commands and results: The draft remains blocked until Note LLM-assisted content (no human feedback). |
There was a problem hiding this comment.
Pull request overview
Adds authenticated active-policy inspection to the Agent’s package broker.
Changes:
- Implements
GET /v1/policywith structured responses. - Reuses connection authentication and adds snapshot/concurrency tests.
- Remains blocked on publishing and committing the 0.4.0 dependencies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/now-package-broker/src/server/mod.rs |
Implements and tests policy retrieval. |
crates/now-package-broker/src/auth.rs |
Exposes connection-level authentication for the endpoint. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Return a generic policy-unavailable message so clients cannot infer whether the active policy is file-backed, missing, or corrupt. Issue: Devolutions/now-libraries#93 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exposes the validated active package-broker policy through the shared authenticated
GET /v1/policyroute. Clients receive a stable policy snapshot, while unavailable policies return a structured 503 response without leaking policy source or file-security details.Coordinated Phase 1 pull requests: Devolutions/now-libraries#93 defines the shared contract, #1937 implements the Agent endpoint, and Devolutions/UniGetUI#5292 consumes it.
The Agent implementation was integrated against exact shared contract commit
961e833c929793116b697e0943a7573ad6e21398using a temporary external Cargo patch fornow-policy,now-policy-api, andnow-policy-server-template, preserving onePolicyDocumenttype identity. No local paths, git dependencies, temporary sources, or patched lockfile state are committed. Focused endpoint, authentication, serialization, method, and concurrent snapshot tests passed; focused and workspace Clippy passed; and the Devolutions Agent build passed.The workspace test run reached 251 passed and 1 ignored before the pre-existing host-specific
winget_app_exec_alias_passes_elevated_verificationtest rejected the local WindowsAppswinget.exeDACL because it grants the current user write access.This draft remains blocked until
now-policy-api0.4.0 andnow-policy-server-template0.4.0 are published and the final registry dependencies and lockfile are committed. Do not replace that publication gate with local or git dependencies.Issue: Devolutions/now-libraries#93
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com