|
8 | 8 |
|
9 | 9 | describe 'using `puppet apply`' do |
10 | 10 | it 'is not exposed by notify' do |
11 | | - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"notice(Sensitive('foo'))\"") |
| 11 | + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"notice(Sensitive('sesitive_data'))\"") |
12 | 12 | expect(stdout_str).to match %r{redacted} |
13 | | - expect(stdout_str).not_to match %r{foo} |
| 13 | + expect(stdout_str).not_to match %r{sesitive_data} |
14 | 14 | expect(stdout_str).not_to match %r{warn|error}i |
15 | 15 | end |
16 | 16 |
|
17 | 17 | it 'is not exposed by a provider' do |
18 | | - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ |
19 | | - "optional_secret => Sensitive('optional foo'), array_secret => [Sensitive('array foo')] }\"") |
| 18 | + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ |
| 19 | + "optional_secret => Sensitive('optional sesitive_data'), array_secret => [Sensitive('array sesitive_data')] }\"") |
20 | 20 | expect(stdout_str).to match %r{redacted} |
21 | | - expect(stdout_str).not_to match %r{foo} |
| 21 | + expect(stdout_str).not_to match %r{sesitive_data} |
22 | 22 | expect(stdout_str).not_to match %r{warn|error}i |
23 | 23 | end |
24 | 24 |
|
25 | 25 | context 'when a sensitive value is not the top level type' do |
26 | 26 | it 'is not exposed by a provider' do |
27 | | - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ |
28 | | - "optional_secret => Sensitive('optional foo'), variant_secret => [Sensitive('variant foo')] }\"") |
| 27 | + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ |
| 28 | + "optional_secret => Sensitive('optional sesitive_data'), variant_secret => [Sensitive('variant sesitive_data')] }\"") |
29 | 29 | expect(stdout_str).to match %r{redacted} |
30 | | - expect(stdout_str).not_to match %r{variant foo} |
| 30 | + expect(stdout_str).not_to match %r{variant sesitive_data} |
31 | 31 | expect(stdout_str).not_to match %r{warn|error}i |
32 | 32 | end |
33 | 33 | it 'properly validates the sensitive type value' do |
34 | | - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ |
35 | | - "optional_secret => Sensitive('optional foo'), variant_secret => [Sensitive(134679)] }\"") |
| 34 | + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ |
| 35 | + "optional_secret => Sensitive('optional sesitive_data'), variant_secret => [Sensitive(134679)] }\"") |
36 | 36 | expect(stdout_str).to match %r{Sensitive\[String\]( value)?, got Sensitive\[Integer\]} |
37 | 37 | expect(stdout_str).not_to match %r{134679} |
38 | 38 | end |
|
43 | 43 | it 'is not exposed in the output' do |
44 | 44 | stdout_str, _status = Open3.capture2e("puppet resource #{common_args} test_sensitive") |
45 | 45 | expect(stdout_str).to match %r{redacted} |
46 | | - expect(stdout_str).not_to match %r{(foo|bar)secret} |
| 46 | + expect(stdout_str).not_to match %r{(sesitive_data|test_resource)secret} |
47 | 47 | expect(stdout_str).not_to match %r{warn|error}i |
48 | 48 | end |
49 | 49 | end |
|
0 commit comments