File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -144,11 +144,12 @@ Describe 'Tests for the secret() function and extensions' {
144144 type: Microsoft.DSC.Debug/Echo
145145 properties:
146146 output: "[parameters('myString')]"
147+ showSecrets: true
147148'@
148149 $out = dsc - l trace config get - i $configYaml 2> $TestDrive / error.log | ConvertFrom-Json
149150 $LASTEXITCODE | Should - Be 0
150151 $out.results.Count | Should - Be 1
151- $out.results [0 ].result.actualState.Output | Should - BeExactly ' Hello'
152+ $out.results [0 ].result.actualState.Output.secureString | Should - BeExactly ' Hello'
152153 }
153154
154155 It ' Allows to pass in secret() through variables' {
Original file line number Diff line number Diff line change @@ -274,11 +274,18 @@ Describe 'Parameters tests' {
274274 $out.results [0 ].result.inDesiredState | Should - BeTrue
275275 }
276276
277- It ' secure types can be passed as objects to resources' {
277+ It ' secure types can be passed as objects to resources but redacted in output ' {
278278 $out = dsc config -f $PSScriptRoot / ../ examples/ secure_parameters.parameters.yaml get -f $PSScriptRoot / ../ examples/ secure_parameters.dsc.yaml | ConvertFrom-Json
279279 $LASTEXITCODE | Should - Be 0
280- $out.results [0 ].result.actualState.output | Should - BeExactly ' mySecret'
281- $out.results [1 ].result.actualState.output | Should - BeExactly ' mySecretProperty'
280+ $out.results [0 ].result.actualState.output | Should - BeExactly ' <secureValue>'
281+ $out.results [1 ].result.actualState.output | Should - BeExactly ' <secureValue>'
282+ }
283+
284+ It ' secure types can be passed as objects to resources' {
285+ $out = dsc config -f $PSScriptRoot / ../ examples/ secure_parameters_shown.parameters.yaml get -f $PSScriptRoot / ../ examples/ secure_parameters.dsc.yaml | ConvertFrom-Json
286+ $LASTEXITCODE | Should - Be 0
287+ $out.results [0 ].result.actualState.output.secureString | Should - BeExactly ' mySecret'
288+ $out.results [1 ].result.actualState.output.secureString | Should - BeExactly ' mySecretProperty'
282289 }
283290
284291 It ' parameter types are validated for <type>' - TestCases @ (
You can’t perform that action at this time.
0 commit comments