Skip to content

feat(mstsgu): handle gateway consent messages - #1762

Open
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
masterfrom
copilot/gateway-consent-handling
Open

feat(mstsgu): handle gateway consent messages#1762
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
masterfrom
copilot/gateway-consent-handling

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Decode gateway consent messages as UTF-16LE during tunnel creation.

Accept consent by default, and let callbacks decline it before tunnel authorization and channel setup.

Decode gateway consent messages as UTF-16LE during tunnel creation.

Accept consent by default, and let callbacks decline it before tunnel authorization and channel setup.
Copilot AI balanced review requested due to automatic review settings August 22, 2026 02:12
@github-actions github-actions Bot added maintainer-required Maintainer review or intervention is required risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure labels Aug 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds MS-TSGU gateway consent decoding and callback-based acceptance before tunnel authorization.

Changes:

  • Decodes UTF-16LE consent messages.
  • Adds consent callbacks and decline errors.
  • Adds documentation and focused tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
crates/ironrdp-mstsgu/src/lib.rs Implements consent handling and APIs.
crates/ironrdp-mstsgu/src/test_support.rs Exposes consent evaluation for tests.
crates/ironrdp-mstsgu/tests/consent.rs Tests decoding and callback outcomes.
crates/ironrdp-mstsgu/README.md Documents consent behavior.
crates/ironrdp-mstsgu/Cargo.toml Registers the consent test.

Comment on lines +527 to +531
if let Some(consent_callback) = consent_callback {
if !consent_callback(&message) {
return Err(Error::new("TunnelConsent", GwErrorKind::ConsentDeclined));
}
}
///
/// [MS-TSGU 2.2.10.21]: https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MS-TSGU/%5bMS-TSGU%5d.pdf#page=72
/// [MS-TSGU 2.2.10.22]: https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MS-TSGU/%5bMS-TSGU%5d.pdf#page=73
pub type GwConsentCallback = dyn FnMut(&str) -> bool + Send;
- provides internal raw RPCH HTTP framing codecs, but no live RPC-over-HTTP gateway transport,
- decodes HTTP control packets (`HTTP_SERVICE_MESSAGE`, `HTTP_REAUTH_MESSAGE`, and `HTTP_CLOSE_PACKET`) without performing mid-session reauthentication,
- exposes decoded tunnel-authorization policy values without enforcing redirection rules or idle timeouts,
- accepts gateway consent messages by default to preserve existing connection behavior,
Comment on lines +217 to +220
pub async fn connect_with_consent(
target: &GwConnectTarget,
client_name: &str,
consent_callback: &mut GwConsentCallback,
GwErrorKind::UnsupportedFeature,
));
}
evaluate_consent_message(&resp.consent_msg, consent_callback)?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-required Maintainer review or intervention is required risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure

Development

Successfully merging this pull request may close these issues.

2 participants