Add Azure Key Vault support and enhance credential handling in configuration data
This commit is contained in:
@@ -20,6 +20,11 @@ function Assert-ConfigurationDataParameterType {
|
||||
|
||||
switch($TypeName){
|
||||
"string" {
|
||||
if(Test-ConfigurationDataSecretReference -Value $Value){
|
||||
Assert-ConfigurationDataSecretReference -Name $Name -TypeName "string" -Value $Value
|
||||
return
|
||||
}
|
||||
|
||||
if($Value -isnot [string]){
|
||||
throw "Parameter [$Name] expects type [string], but received [$($Value.GetType().Name)]."
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ function Assert-ConfigurationDataSecretReference {
|
||||
$Name,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet("credential", "securestring")]
|
||||
[ValidateSet("credential", "securestring", "string")]
|
||||
[string]
|
||||
$TypeName,
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ function Resolve-ConfigurationDataParameterSecrets {
|
||||
$ResolvedConfigurationData.Parameters[$Parameter.Name] = $Definition
|
||||
|
||||
$TypeName = [string](Get-ConfigurationDataMapValue -Map $Definition -Key "Type" -DefaultValue "")
|
||||
if($TypeName -notin @("credential", "secureString")){
|
||||
if($TypeName -notin @("credential", "secureString", "string")){
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,10 @@ function Resolve-ConfigurationDataProviderSettingsPath {
|
||||
return (Join-Path -Path (Get-Location).Path -ChildPath $FileName)
|
||||
}
|
||||
|
||||
if((Test-Path -Path $SettingsPath -PathType Container) -or $SettingsPath.EndsWith("\") -or $SettingsPath.EndsWith("/")){
|
||||
if((Test-Path -Path $SettingsPath -PathType Container) -or
|
||||
$SettingsPath.EndsWith("\") -or
|
||||
$SettingsPath.EndsWith("/") -or
|
||||
[string]::IsNullOrWhiteSpace([System.IO.Path]::GetExtension($SettingsPath))){
|
||||
return (Join-Path -Path $SettingsPath -ChildPath $FileName)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user