You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement/password sanitation before hashing (#122)
* added tests to verify proper password sanitizion
* added password sanitizion
* created the password_verify function
* updated the __eq__ function so that the password is no longer ignored and verified if updated
* splited up the add_or_update function, so that passwords are only created if updated or not existing
* updated tests, so that password_verify can be used
* updated naming
* added default value for password
* added additonal tests
* sanity errors
* applied DonGiovanni suggestion
* applied DonGiovanni suggestion
* applied DonGiovanni suggestion
* applied DonGiovanni suggestion (password_verify typing)
* updated tests, so that a new testuser can be added
* updated group removal, so that the groupname attribute is removed from the user as well
* updated tests to verify changes
* added fragment
* added minor_changes fragment
full_name: "Test User 21: Test User Creation with valid api_keys"
202
202
register: api_keys_result
203
203
204
204
- name: Return the created apikeys and secret of Test User 21
205
205
ansible.builtin.debug:
206
206
msg: "The following api_keys were created {{ api_keys_result.generated_apikeys }}"
207
207
when:
208
208
- "'generated_apikeys' in api_keys_result"
209
-
- api_keys_result.generated_apikeys | length > 0
209
+
- api_keys_result.generated_apikeys | length > 0
210
+
211
+
# Test User password escaping
212
+
- name: "Test User 22: Test password escaping"
213
+
puzzle.opnsense.system_access_users:
214
+
username: test_user_22
215
+
password: test_password_22\
216
+
shell: /bin/sh
217
+
groups:
218
+
- admins
219
+
220
+
# Test User password escaping
221
+
- name: "Test User 23: Test password escaping"
222
+
puzzle.opnsense.system_access_users:
223
+
username: test_user_23
224
+
password: test_password_23'
225
+
shell: /bin/sh
226
+
groups:
227
+
- admins
228
+
229
+
# we have no alternative way to compare the values
230
+
# other than getting them from the config
231
+
# see https://github.com/opnsense/core/blob/24.1/src/opnsense/scripts/syslog/log_archive#L36
232
+
- name: Get current config
233
+
ansible.builtin.slurp:
234
+
src: /conf/config.xml
235
+
register: current_config
236
+
237
+
- name: Test that no error message is in config
238
+
ansible.builtin.assert:
239
+
that:
240
+
- "'syntax error, unexpected identifier \"cost\", expecting \")\" in Command line code on line 1' not in (current_config.content | b64decode | string)"
241
+
- "'syntax error, unexpected single-quoted string \",PASSWORD_BCRYPT,[ \", expecting \")\" in Command line code on line 1' not in (current_config.content | b64decode | string)"
0 commit comments