[PR #14776] [MERGED] AzureConnection: remove our dependency on cpprestsdk #30245

Open
opened 2026-01-31 09:39:34 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14776
Author: @DHowett
Created: 2/3/2023
Status: ✅ Merged
Merged: 2/7/2023
Merged by: @DHowett

Base: main ← Head: dev/duhowett/azcon-winrt-apis


📝 Commits (10+)

  • 0e70e36 AZCS: Switch to Windows.Web.Http for all http client stuff
  • 3317921 AZCS: switch to winhttp.dll for all websocket stuff
  • 806eb0a AZCS: Remove all use of remaining cpprest utilities
  • f1f3335 Remove every mention of cpprestsdk
  • bb66e67 Add a feature flag for running AzureConn inproc
  • 85c6b15 Spell, audit, format, remaining concerns
  • a3bf43e OH COME ON
  • 395d992 PR feedback
  • 608499b I TRUSTED YOUUUU
  • b6b87db more nits

📊 Changes

16 files changed (+292 additions, -347 deletions)

View changed files

📝 .github/actions/spelling/allow/apis.txt (+5 -0)
📝 .github/actions/spelling/expect/expect.txt (+0 -3)
📝 build/config/ESRPSigning_Terminal.json (+0 -45)
📝 build/pipelines/release.yml (+1 -1)
📝 build/pipelines/templates/build-console-compliance-job.yml (+1 -1)
📝 build/scripts/Test-WindowsTerminalPackage.ps1 (+0 -5)
📝 dep/nuget/packages.config (+0 -1)
📝 scratch/ScratchIslandApp/WindowExe/WindowExe.vcxproj (+0 -20)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+9 -2)
📝 src/cascadia/TerminalConnection/AzureClient.h (+15 -7)
📝 src/cascadia/TerminalConnection/AzureConnection.cpp (+222 -201)
📝 src/cascadia/TerminalConnection/AzureConnection.h (+23 -19)
📝 src/cascadia/TerminalConnection/TerminalConnection.vcxproj (+0 -36)
📝 src/cascadia/TerminalConnection/pch.h (+6 -0)
📝 src/common.nugetversions.targets (+0 -6)
📝 src/features.xml (+10 -0)

📄 Description

This pull request removes, in full, our dependency on cpprestsdk. This
allows us to shed 500KiB-1.2MiB from our package off the top and enables
the following future investments:

  • Removal of the App CRT forwarders to save an additional ~500KiB
  • Switching over to the HybridCRT and removing our dependency on any
    CRT
    .

cpprest was built on my dev box two or so years ago, and is in utter
violation of our compliance guidelines on SBOM et al.

In addition, this change allows us to use the proxy server configured
in Windows Settings.

I did this in four steps (represented roughly by the individual commits):

  1. Switch from cpprest's http_client/json to Windows.Web.Http and
    Windows.Data.Json
  2. Switch from websocketpp to winhttp.dll's WebSocket implementation¹
  3. Remove all remaining utility classes
  4. Purge all dependencies from all projects and scripts on cpprest.

I also took this opportunity to add a feature flag that allows Dev
builds to run AzureConnection in-process.

¹ Windows.Networking.Sockets' API is so unergonomic that it was simply
infeasible (and also horrible) to use it.

Validation Steps

I've run the Azure Connection quite a bit inproc.

