feat(mstsgu): handle gateway consent messages - #1762
Open
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Open
feat(mstsgu): handle gateway consent messages#1762Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Conversation
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.
Marc-André Moreau (mamoreau-devolutions)
deployed
to
llm-providers
August 22, 2026 02:12 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
Marc-André Moreau (mamoreau-devolutions)
August 22, 2026 02:12
View session
Contributor
There was a problem hiding this comment.
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)?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.