Devolutions / Devolutions/ironPosh

PSRP: handle USER_EVENT

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Gap
`USER_EVENT` (a server→client runspace-pool event, e.g. from `Register-EngineEvent` / `New-Event` forwarding) is not handled — message-type ID only. Both pypsrp/psrpcore and native C# consume it.

## Current state
- Enum ID only in `crates/ironposh-psrp/src/cores.rs`; no message struct, not dispatched in the runspace-pool incoming handler.

## Required
- Parse the `USER_EVENT` PSRP message (PSEventArgs: event identifier, source id, source args, message data, time, computer, runspace id).
- Surface it as a client-core `UserEvent`-style output so consumers can observe forwarded events.

## Acceptance
- Test: a script that fires a forwarded engine event produces a parsed user-event on the client stream.

## References
- psrpcore `src/psrpcore/_psrp.py` (USER_EVENT, `send_event`), pypsrp `powershell.py` `_process_user_event`.
- Native C# `EncodeAndDecode.cs` (`PSEventArgs`, 0x00021008).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the USER_EVENT enum entry in crates/ironposh-psrp/src/cores.rs and trace the runspace-pool incoming handler, then compare the parsing and dispatch behavior in psrpcore, pypsrp, and native C# references. Done means a script that forwards an engine event produces a parsed UserEvent-style value on the client stream, covered by the requested test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.