diff --git a/arm-ttk/cache/AllAzureResources.cache.json b/arm-ttk/cache/AllAzureResources.cache.json index 56765bbd..d6dc78dc 100644 --- a/arm-ttk/cache/AllAzureResources.cache.json +++ b/arm-ttk/cache/AllAzureResources.cache.json @@ -8716,6 +8716,7 @@ "apiVersions": [ "2023-01-01-preview", "2022-12-01-preview", + "2022-11-15-preview", "2022-11-01-preview", "2022-08-01-preview", "2022-04-01-preview", @@ -61092,6 +61093,139 @@ "zoneMappings": null } ], + "Microsoft.ModSimWorkbench/instances/consortiums": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/consortiums", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances/chambers/workloads": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/chambers/workloads", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances/chambers/files": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "None", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/chambers/files", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances/chambers/fileRequests": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "None", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/chambers/fileRequests", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances/chambers/accessProfiles": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/chambers/accessProfiles", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances/chambers": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances/chambers", + "zoneMappings": null + } + ], + "Microsoft.ModSimWorkbench/instances": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2021-03-01-preview" + ], + "capabilities": "SupportsTags, SupportsLocation", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "East US 2", + "West Central US" + ], + "properties": null, + "resourceType": "Microsoft.ModSimWorkbench/instances", + "zoneMappings": null + } + ], "Microsoft.MobileNetwork/sims": [ { "aliases": null, @@ -66368,6 +66502,94 @@ "zoneMappings": null } ], + "Microsoft.MachineLearningServices/workspaces/batchEndpoints/jobs": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2020-09-01-preview" + ], + "capabilities": "None", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "North Central US", + "Canada Central", + "Central India", + "UK South", + "West US", + "Central US", + "East Asia", + "Japan East", + "Germany West Central", + "Switzerland North", + "UAE North", + "South Africa North", + "Norway East", + "East US", + "North Europe", + "Korea Central", + "Brazil South", + "France Central", + "Australia East", + "East US 2", + "West US 2", + "West Central US", + "Southeast Asia", + "West Europe", + "South Central US", + "Canada East", + "Sweden Central" + ], + "properties": null, + "resourceType": "Microsoft.MachineLearningServices/workspaces/batchEndpoints/jobs", + "zoneMappings": null + } + ], + "Microsoft.MachineLearningServices/workspaces/batchEndpoints/deployments/jobs": [ + { + "aliases": null, + "apiProfiles": null, + "apiVersions": [ + "2020-09-01-preview" + ], + "capabilities": "None", + "defaultApiVersion": null, + "locationMappings": null, + "locations": [ + "North Central US", + "Canada Central", + "Central India", + "UK South", + "West US", + "Central US", + "East Asia", + "Japan East", + "Germany West Central", + "Switzerland North", + "UAE North", + "South Africa North", + "Norway East", + "East US", + "North Europe", + "Korea Central", + "Brazil South", + "France Central", + "Australia East", + "East US 2", + "West US 2", + "West Central US", + "Southeast Asia", + "West Europe", + "South Central US", + "Canada East", + "Sweden Central" + ], + "properties": null, + "resourceType": "Microsoft.MachineLearningServices/workspaces/batchEndpoints/deployments/jobs", + "zoneMappings": null + } + ], "Microsoft.MachineLearningServices/workspaces/batchEndpoints/deployments": [ { "aliases": null, @@ -69843,216 +70065,7 @@ ], "properties": null, "resourceType": "Microsoft.Kusto/clusters", - "zoneMappings": [ - { - "location": "Australia East", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Brazil South", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Canada Central", - "zones": [ - "3", - "1", - "2" - ] - }, - { - "location": "Central India", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Central US", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "East Asia", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "East US", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "East US 2", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "France Central", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Germany West Central", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Japan East", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Korea Central", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "North Central US", - "zones": [] - }, - { - "location": "North Europe", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Norway East", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Qatar Central", - "zones": [ - "3", - "1", - "2" - ] - }, - { - "location": "South Africa North", - "zones": [ - "2", - "1", - "3" - ] - }, - { - "location": "South Central US", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Southeast Asia", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "Sweden Central", - "zones": [ - "1", - "3", - "2" - ] - }, - { - "location": "Switzerland North", - "zones": [ - "1", - "3", - "2" - ] - }, - { - "location": "UAE North", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "UK South", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "West Europe", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "West US", - "zones": [] - }, - { - "location": "West US 2", - "zones": [ - "2", - "3", - "1" - ] - }, - { - "location": "West US 3", - "zones": [ - "3", - "1", - "2" - ] - } - ] + "zoneMappings": null } ], "Microsoft.KubernetesConfiguration/sourceControlConfigurations": [ @@ -124805,7 +124818,7 @@ "zoneMappings": null } ], - "Microsoft.AzureStackHCI/operations": [ + "Microsoft.AzureStackHCI/Operations": [ { "aliases": null, "apiProfiles": null, @@ -124830,7 +124843,7 @@ "locationMappings": null, "locations": [], "properties": null, - "resourceType": "Microsoft.AzureStackHCI/operations", + "resourceType": "Microsoft.AzureStackHCI/Operations", "zoneMappings": null } ], @@ -124874,7 +124887,7 @@ "zoneMappings": null } ], - "Microsoft.AzureStackHCI/locations/operationstatuses": [ + "Microsoft.AzureStackHCI/Locations/operationStatuses": [ { "aliases": null, "apiProfiles": null, @@ -124911,7 +124924,7 @@ "Canada Central" ], "properties": null, - "resourceType": "Microsoft.AzureStackHCI/locations/operationstatuses", + "resourceType": "Microsoft.AzureStackHCI/Locations/operationStatuses", "zoneMappings": null } ], diff --git a/arm-ttk/testcases/CreateUIDefinition/Password-Textboxes-Must-Be-Used-For-Password-Parameters.test.ps1 b/arm-ttk/testcases/CreateUIDefinition/Password-Textboxes-Must-Be-Used-For-Password-Parameters.test.ps1 index 5930aef6..1ca315b5 100644 --- a/arm-ttk/testcases/CreateUIDefinition/Password-Textboxes-Must-Be-Used-For-Password-Parameters.test.ps1 +++ b/arm-ttk/testcases/CreateUIDefinition/Password-Textboxes-Must-Be-Used-For-Password-Parameters.test.ps1 @@ -25,8 +25,17 @@ $passwordBoxes = $CreateUIDefinitionObject | foreach ($pwb in $passwordBoxes) { # Loop over each password box $controlName = $pwb.Name # and find the output it maps to. $theOutput = foreach ($out in $CreateUIDefinitionObject.parameters.outputs.psobject.properties) { - if (($out.Value -like "*steps(*$controlName*") -or ($out.Value -like "*basics(*$controlName*")) { - $out; break + $outputValueType = $out.Value.GetType().Name + if ($outputValueType -eq "PSCustomObject") { + $outputJson = $out.Value | ConvertTo-Json -Compress + if (($outputJson -like "*steps(*$controlName*") -or ($outputJson -like "*basics(*$controlName*")) { + $out; break + } + } + else { + if (($out.Value -like "*steps(*$controlName*") -or ($out.Value -like "*basics(*$controlName*")) { + $out; break + } } } @@ -39,13 +48,13 @@ foreach ($pwb in $passwordBoxes) { # Loop over each password box # If we couldn't find it, write an error. if (-not $MainTemplateParam) { - Write-Error "Password box $($pwb.Name) is missing from main template parameters "-TargetObject $pwb + Write-Error "Password box $($pwb.Name) linked to output $($theOutput.Name) is missing from main template parameters "-TargetObject $pwb continue } # If the main template parameter type is neither a Secure String nor a Secure Object if (($MainTemplateParam.type -ne 'SecureString') -and ($MainTemplateParam.type -ne 'SecureObject')) { # write an error. - Write-Error "PasswordBox controls must use secureString or secureObject parameter types. The Main template parameter '$($pwb.Name)' is a '$($MainTemplateParam.type)'" -TargetObject @($pwb, $MainTemplateParam) + Write-Error "PasswordBox controls must use secureString or secureObject parameter types. The Main template parameter '$($theOutput.Name)' linked to '$($pwb.Name)' is a '$($MainTemplateParam.type)'" -TargetObject @($pwb, $MainTemplateParam) } } \ No newline at end of file diff --git a/arm-ttk/testcases/CreateUIDefinition/PasswordBoxes-Must-Have-Min-Length.test.ps1 b/arm-ttk/testcases/CreateUIDefinition/PasswordBoxes-Must-Have-Min-Length.test.ps1 index 4c57d3fc..2305d8c7 100644 --- a/arm-ttk/testcases/CreateUIDefinition/PasswordBoxes-Must-Have-Min-Length.test.ps1 +++ b/arm-ttk/testcases/CreateUIDefinition/PasswordBoxes-Must-Have-Min-Length.test.ps1 @@ -47,7 +47,7 @@ foreach ($pwb in $passwordBoxes) { # Loop over each password box $totalMins += $match.Groups['Min'].Value -as [int] } if ($passWordMinLength -gt $totalMins) { - Write-Warning "PasswordBox '$($pwb.Name)' regex does not have a minimum length of $PasswordMinLength" -TargetObject $pwb + Write-Warning "PasswordBox '$($pwb.Name)' regex does not have a minimum length of $PasswordMinLength" } } } catch { diff --git a/arm-ttk/testcases/CreateUIDefinition/Textboxes-Are-Well-Formed.test.ps1 b/arm-ttk/testcases/CreateUIDefinition/Textboxes-Are-Well-Formed.test.ps1 index 85d884d3..95b624fc 100644 --- a/arm-ttk/testcases/CreateUIDefinition/Textboxes-Are-Well-Formed.test.ps1 +++ b/arm-ttk/testcases/CreateUIDefinition/Textboxes-Are-Well-Formed.test.ps1 @@ -12,12 +12,9 @@ param( ) # First, find all textboxes within CreateUIDefinition. - $allTextBoxes = $CreateUiDefinitionObject | Find-JsonContent -Key type -value Microsoft.Common.TextBox -# Match length constraint at beginning of regex. -# Input string starts with ^(?=.{N,N} ^ ( ? = . {N ,N} -$lengthConstraintRegexAtBeginning = [Regex]::new('^[\^][\(][\?][=][\.]\{(?\d+),(?\d+)?\}.*') -$lengthConstraintRegexAtEnd = [Regex]::new('\{(?\d+),(?\d+)?\}(\$)?$') +# Regex Constraint should contain one of following pattern (Length Check): {m,n} or {m,} or {m} +$lengthContraintRegex = [Regex]::new('\{(?\d+)(?:,(?\d+)|,)?\}') foreach ($textbox in $allTextBoxes) { # Then we walk over each textbox. @@ -26,6 +23,7 @@ foreach ($textbox in $allTextBoxes) { Write-Error -Message "Textbox $($textbox.Name) is missing constraints" -ErrorId Textboxes.Are.Well.Formed.Missing.Constraints -TargetObject $textbox # error continue # and continue (since additional failures would be noise). } + $constraintRegexString = ""; if ($textbox.constraints.validations) { $constraintRegexString = foreach ($validation in $textbox.constraints.validations) { @@ -37,27 +35,27 @@ foreach ($textbox in $allTextBoxes) { elseif ($textbox.constraints.regex) { $constraintRegexString = $textbox.constraints.regex if (-not $textbox.constraints.validationMessage) { - # If there's not a validation message + # Regex constraint is missing validation message Write-Error -Message "Textbox $($textbox.Name) is missing constraints.validationMessage" -ErrorId Textboxes.Are.Well.Formed.Missing.Constraints.ValidationMessage -TargetObject $textbox #error. } } + if (-not $constraintRegexString ) { - # If the constraint didn't have a regex, + # If the constraint didn't have a regex Write-Error -Message "Textbox $($textbox.Name) is missing constraints.regex or regex property in constraints.validations" -ErrorId Textboxes.Are.Well.Formed.Missing.Constraints.Regex -TargetObject $textbox #error. } else { try { - # If it did, + # If it did $constraintWasRegex = [Regex]::new($constraintRegexString) # try to cast to a regex - $hasLengthConstraintAtBeginning = $lengthConstraintRegexAtBeginning.Match($constraintRegexString) - $hasLengthConstraintAtEnd = $lengthConstraintRegexAtEnd.Match($constraintRegexString) + $hasLengthConstraint = $lengthContraintRegex.Match($constraintRegexString) - if (-not ($hasLengthConstraintAtBeginning.Success -or $hasLengthConstraintAtEnd.Success -or $isExpression.Success)) { + if (-not ($hasLengthConstraint.Success)) { Write-Warning "TextBox '$($textBox.Name)' regex does not have a length constraint." } } catch { - $err = $_ # if that fails, + $err = $_ # if that fails Write-Error -Message "Textbox $($textbox.Name) regex is invalid: $($err)" -ErrorId Textboxes.Are.Well.Formed.Invalid.Constraints.Regex.Expressison -TargetObject $textbox #error. } } diff --git a/arm-ttk/testcases/CreateUIDefinition/Tooltips-Should-Be-Present.test.ps1 b/arm-ttk/testcases/CreateUIDefinition/Tooltips-Should-Be-Present.test.ps1 index 9b7ec6fb..c21bea37 100644 --- a/arm-ttk/testcases/CreateUIDefinition/Tooltips-Should-Be-Present.test.ps1 +++ b/arm-ttk/testcases/CreateUIDefinition/Tooltips-Should-Be-Present.test.ps1 @@ -21,7 +21,8 @@ $shouldHaveTooltips = $CreateUIDefinitionObject | $noToolTipControls = "Microsoft.Common.InfoBox", "Microsoft.Common.Section", "Microsoft.Common.TextBlock", - "Microsoft.Solutions.ArmApiControl" + "Microsoft.Solutions.ArmApiControl", + "Microsoft.Common.EditableGrid" foreach ($shouldHave in $shouldHaveTooltips) { # then loop through each control diff --git a/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/azuredeploy.json b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/azuredeploy.json new file mode 100644 index 00000000..7172fed1 --- /dev/null +++ b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/azuredeploy.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location." + } + }, + "certificates": { + "type": "object", + "defaultValue": [ + { + "password": "password" + } + ], + "metadata": { + "description": "Backend data." + } + } + }, + "variables": { + }, + "resources": [ + ], + "outputs": { + "location": { + "type": "string", + "value": "[parameters('location')]" + } + } +} diff --git a/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/createUiDefinition.json b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/createUiDefinition.json new file mode 100644 index 00000000..dae57d24 --- /dev/null +++ b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Fail/NotSecureObject/createUiDefinition.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", + "handler": "Microsoft.Azure.CreateUIDef", + "version": "0.1.2-preview", + "parameters": { + "basics": [ + { + "name": "settings", + "label": "Settings", + "bladeTitle": "Settings", + "elements": [ + { + "type": "Microsoft.Common.Section", + "name": "section", + "label": "Section Settings", + "visible": "true", + "elements": [ + { + "type": "Microsoft.Common.PasswordBox", + "name": "passwordBox", + "label": { + "password": "Password", + "confirmPassword": "Confirm password" + }, + "toolTip": "Password for password box", + "visible": true, + "constraints": { + "required": true, + "regex": "^[\\S]{10,25}$", + "validationMessage": "Password must be between 10 and 25 characters." + }, + "options": { + "hideConfirmation": false + } + } + ] + } + ] + } + ], + "outputs": { + "Location": "[location()]", + "certificates": { + "0": { + "password": "[coalesce(steps('settings').section.passwordBox, 'NA')]" + } + } + } + } +} diff --git a/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/azuredeploy.json b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/azuredeploy.json new file mode 100644 index 00000000..ee603930 --- /dev/null +++ b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/azuredeploy.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location." + } + }, + "certificates": { + "type": "secureObject", + "defaultValue": [ + { + "password": "password" + } + ], + "metadata": { + "description": "Backend data." + } + } + }, + "variables": { + }, + "resources": [ + ], + "outputs": { + "location": { + "type": "string", + "value": "[parameters('location')]" + } + } +} \ No newline at end of file diff --git a/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/createUiDefinition.json b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/createUiDefinition.json new file mode 100644 index 00000000..1404cfb8 --- /dev/null +++ b/unit-tests/Password-Textboxes-Must-Be-Used-For-Password-Parameters/Pass/SecureObject/createUiDefinition.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", + "handler": "Microsoft.Azure.CreateUIDef", + "version": "0.1.2-preview", + "parameters": { + "basics": [ + { + "name": "settings", + "label": "Settings", + "bladeTitle": "Settings", + "elements": [ + { + "type": "Microsoft.Common.Section", + "name": "section", + "label": "Section Settings", + "visible": "true", + "elements": [ + { + "type": "Microsoft.Common.PasswordBox", + "name": "passwordBox", + "label": { + "password": "Password", + "confirmPassword": "Confirm password" + }, + "toolTip": "Password for password box", + "visible": true, + "constraints": { + "required": true, + "regex": "^[\\S]{10,25}$", + "validationMessage": "Password must be between 10 and 25 characters." + }, + "options": { + "hideConfirmation": false + } + } + ] + } + ] + } + ], + "outputs": { + "Location": "[location()]", + "certificates": { + "0": { + "password": "[coalesce(steps('settings').section.passwordBox, 'NA')]" + } + } + } + } +} \ No newline at end of file diff --git a/unit-tests/PasswordBoxes-Must-Have-Min-Length/Pass/Has-Regex-Constraint-With-FixLength.json b/unit-tests/PasswordBoxes-Must-Have-Min-Length/Pass/Has-Regex-Constraint-With-FixLength.json new file mode 100644 index 00000000..df6dfa6b --- /dev/null +++ b/unit-tests/PasswordBoxes-Must-Have-Min-Length/Pass/Has-Regex-Constraint-With-FixLength.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", + "handler": "Microsoft.Compute.MultiVm", + "version": "0.1.2-preview", + "parameters": { + "basics": [ + { + "name": "dbAdminPassword", + "type": "Microsoft.Common.PasswordBox", + "label": { + "password": "Password", + "confirmPassword": "Confirm password" + }, + "toolTip": "Admin password for the database", + "constraints": { + "required": true, + "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d\\$\\&\\+\\,:\\=\\?@#|'.\\^\\*!\\-_~/'\\[\\]\\{\\}\"]{8,}$", + "validationMessage": "The password must contain at least 8 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters, but should not contain > < ( ) % ; \\." + }, + "options": { + "hideConfirmation": false + }, + "visible": true + } + ], + "steps": [] + } +} \ No newline at end of file diff --git a/unit-tests/Textboxes-Are-Well-Formed/Pass/Textboxes-With-Length-Constrains-Regex/createUiDefinition.json b/unit-tests/Textboxes-Are-Well-Formed/Pass/Textboxes-With-Length-Constrains-Regex/createUiDefinition.json index d7ef2af8..3c4c482c 100644 --- a/unit-tests/Textboxes-Are-Well-Formed/Pass/Textboxes-With-Length-Constrains-Regex/createUiDefinition.json +++ b/unit-tests/Textboxes-Are-Well-Formed/Pass/Textboxes-With-Length-Constrains-Regex/createUiDefinition.json @@ -1,33 +1,63 @@ { - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "basics": [ - { - "name": "TextBox1", - "type": "Microsoft.Common.TextBox", - "label": "Textboxes-With-Constrains-Validations", - "toolTip": "Textboxes with constraints.validations.", - "constraints": { - "required": true, - "regex": "^[0-9]{5,10}$", - "validationMessage": "Textboxes with constraints.regex contains length limits." - } - }, - { - "name": "TextBox2", - "type": "Microsoft.Common.TextBox", - "label": "Textboxes-With-Constrains-Validations-2", - "toolTip": "Textboxes with constraints.validations.", - "constraints": { - "regex": "^[A-Za-z][A-Za-z0-9-]{1,61}[A-Za-z0-9]$", - "validationMessage": "Textboxes with constraints.regex contains length limits." - } - } - ], - "outputs": { - "Location": "[location()]" - } - } + "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", + "handler": "Microsoft.Azure.CreateUIDef", + "version": "0.1.2-preview", + "parameters": { + "basics": [ + { + "name": "TextBox1", + "type": "Microsoft.Common.TextBox", + "label": "Textboxes-With-Constrains-Validations", + "toolTip": "Textboxes with constraints.validations.", + "constraints": { + "required": true, + "regex": "^[0-9]{5,10}$", + "validationMessage": "Textboxes with constraints.regex contains length limits." + } + }, + { + "name": "TextBox2", + "type": "Microsoft.Common.TextBox", + "label": "Textboxes-With-Constrains-Validations-2", + "toolTip": "Textboxes with constraints.validations.", + "constraints": { + "regex": "^[A-Za-z][A-Za-z0-9-]{1,61}[A-Za-z0-9]$", + "validationMessage": "Textboxes with constraints.regex contains length limits." + } + }, + { + "name": "TextBox3", + "type": "Microsoft.Common.TextBox", + "label": "Textboxes-With-Constrains-Validations-3", + "toolTip": "Textboxes with constraints.validations.", + "constraints": { + "regex": "^(?!-)[A-Za-z0-9-]{3,63}(?