Merge dev to main: Security improvements and comprehensive test infrastructure #39

Merged
jimmy merged 195 commits from dev into main 2026-04-08 01:42:27 +08:00
Showing only changes of commit de219a388a - Show all commits
@@ -278,6 +278,14 @@ class TestPasswordPersistence:
def test_load_password_hash_from_env(self, mock_config, temp_auth_file): def test_load_password_hash_from_env(self, mock_config, temp_auth_file):
"""Test loading password hash from environment variable.""" """Test loading password hash from environment variable."""
# Clear any hash in the file first
import json
with open(temp_auth_file, 'r') as f:
data = json.load(f)
data['password_hash'] = ""
with open(temp_auth_file, 'w') as f:
json.dump(data, f)
# When no hash in file, should return env var # When no hash in file, should return env var
loaded = load_password_hash() loaded = load_password_hash()
assert loaded == mock_config.ADMIN_PASSWORD_HASH assert loaded == mock_config.ADMIN_PASSWORD_HASH