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' {
144
144
type: Microsoft.DSC.Debug/Echo
145
145
properties:
146
146
output: "[parameters('myString')]"
147
+ showSecrets: true
147
148
'@
148
149
$out = dsc - l trace config get - i $configYaml 2> $TestDrive / error.log | ConvertFrom-Json
149
150
$LASTEXITCODE | Should - Be 0
150
151
$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'
152
153
}
153
154
154
155
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' {
274
274
$out.results [0 ].result.inDesiredState | Should - BeTrue
275
275
}
276
276
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 ' {
278
278
$out = dsc config -f $PSScriptRoot / ../ examples/ secure_parameters.parameters.yaml get -f $PSScriptRoot / ../ examples/ secure_parameters.dsc.yaml | ConvertFrom-Json
279
279
$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'
282
289
}
283
290
284
291
It ' parameter types are validated for <type>' - TestCases @ (
You can’t perform that action at this time.
0 commit comments