Skip to content

TLS Sync VS Code Extensions #5260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025
Merged

Conversation

bmiddha
Copy link
Member

@bmiddha bmiddha commented Jun 27, 2025

Summary

Add new projects to support the TLS Sync VS Code Extensions.

image

Details

TLS Sync VSCode Extensions orchestrate @rushstack/debug-certificate-manager to create, trust, and sync certificates when using VSCode remotes (devcontainer, WSL, codespaces, tunnels, etc.).

sequenceDiagram
    UIExtension->>WorkspaceExtension: Ping
    WorkspaceExtension->>UIExtension: Pong {"version": "0.0.3"}
    UIExtension->>WorkspaceExtension: ICertificate
Loading

VSCode API

Activation triggers

The workspace extension is activated when a .tlssync file is found by VSCode in the workspace. The Workspace extension is activated by the UI extension when it send the "ping" command to match versions.

image

Commands

  • tlssync.workspace.showLog - Open output window for workspace extension logs
  • tlssync.ui.showLog - Open output window for UI extension logs
  • tlssync.ui.sync - Sync certificates from local to remote
  • tlssync.ui.showWalkthrough - Open walkthrough page for this sync extension
  • tlssync.ui.showSettings - Open settings page for the extension
  • tlssync.workspace.ping - Internal command used by the workspace extension to check the availability of the UI extension. This command is not surfaced to the user. THis
  • tlssync.ui.ensureCertificate - Calls CertficiateManager.ensureCertificate. This can create and trust certificates as necessary
  • tlssync.ui.untrustCertificate - Remove and un-trust certificates
image

Walkthroughs

image

Settings

image

Package changes

tls-sync-vscode-extension-pack tls-sync-vscode-workspace-extension tls-sync-vscode-ui-extension

  • Add extension pack which installs the UI and Workspace extensions
  • Add UI and workspace extensions which work together to manage and sync certificates.

@rushstack/heft-vscode-extension-plugin @rushstack/heft-vscode-extension-rig

  • Heft plugin to package files into vsix using @vscode/vsce
  • Add rig to build and package vscode extensions

CertificateStore

  • Add params to support custom paths and filenames

CertificateManger

  • Forward custom paths and filenames to CertificateStore
  • Update untrustCertificateAsync to clear caCertificateData
  • Update trust and untrust mechanisms for macOS. Instead of using sudo package. It now uses osascript (applescript) to run the elevated command. This enables the use of this package where the process STDIO is not surfaced to the user.
image

tls-sync-vscode-workspace-extension, tls-sync-vscode-ui-extension, tls-sync-vscode-shared

  • VSCode extensions and shared code to run CertificateManager on the local and remote machines and sync certificates between the stores.

Repo changes

  • Add new version policy to bump the TLS sync extensions in lockstep.
  • Update VS Code extension publish pipeline. Added new extensions.

How it was tested

Tested in GitHub Codespaces, WSL, DevContainer, Tunnels with a mix of Linux and Windows hosts.
Tested with Windows and macOS host machines.

Impacted documentation

@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Jun 27, 2025
@bmiddha bmiddha force-pushed the bmiddha/tls-sync branch 6 times, most recently from 1f56562 to db2582c Compare July 1, 2025 01:22
@bmiddha bmiddha marked this pull request as ready for review July 1, 2025 01:22
Copy link
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

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

Still mid-review, but some things to fix

@D4N14L
Copy link
Member

D4N14L commented Jul 1, 2025

Also, why are there 2 separate extensions? Can this not be just one?

@bmiddha
Copy link
Member Author

bmiddha commented Jul 1, 2025

Also, why are there 2 separate extensions? Can this not be just one?

The UI extension runs code on the local machine. This creates and trusts the certificates on the local machine.
The workspace extension runs on the remote extension host (where vs code server runs). This gets the cert info from the UI extension and updates the remote file system with the certs.
We need to have 2 to run code on both the local and remote machines.

Copy link
Member

@D4N14L D4N14L left a comment

Choose a reason for hiding this comment

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

Only a few remaining open items from me. You may also want to wait for another signoff, maybe from Ian, given the changes to the build flows that I'm less familar with.

@bmiddha bmiddha changed the title TLS Sync VS Code Extension TLS Sync VS Code Extensions Jul 2, 2025
@bmiddha bmiddha requested a review from iclanton July 7, 2025 20:52
@bmiddha bmiddha force-pushed the bmiddha/tls-sync branch from b0e40bf to f6cea25 Compare July 10, 2025 00:14
@bmiddha bmiddha requested a review from iclanton July 10, 2025 21:40
@bmiddha bmiddha force-pushed the bmiddha/tls-sync branch from f6cea25 to 455a090 Compare July 11, 2025 19:19
@bmiddha bmiddha merged commit b9f8849 into microsoft:main Jul 12, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants