Skip to content

feat(agent): add PSU Event Hub compatibility#1803

Draft
Marc-André Moreau (mamoreau-devolutions) wants to merge 2 commits into
masterfrom
mamoreau-devolutions/psu-agent-port
Draft

feat(agent): add PSU Event Hub compatibility#1803
Marc-André Moreau (mamoreau-devolutions) wants to merge 2 commits into
masterfrom
mamoreau-devolutions/psu-agent-port

Conversation

@mamoreau-devolutions
Copy link
Copy Markdown
Contributor

Adds PowerShell Universal Event Hub remote agent compatibility as an optional Devolutions Agent feature. This lets Devolutions Agent connect to PSU Event Hubs, receive command/script invocations, and return PSU-compatible PowerShell results without installing a separate PSU agent service.

The feature also supports migration-oriented behavior for existing PSU agent configuration, including legacy config files, PSU_ environment overrides, $secret: AppToken references, and bounded PowerShell worker concurrency.

Draft until live PSU server compatibility testing and installer artifact validation are complete.

Issue: N/A

Add an optional Devolutions Agent feature that connects to PowerShell Universal Event Hubs, handles SignalR invocations, and executes commands through a PowerShell worker using PSSerializer-compatible CLIXML.

Wire the feature into agent configuration, service startup, and the Windows installer feature list.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Improve PSU Event Hub migration behavior, environment compatibility, AppToken secret resolution, and worker concurrency limits.

Preserve existing installer feature config when toggling features and import legacy PSU connections when the feature is enabled without explicit Devolutions Agent connections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions
Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Adds a Rust PSU Event Hub compatibility module under devolutions-agent/src/psu_event_hub with a minimal SignalR JSON client for PSU Event Hub invocations.
  • Uses PowerShell itself for CLIXML compatibility through [System.Management.Automation.PSSerializer] instead of reimplementing PSU serialization in Rust.
  • Supports {Hub}, {Hub}Void, {Hub}Module, {Hub}ModuleVoid, and GetResult semantics, including remove-on-read result storage.
  • Loads native PsuEventHub config and imports legacy PSU config from %ProgramData%\PowerShellUniversal\eventHubClient.json, %ProgramData%\PowerShellUniversal\agent.json, and %AppData%\PowerShellUniversal\agent.json.
  • Adds practical PSU_ environment compatibility and $secret: AppToken resolution via PowerShell Get-Secret.
  • Installer changes expose the feature as an optional Devolutions Agent component and preserve existing feature JSON when toggling Enabled.
  • Worker execution is bounded by MaxWorkerPoolSize; persistent worker pooling remains a future performance optimization if needed.

Validation performed:

  • cargo +nightly fmt --all
  • cargo clippy -p devolutions-agent --tests --offline -- -D warnings
  • cargo test -p devolutions-agent --offline

Known gaps before marking ready:

  • Live PSU server smoke/compatibility testing is still needed.
  • Windows UseDefaultCredentials/Negotiate auth is still not implemented.
  • Full local MSI packaging was started but not completed in this session; CI workflow was dispatched earlier for installer artifacts.

@github-actions
Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

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.

1 participant