Skip to content

Commit 93987e8

Browse files
connor4312aeschli
andauthored
remote: allow _ in ext host resolvedauthority (microsoft#168883)
* remote: allow _ in ext host resolvedauthority (microsoft#168649) Fixes https://github.com/microsoft/vscode-remote-release/issues/7661 This character was allowed in microsoft#167635, but the extension host side did a separate check that I didn't update. * fix remaining occurrences of the security token regexp Co-authored-by: Martin Aeschlimann <[email protected]>
1 parent 371d042 commit 93987e8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/vs/server/node/serverConnectionToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ export async function parseServerConnectionToken(args: ServerParsedArgs, default
8585
}
8686

8787
if (!connectionTokenRegex.test(rawConnectionToken)) {
88-
return new ServerConnectionTokenParseError(`The connection token defined in '${connectionTokenFile} does not adhere to the characters 0-9, a-z, A-Z or -.`);
88+
return new ServerConnectionTokenParseError(`The connection token defined in '${connectionTokenFile} does not adhere to the characters 0-9, a-z, A-Z, _, or -.`);
8989
}
9090

9191
return new MandatoryServerConnectionToken(rawConnectionToken);
9292
}
9393

9494
if (typeof connectionToken !== 'undefined') {
9595
if (!connectionTokenRegex.test(connectionToken)) {
96-
return new ServerConnectionTokenParseError(`The connection token '${connectionToken} does not adhere to the characters 0-9, a-z, A-Z or -.`);
96+
return new ServerConnectionTokenParseError(`The connection token '${connectionToken} does not adhere to the characters 0-9, a-z, A-Z, _, or -.`);
9797
}
9898

9999
if (compatibility) {

src/vs/server/node/serverEnvironmentService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export interface ServerParsedArgs {
100100

101101
/**
102102
* A secret token that must be provided by the web client with all requests.
103-
* Use only `[0-9A-Za-z\-]`.
103+
* Use only `[0-9A-Za-z_-]`.
104104
*
105105
* By default, a UUID will be generated every time the server starts up.
106106
*
@@ -113,7 +113,7 @@ export interface ServerParsedArgs {
113113
* A path to a filename which will be read on startup.
114114
* Consider placing this file in a folder readable only by the same user (a `chmod 0700` directory).
115115
*
116-
* The contents of the file will be used as the connection token. Use only `[0-9A-Z\-]` as contents in the file.
116+
* The contents of the file will be used as the connection token. Use only `[0-9A-Za-z_-]` as contents in the file.
117117
* The file can optionally end in a `\n` which will be ignored.
118118
*
119119
* This secret must be communicated to any vscode instance via the resolver or embedder API.

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export class ResolvedAuthority {
492492
throw illegalArgument('port');
493493
}
494494
if (typeof connectionToken !== 'undefined') {
495-
if (typeof connectionToken !== 'string' || connectionToken.length === 0 || !/^[0-9A-Za-z\-]+$/.test(connectionToken)) {
495+
if (typeof connectionToken !== 'string' || connectionToken.length === 0 || !/^[0-9A-Za-z_\-]+$/.test(connectionToken)) {
496496
throw illegalArgument('connectionToken');
497497
}
498498
}

0 commit comments

Comments
 (0)