Skip to content
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

resolvers: support nesting and exec server #185169

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Jun 14, 2023

This adds support for nesting remote authorities via passing through
ExecServers.

  • An authority like wsl+Ubuntu@tunnel+my-pc is parsed into
    the chain tunnel+my-pc -> wsl+Ubuntu
  • An extension for the tunnel prefixed is resolved. We expect the
    resolver to implement the new resolveExecServer method.
  • Resolution continues. wsl+Ubuntu is the last resolver, so the
    resolve() method is called and the exec server is passed in its
    RemoteAuthorityResolverContext

Currently the ExecServer is typed as unknown in the API. Maybe we
want to make it real API in the future, but I don't want to do this
until it's generalized beyond a single consumer (WSL).

This also has adds utility method getRemoteExecServer to get an exec
server for a given remote. This is used by WSL to probe information
about a tunneled machine even when WSL isn't opened (e.g. to get the
list of distros to shop.)

The new @ handling should not break remotes. WSL doesn't use @ in
its remotes, SSH and containers both hex-encode information contained
in authorities. Codespaces does put the codespace name in the remote
authority, but it doesn't seem like it's possible to get @ in those
names, since they're generated either randomly when opening a template
or from a repo name (where @ is not allowed).

cc @alexdima

Refs #184171

This adds support for nesting remote authorities via passing through
ExecServers.

- An authority like `wsl+Ubuntu@tunnel+my-pc` is parsed into
  the chain `tunnel+my-pc` -> `wsl+Ubuntu`
- An extension for the `tunnel` prefixed is resolved. We expect the
  resolver to implement the new `resolveExecServer` method.
- Resolution continues. `wsl+Ubuntu` is the last resolver, so the
  `resolve()` method is called and the exec server is passed in its
  `RemoteAuthorityResolverContext`

Currently the ExecServer is typed as `unknown` in the API. _Maybe_ we
want to make it real API in the future, but I don't want to do this
until it's generalized beyond a single consumer (WSL).

This also has adds utility method `getRemoteExecServer` to get an exec
server for a given remote. This is used by WSL to probe information
about a tunneled machine even when WSL isn't opened (e.g. to get the
list of distros to shop.)

The new `@` handling should not break remotes. WSL doesn't use `@` in
its remotes, SSH and containers both hex-encode information contained
in authorities. Codespaces does put the codespace name in the remote
authority, but it doesn't seem like it's possible to get `@` in those
names, since they're generated either randomly when opening a template
or from a repo name (where @ is not allowed).
@connor4312 connor4312 enabled auto-merge (squash) June 14, 2023 23:27
@connor4312 connor4312 self-assigned this Jun 14, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the June 2023 milestone Jun 14, 2023
@connor4312 connor4312 requested a review from alexdima June 14, 2023 23:34
@connor4312
Copy link
Member Author

Did a full build and verified all our remotes including Codespaces still work, so putting this up for general review 🙂

@connor4312 connor4312 merged commit 6924627 into main Jun 15, 2023
22 checks passed
@connor4312 connor4312 deleted the connor4312/exec-server-intro branch June 15, 2023 18:38
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants