@@ -83,13 +83,13 @@ def test_retrieve_revert_ldap_valid(tmp_config_files):
83
83
unsecured_key = ldap .get_nested_key (['password' ])
84
84
ldap .store ()
85
85
with open (ldap_config_file ) as f :
86
- data = yaml .load (f )
86
+ data = yaml .safe_load (f )
87
87
assert ldap .parse_secure_key (data ['password' ])
88
88
retrieved_key_dict = ldap .retrieve ()
89
89
assert retrieved_key_dict ['password' ] == unsecured_key
90
90
ldap .revert ()
91
91
with open (ldap_config_file ) as f :
92
- data = yaml .load (f )
92
+ data = yaml .safe_load (f )
93
93
assert data ['password' ] == unsecured_key
94
94
95
95
@@ -112,13 +112,13 @@ def test_retrieve_revert_umapi_valid(private_key, modify_umapi_config):
112
112
unsecured_api_key = umapi .get_nested_key (['enterprise' , 'client_id' ])
113
113
umapi .store ()
114
114
with open (umapi_config_file , 'r' ) as f :
115
- data = yaml .load (f )
115
+ data = yaml .safe_load (f )
116
116
assert umapi .parse_secure_key (data ['enterprise' ]['client_id' ])
117
117
retrieved_key_dict = umapi .retrieve ()
118
118
assert retrieved_key_dict ['enterprise:client_id' ] == unsecured_api_key
119
119
umapi .revert ()
120
120
with open (umapi_config_file ) as f :
121
- data = yaml .load (f )
121
+ data = yaml .safe_load (f )
122
122
assert data ['enterprise' ]['client_id' ] == unsecured_api_key
123
123
124
124
@@ -127,28 +127,28 @@ def test_credman_retrieve_revert_valid(tmp_config_files, private_key, modify_uma
127
127
umapi_config_file = modify_umapi_config (['enterprise' , 'priv_key_path' ], private_key )
128
128
credman = CredentialManager (root_config_file , auto = True )
129
129
with open (ldap_config_file ) as f :
130
- data = yaml .load (f )
130
+ data = yaml .safe_load (f )
131
131
plaintext_ldap_password = data ['password' ]
132
132
with open (umapi_config_file ) as f :
133
- data = yaml .load (f )
133
+ data = yaml .safe_load (f )
134
134
plaintext_umapi_api_key = data ['enterprise' ]['client_id' ]
135
135
credman .store ()
136
136
retrieved_creds = credman .retrieve ()
137
137
assert retrieved_creds [ldap_config_file ]['password' ] == plaintext_ldap_password
138
138
assert retrieved_creds [umapi_config_file ]['enterprise:client_id' ] == plaintext_umapi_api_key
139
139
# make sure the config files are still in secure format
140
140
with open (ldap_config_file ) as f :
141
- data = yaml .load (f )
141
+ data = yaml .safe_load (f )
142
142
assert data ['password' ] != plaintext_ldap_password
143
143
with open (umapi_config_file ) as f :
144
- data = yaml .load (f )
144
+ data = yaml .safe_load (f )
145
145
assert data ['enterprise' ]['client_id' ] != plaintext_umapi_api_key
146
146
credman .revert ()
147
147
with open (ldap_config_file ) as f :
148
- data = yaml .load (f )
148
+ data = yaml .safe_load (f )
149
149
assert data ['password' ] == plaintext_ldap_password
150
150
with open (umapi_config_file ) as f :
151
- data = yaml .load (f )
151
+ data = yaml .safe_load (f )
152
152
assert data ['enterprise' ]['client_id' ] == plaintext_umapi_api_key
153
153
154
154
@@ -208,7 +208,7 @@ def test_config_store(tmp_config_files):
208
208
assert not ldap .parse_secure_key (ldap .get_nested_key (key .key_path ))
209
209
ldap .store ()
210
210
with open (ldap_config_file ) as f :
211
- data = yaml .load (f )
211
+ data = yaml .safe_load (f )
212
212
assert ldap .parse_secure_key (data ['password' ])
213
213
214
214
@@ -254,13 +254,13 @@ def test_credman_encrypt_decrypt_key_data(tmp_config_files, private_key, modify_
254
254
umapi_config_file = modify_umapi_config (['enterprise' , 'priv_key_data' ], key_data )
255
255
credman = CredentialManager (root_config_file , auto = True )
256
256
with open (umapi_config_file ) as f :
257
- umapi_dict = yaml .load (f )
257
+ umapi_dict = yaml .safe_load (f )
258
258
assert encryption .is_encryptable (umapi_dict ['enterprise' ]['priv_key_data' ])
259
259
credman .store ()
260
260
with open (umapi_config_file ) as f :
261
- umapi_dict = yaml .load (f )
261
+ umapi_dict = yaml .safe_load (f )
262
262
assert not encryption .is_encryptable (umapi_dict ['enterprise' ]['priv_key_data' ])
263
263
credman .revert ()
264
264
with open (umapi_config_file ) as f :
265
- umapi_dict = yaml .load (f )
265
+ umapi_dict = yaml .safe_load (f )
266
266
assert encryption .is_encryptable (umapi_dict ['enterprise' ]['priv_key_data' ])
0 commit comments