Skip to content

refactor(winrm): delete dead AnyTag/TagList and stale tag markers#35

Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 3 commits into
masterfrom
stack/xml-fromxml-rm-deadcode
Jun 25, 2026
Merged

refactor(winrm): delete dead AnyTag/TagList and stale tag markers#35
irvingouj@Devolutions (irvingoujAtDevolution) merged 3 commits into
masterfrom
stack/xml-fromxml-rm-deadcode

Conversation

@irvingoujAtDevolution

Copy link
Copy Markdown
Collaborator

Part 3/6. Base: stack/xml-fromxml-nested-fix.

Deletes the now-dead AnyTag/TagList types and the tag-name markers orphaned by their removal. The derive reads identity through the NamedTag trait (alias-friendly). Pure deletion + trait plumbing; no wire-format change.

FromXml stack (review/merge bottom-up):

  1. core + winrm migration (feat(xml): namespace-correct FromXml core + winrm migration #33)
  2. nested-tag descend fix
  3. delete dead AnyTag/TagList + markers
  4. tag! macro + aliases
  5. harden / reject malformed XML
  6. tests

`Tag<Tag<W, M>, N>` (e.g. `command_response: <CommandResponse><CommandId/>`,
`signal: <Signal><SignalCode/>`) models an N element wrapping a single M child.
The new FromXml passed the parent node straight to the inner tag's from_xml,
which then checked the wrapper's name and failed
("Invalid tag: expected 'CommandId', found 'CommandResponse'").

Tag::from_xml now descends to the single N-named child when handed a node that
isn't itself N — restoring the old from_children semantics for nested tags.

This only surfaced on SSPI auth (Negotiate/Kerberos/NTLM), which exchanges
CommandId; Basic never hits that path, so unit fixtures missed it. Added a
unit regression test for the nested CommandResponse/CommandId shape.

Verified: real-server transport×auth×sealing matrix now 10/10 (was 4/10 on
this branch; master is 10/10). fmt + clippy + workspace tests all clean.
…a NamedTag

Two steps toward de-uglifying the Tag layer, both behavior-preserving:

1. `NamedTag` trait: exposes a tag's (TAG_NAME, NAMESPACE) at the type level,
   forwarding from `N: TagName`. `#[derive(FromXml)]` now reads identity via
   `<FieldType as NamedTag>` instead of syntactically extracting the `N` param —
   so it will keep working once fields become type aliases for `Tag<'a, V, N>`.

2. Delete `AnyTag` + `TagList`: the dynamic heterogeneous-list escape hatch.
   `TagList::with_tag` was never called (never built with content), its ~45
   AnyTag variants were dead (SOAP envelope/header/body are typed structs now;
   the PSRP CLIXML tags belong to ps_value), and the four `Tag<TagList, _>`
   bodies on SoapBody (pull/release/get_status/command) were never populated and
   only checked for `.is_none()` in tests. Removed the fields, the two files,
   and the stale test assertions.

Verified: workspace tests pass; real-server matrix 10/10.
With AnyTag gone, ~22 TagName markers had no remaining referent: the PSRP
CLIXML set (Obj, MS, TN, T, S, B, Nil, DCT, En, Key, Value, ToString,
I32TagName, BA, Version), the InitRunspacepool set (MinRunspaces, MaxRunspaces,
PSThreadOptions, ApartmentState, HostInfo, ApplicationArguments — ps_value's
job), and FaultTo / From / FragmentTransfer. Removed. Workspace compiles, so
nothing referenced them.
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