Invalidate = in new database names (#2183)

This commit is contained in:
JasonYeMSFT 2023-09-20 16:24:42 -07:00 коммит произвёл GitHub
Родитель 2bda9788c6
Коммит 2841a1cd84
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -7,9 +7,9 @@ import { DatabaseAccountGetResults } from '@azure/arm-cosmosdb/src/models';
import { CosmosClient, DatabaseDefinition, DatabaseResponse, FeedOptions, QueryIterator, Resource } from '@azure/cosmos';
import { AzExtParentTreeItem, AzExtTreeItem, ICreateChildImplContext } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import { deleteCosmosDBAccount } from '../../commands/deleteDatabaseAccount/deleteCosmosDBAccount';
import { IDeleteWizardContext } from '../../commands/deleteDatabaseAccount/IDeleteWizardContext';
import { getThemeAgnosticIconPath, SERVERLESS_CAPABILITY_NAME } from '../../constants';
import { deleteCosmosDBAccount } from '../../commands/deleteDatabaseAccount/deleteCosmosDBAccount';
import { SERVERLESS_CAPABILITY_NAME, getThemeAgnosticIconPath } from '../../constants';
import { nonNullProp } from '../../utils/nonNull';
import { rejectOnTimeout } from '../../utils/timeout';
import { getCosmosClient } from '../getCosmosClient';
@ -88,8 +88,8 @@ function validateDatabaseName(name: string): string | undefined | null {
if (name.endsWith(" ")) {
return "Database name cannot end with space";
}
if (/[/\\?#]/.test(name)) {
return `Database name cannot contain the characters '\\', '/', '#', '?'`;
if (/[/\\?#=]/.test(name)) {
return `Database name cannot contain the characters '\\', '/', '#', '?', '='`;
}
return undefined;
}

Просмотреть файл

@ -128,8 +128,8 @@ export function validateDatabaseName(database: string): string | undefined | nul
if (!database || database.length < min || database.length > max) {
return `Database name must be between ${min} and ${max} characters.`;
}
if (/[/\\. "$#?]/.test(database)) {
return "Database name cannot contain these characters - `/\\. \"$#?`";
if (/[/\\. "$#?=]/.test(database)) {
return "Database name cannot contain these characters - `/\\. \"$#?=`";
}
return undefined;
}