commit d27a98bcb64a622798d87a74aa048bb50a664df8
Author: Rafael Camargos <email address hidden>
Date: Tue Nov 23 21:18:31 2021 -0300
Add validation of special chars on system values
Setting a system value with special characters will get sysinv in a
dirty state and unreachable. E.g.: `system modify -n='º'`. This is
caused because isystem DB won't accept these special chars.
This work adds a validation on the PATCH method of the SystemController
blocking any special character on string fields that is not accepted.
Test Plan:
PASS: Verify special characters are not accepted as system values
PASS: Verify system works properly after setting a value with any of the
accepted characters: 'a-zA-Z0-9!@#$%^&*()_+-=[]{};:'"|,.<>/? '
PASS: Verify system https_enabled can be properly toggled
PASS: Verify validation works properly in Python 3 (tested code snippet)
PASS: Verify validation is bypassed for non-strings objects
Regression:
PASS: Verify system install
Closes-Bug: 1952008
Signed-off-by: Rafael Camargos <email address hidden>
Change-Id: If73cc2bfa881df3e46611178759ca2527d83330b
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/825545 /opendev. org/starlingx/ config/ commit/ d27a98bcb64a622 798d87a74aa048b b50a664df8
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit d27a98bcb64a622 798d87a74aa048b b50a664df8
Author: Rafael Camargos <email address hidden>
Date: Tue Nov 23 21:18:31 2021 -0300
Add validation of special chars on system values
Setting a system value with special characters will get sysinv in a
dirty state and unreachable. E.g.: `system modify -n='º'`. This is
caused because isystem DB won't accept these special chars.
This work adds a validation on the PATCH method of the SystemController
blocking any special character on string fields that is not accepted.
Test Plan:
PASS: Verify special characters are not accepted as system values 9!@#$%^ &*()_+- =[]{};: '"|,.<> /? '
PASS: Verify system works properly after setting a value with any of the
accepted characters: 'a-zA-Z0-
PASS: Verify system https_enabled can be properly toggled
PASS: Verify validation works properly in Python 3 (tested code snippet)
PASS: Verify validation is bypassed for non-strings objects
Regression:
PASS: Verify system install
Closes-Bug: 1952008 3e46611178759ca 2527d83330b
Signed-off-by: Rafael Camargos <email address hidden>
Change-Id: If73cc2bfa881df