Investigate exposing ports for workspaces

MR: Draft: Workspace ports POC (!174932 - closed)

Description

With this investigation issue we want to kickstart the Show workspace ports in VS Code Panel (&15732) epic. The idea is to create a VSCode extension that can allow users to view/manage available ports in a workspace.

These ports can be opened/closed by the user through a UI. We need to determine what that UI will look like with the new VSCode extension. The VSCode extension should allow users to connect to remote workspace open ports locally.

The default port forward feature in VSCode relies on Dev Tunnels which is a service by Microsoft and it requires Github/Microsoft account for authentication. So we also need to determine how we authenticate the new VSCode extension.

According to VS Code Port Forwarding

How are forwarded ports secured?
By default, both hosting and connecting to a tunnel requires authentication with the same GitHub or Microsoft account on each end. In both cases, VS Code makes outbound connections to a service hosted in Azure; no firewall changes are generally necessary, and VS Code doesn't set up any network listeners.

However, if you've opened a Public port, any user with your link can access the forwarded service. You should be careful to avoid hosting any confidential information or insecure services over such ports.

You can learn more about the security of the underlying dev tunnels service in its documentation.

Acceptance Criteria

  • Determine how we can open/close ports from the VSCode fork UI in a workspace
  • Create a POC for managing workspace ports state and enable access through a url
  • Determine where to host the source code for this extension (e.g. new project or existing one)?
  • Determine how to setup the logic/infrastructure for exposing workspace ports?
  • The ports tab will display the following:
    • A list of all available ports (including configured ports in the Devfile)
    • The URL for each corresponding port on the list
    • The visibility of the ports listed
Edited by Daniyal Arshad