|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| root (tmp_path, monkeypatch) | |
| client () | |
| set[Path] | _yaml_files (Path base) |
| test_a_climbing_filename_lands_in_the_users_folder (root, tmp_path, client) | |
| test_an_absolute_filename_does_not_replace_the_folder (root, tmp_path, client) | |
| test_a_file_that_does_not_parse_is_not_written (root, tmp_path, client) | |
| test_a_file_that_is_not_a_config_is_not_written (root, tmp_path, client) | |
| test_names_that_are_not_yaml_files_are_refused (root, client, name) | |
Variables | |
| reason | |
| dict | H = {"X-Auth-Email": "upload-confined@berkeley.edu"} |
| VALID = session_mod._DEFAULT_CONFIG_PATH.read_bytes() | |
POST /api/config/upload writes only a basename, only under the caller's folder, only if it parses. The multipart filename is the client's string. Joined onto the uploads folder as given, "../../../x.yaml" climbed out of output/user_configs/<user>/ and an absolute path replaced the folder outright (pathlib's ``/`` drops the left side for an absolute right side) -- so a request naming /app/configs/default.yaml overwrote the default every new session loads. The bytes were written before they were parsed, so even a file answered with 400 "Invalid YAML" had landed.
|
protected |
Definition at line 47 of file test_config_upload_confined.py.
Referenced by test_a_climbing_filename_lands_in_the_users_folder(), test_a_file_that_does_not_parse_is_not_written(), and test_a_file_that_is_not_a_config_is_not_written().
| test_config_upload_confined.client | ( | ) |
Definition at line 43 of file test_config_upload_confined.py.
| test_config_upload_confined.root | ( | tmp_path, | |
| monkeypatch ) |
A project root three folders deep, so a climb of three lands inside tmp_path.
Definition at line 33 of file test_config_upload_confined.py.
| test_config_upload_confined.test_a_climbing_filename_lands_in_the_users_folder | ( | root, | |
| tmp_path, | |||
| client ) |
Definition at line 51 of file test_config_upload_confined.py.
References _yaml_files().
| test_config_upload_confined.test_a_file_that_does_not_parse_is_not_written | ( | root, | |
| tmp_path, | |||
| client ) |
Definition at line 79 of file test_config_upload_confined.py.
References _yaml_files().
| test_config_upload_confined.test_a_file_that_is_not_a_config_is_not_written | ( | root, | |
| tmp_path, | |||
| client ) |
Definition at line 89 of file test_config_upload_confined.py.
References _yaml_files().
| test_config_upload_confined.test_an_absolute_filename_does_not_replace_the_folder | ( | root, | |
| tmp_path, | |||
| client ) |
Definition at line 67 of file test_config_upload_confined.py.
| test_config_upload_confined.test_names_that_are_not_yaml_files_are_refused | ( | root, | |
| client, | |||
| name ) |
Definition at line 100 of file test_config_upload_confined.py.
| dict test_config_upload_confined.H = {"X-Auth-Email": "upload-confined@berkeley.edu"} |
Definition at line 28 of file test_config_upload_confined.py.
| test_config_upload_confined.reason |
Definition at line 20 of file test_config_upload_confined.py.
| test_config_upload_confined.VALID = session_mod._DEFAULT_CONFIG_PATH.read_bytes() |
Definition at line 29 of file test_config_upload_confined.py.