diff --git a/src/fileSystemConfig.ts b/src/fileSystemConfig.ts index 54dccbe..2bf4977 100644 --- a/src/fileSystemConfig.ts +++ b/src/fileSystemConfig.ts @@ -126,14 +126,14 @@ export function invalidConfigName(name: string) { * - `user;abc=def,a-b=1-5@server.example.com:22/some/file.ext` * - `user@server.example.com/directory` * - `server:22/directory` - * - `user@server` + * - `test-user@server` * - `server` * - `@server/path` - Unlike OpenSSH, we allow a @ (and connection parameters) without a username * * The resulting FileSystemConfig will have as name basically the input, but without the path. If there is no * username given, the name will start with `@`, as to differentiate between connection strings and config names. */ -const CONNECTION_REGEX = /^((?\w+)?(;[\w-]+=[\w\d-]+(,[\w\d-]+=[\w\d-]+)*)?@)?(?[^@\\/:,=]+)(:(?\d+))?(?\/.*)?$/; +const CONNECTION_REGEX = /^((?[\w\-._]+)?(;[\w-]+=[\w\d-]+(,[\w\d-]+=[\w\d-]+)*)?@)?(?[^\s@\\/:,=]+)(:(?\d+))?(?\/\S*)?$/; export function parseConnectionString(input: string): [config: FileSystemConfig, path?: string] | string { input = input.trim(); diff --git a/webview/src/types/fileSystemConfig.ts b/webview/src/types/fileSystemConfig.ts index b444964..2bf4977 100644 --- a/webview/src/types/fileSystemConfig.ts +++ b/webview/src/types/fileSystemConfig.ts @@ -104,6 +104,8 @@ export interface FileSystemConfig extends ConnectConfig { newFileMode?: number | string; /** Whether this config was created from an instant connection string. Enables fuzzy matching for e.g. PuTTY, config-by-host, ... */ instantConnection?: boolean; + /** List of special flags to enable/disable certain fixes/features. Flags are usually used for issues or beta testing. Flags can disappear/change anytime! */ + flags?: string[]; /** Internal property saying where this config comes from. Undefined if this config is merged or something */ _location?: ConfigLocation; /** Internal property keeping track of where this config comes from (including merges) */ @@ -124,14 +126,14 @@ export function invalidConfigName(name: string) { * - `user;abc=def,a-b=1-5@server.example.com:22/some/file.ext` * - `user@server.example.com/directory` * - `server:22/directory` - * - `user@server` + * - `test-user@server` * - `server` * - `@server/path` - Unlike OpenSSH, we allow a @ (and connection parameters) without a username * * The resulting FileSystemConfig will have as name basically the input, but without the path. If there is no * username given, the name will start with `@`, as to differentiate between connection strings and config names. */ -const CONNECTION_REGEX = /^((?\w+)?(;[\w-]+=[\w\d-]+(,[\w\d-]+=[\w\d-]+)*)?@)?(?[^@\\/:,=]+)(:(?\d+))?(?\/.*)?$/; +const CONNECTION_REGEX = /^((?[\w\-._]+)?(;[\w-]+=[\w\d-]+(,[\w\d-]+=[\w\d-]+)*)?@)?(?[^\s@\\/:,=]+)(:(?\d+))?(?\/\S*)?$/; export function parseConnectionString(input: string): [config: FileSystemConfig, path?: string] | string { input = input.trim();