Skip to content

Give remote resolvers a way to set environment variables in the new remote extension host #77234

@roblourens

Description

@roblourens

For microsoft/vscode-remote-release#16 (comment)

We need a way for the remote resolver to set the SSH_AUTH_SOCK environment variable in the new remote extension host. This is used to auth for SSH using the local machine's SSH agent.

One way to do this is to give the ResolvedAuthority type the remote environment variables that should be set on the remote EH. Example:

export class ResolvedAuthority {
	readonly host: string;
	readonly port: number;
	readonly remoteEnv?: { [key: string]: string };

	constructor(host: string, port: number, remoteEnv?: { [key: string]: string });
}

If that isn't really the right place for it we could change the resolver interface to return a ResolvedAuthority and a separate set of options for the remote EH.

export interface IResolverResult {
  authority: ResolvedAuthority;
  options: IResolveOptions;
}

export interface IResolveOptions {
  remoteEnv?: { [key: string]: string };
}

This is also used for reconnection so we would need to implement this for the initial EH creation and also for reconnecting to a running EH. For agent forwarding, both would be necessary. When we reconnect and open a new tunnel, we will get a new SSH_AUTH_SOCK and we would need to patch this in the EH.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions