|
6 | 6 | 'vault_name' => 'vault_name', |
7 | 7 | 'vault_api_version' => 'vault_api_version', |
8 | 8 | 'metadata_api_version' => 'metadata_api_version', |
9 | | - 'confine_to_keys' => [%r{^.*sensitive_azure.*}], |
| 9 | + 'confine_to_keys' => ['^.*sensitive_azure.*'], |
10 | 10 | } |
11 | 11 | end |
12 | 12 | let(:lookup_context) do |
|
81 | 81 | it 'errors when passing invalid regexes' do |
82 | 82 | is_expected.to run.with_params( |
83 | 83 | 'profile::windows::sqlserver::sensitive_azure_sql_user_password', options.merge({ 'confine_to_keys' => ['['] }), lookup_context |
84 | | - ).and_raise_error(ArgumentError, %r{'confine_to_keys' index 0 expects a Regexp value}i) |
| 84 | + ).and_raise_error(ArgumentError, %r{creating regexp failed with}i) |
85 | 85 | end |
86 | 86 |
|
87 | 87 | it 'returns the key if regex matches confine_to_keys' do |
|
90 | 90 | expect(TragicCode::Azure).to receive(:get_access_token).and_return(access_token_value) |
91 | 91 | expect(TragicCode::Azure).to receive(:get_secret).and_return(secret_value) |
92 | 92 | is_expected.to run.with_params( |
93 | | - 'profile::windows::sqlserver::sensitive_azure_sql_user_password', options.merge({ 'confine_to_keys' => [%r{^.*sensitive_azure.*}] }), lookup_context |
| 93 | + 'profile::windows::sqlserver::sensitive_azure_sql_user_password', options.merge({ 'confine_to_keys' => ['^.*sensitive_azure.*'] }), lookup_context |
94 | 94 | ).and_return(secret_value) |
95 | 95 | end |
96 | 96 |
|
|
103 | 103 | expect(TragicCode::Azure).to receive(:get_secret).and_return(secret_value) |
104 | 104 |
|
105 | 105 | is_expected.to run.with_params( |
106 | | - 'profile::windows::sqlserver::sensitive_sql_user_password', options.merge({ 'confine_to_keys' => [%r{^sensitive_azure.*$}] }), lookup_context |
| 106 | + 'profile::windows::sqlserver::sensitive_sql_user_password', options.merge({ 'confine_to_keys' => ['^sensitive_azure.*$'] }), lookup_context |
107 | 107 | ) |
108 | 108 | end |
109 | 109 | end |
0 commit comments