ComfyUI/tests-unit
Dr.Lt.Data af96d9812d
feat(security): add System User protection with __ prefix (#10966)
* feat(security): add System User protection with `__` prefix

Add protected namespace for custom nodes to store sensitive data
(API keys, licenses) that cannot be accessed via HTTP endpoints.

Key changes:
- New API: get_system_user_directory() for internal access
- New API: get_public_user_directory() with structural blocking
- 3-layer defense: header validation, path blocking, creation prevention
- 54 tests covering security, edge cases, and backward compatibility

System Users use `__` prefix (e.g., __system, __cache) following
Python's private member convention. They exist in user_directory/
but are completely blocked from /userdata HTTP endpoints.

* style: remove unused imports
2025-11-28 21:28:42 -05:00
..
app_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
comfy_api_nodes_test More API Nodes (#7956) 2025-05-06 04:23:00 -04:00
comfy_api_test Add get_duration method to Comfy VIDEO type (#8122) 2025-05-15 00:11:41 -04:00
comfy_extras_test [feat] Add GetImageSize node (#8386) 2025-06-02 21:57:50 -04:00
comfy_quant Cleanup and fix issues with text encoder quants. (#10872) 2025-11-25 01:48:53 -05:00
comfy_test Allow changing folder_paths.base_path via command line argument. (#6600) 2025-01-29 08:06:28 -05:00
execution_test Reland union type (#5900) 2024-12-04 15:12:10 -05:00
folder_paths_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
prompt_server_test feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
server/utils Remove unused GET /files API endpoint (#6714) 2025-02-05 18:48:36 -05:00
server_test dont cache new locale entry points (#10101) 2025-09-29 12:16:02 -07:00
utils Normalize extra_model_config.yaml paths to prevent duplicates. (#6885) 2025-02-20 07:09:45 -05:00
feature_flags_test.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
README.md Minor: update tests-unit README.md (#4896) 2024-09-12 04:53:08 -04:00
requirements.txt Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
websocket_feature_flags_test.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00

Pytest Unit Tests

Install test dependencies

pip install -r tests-unit/requirements.txt

Run tests

pytest tests-unit/