Closes #4575.
Might be related to #5977, #11714, and with the user agent thing maybe #14403.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14776 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 2/3/2023 **Status:** ✅ Merged **Merged:** 2/7/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/azcon-winrt-apis` --- ### 📝 Commits (10+) - [`0e70e36`](https://github.com/microsoft/terminal/commit/0e70e3692e83b5a34e2a8d0bb5b782048f4f2468) AZCS: Switch to Windows.Web.Http for all http client stuff - [`3317921`](https://github.com/microsoft/terminal/commit/3317921516b5216fb8ecbf4a24f3866da23ab4fa) AZCS: switch to winhttp.dll for all websocket stuff - [`806eb0a`](https://github.com/microsoft/terminal/commit/806eb0a9ca69e50f0c591c81ddc471e171c9ae4a) AZCS: Remove all use of remaining cpprest utilities - [`f1f3335`](https://github.com/microsoft/terminal/commit/f1f333552bb443d12d7fd18bb2c43c490a4f700e) Remove every mention of cpprestsdk - [`bb66e67`](https://github.com/microsoft/terminal/commit/bb66e6738a3bbeeb915593968e6fdc50f519aa3a) Add a feature flag for running AzureConn inproc - [`85c6b15`](https://github.com/microsoft/terminal/commit/85c6b15170ce74bf5c8eb60ec07092adf5ca9b14) Spell, audit, format, remaining concerns - [`a3bf43e`](https://github.com/microsoft/terminal/commit/a3bf43e2227b803bbdef20fe3d11d16eac977054) OH COME ON - [`395d992`](https://github.com/microsoft/terminal/commit/395d992872bc2bc593b5b67cf8caf9662869630d) PR feedback - [`608499b`](https://github.com/microsoft/terminal/commit/608499bd005567c95c0396b10b828d451ee00028) I TRUSTED YOUUUU - [`b6b87db`](https://github.com/microsoft/terminal/commit/b6b87dbfc9a374398801059bcdfc23385a482eef) more nits ### 📊 Changes **16 files changed** (+292 additions, -347 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/apis.txt` (+5 -0) 📝 `.github/actions/spelling/expect/expect.txt` (+0 -3) 📝 `build/config/ESRPSigning_Terminal.json` (+0 -45) 📝 `build/pipelines/release.yml` (+1 -1) 📝 `build/pipelines/templates/build-console-compliance-job.yml` (+1 -1) 📝 `build/scripts/Test-WindowsTerminalPackage.ps1` (+0 -5) 📝 `dep/nuget/packages.config` (+0 -1) 📝 `scratch/ScratchIslandApp/WindowExe/WindowExe.vcxproj` (+0 -20) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+9 -2) 📝 `src/cascadia/TerminalConnection/AzureClient.h` (+15 -7) 📝 `src/cascadia/TerminalConnection/AzureConnection.cpp` (+222 -201) 📝 `src/cascadia/TerminalConnection/AzureConnection.h` (+23 -19) 📝 `src/cascadia/TerminalConnection/TerminalConnection.vcxproj` (+0 -36) 📝 `src/cascadia/TerminalConnection/pch.h` (+6 -0) 📝 `src/common.nugetversions.targets` (+0 -6) 📝 `src/features.xml` (+10 -0) </details> ### 📄 Description This pull request removes, in full, our dependency on cpprestsdk. This allows us to shed 500KiB-1.2MiB from our package off the top and enables the following future investments: - Removal of the App CRT forwarders to save an additional ~500KiB - Switching over to the HybridCRT and removing our dependency on _any CRT_. cpprest was built on my dev box two or so years ago, and is in _utter_ violation of our compliance guidelines on SBOM et al. In addition, this change allows us to use the proxy server configured in Windows Settings. I did this in four steps (represented roughly by the individual commits): 1. Switch from cpprest's http_client/json to Windows.Web.Http and Windows.Data.Json 2. Switch from websocketpp to winhttp.dll's WebSocket implementation¹ 3. Remove all remaining utility classes 4. Purge all dependencies from all projects and scripts on cpprest. I also took this opportunity to add a feature flag that allows Dev builds to run AzureConnection in-process. ¹ Windows.Networking.Sockets' API is so unergonomic that it was simply infeasible (and also _horrible_) to use it. ## Validation Steps I've run the Azure Connection quite a bit inproc. Closes #4575. Might be related to #5977, #11714, and with the user agent thing maybe #14403. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:39:34 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30245