Initial commit: SenSu Alpha 0.2.0
- 13-service async plugin framework - Textual TUI with CLI fallback - Plugin hot-reload + permission system - Web management panel (aiohttp) - Bridge-based inter-module communication - 10 regression tests Fixes applied: - PBKDF2-SHA256 auth (was plain SHA256) - Auth bypass removed (was allow-all on fail) - Bare excepts replaced with logged errors - CatFramework/DreamSu -> SenSu naming unified - ServiceManager: health checks + startup_order - Env var credentials (SENSU_ADMIN_PASSWORD etc)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import pytest,os
|
||||
from services.auth_service import AuthService
|
||||
class TestAuthService:
|
||||
def test_hash_consistent(self):
|
||||
s=AuthService({});assert s._hash_password("x")==s._hash_password("x")
|
||||
def test_hash_len(self):
|
||||
assert len(AuthService({})._hash_password("x"))==64
|
||||
def test_invalid_login(self):
|
||||
assert AuthService({}).authenticate_user("admin","WRONG") is None
|
||||
def test_valid_login(self):
|
||||
pw=os.environ.get("SENSU_ADMIN_PASSWORD","admin123")
|
||||
assert AuthService({}).authenticate_user("admin",pw) is not None
|
||||
Reference in New Issue
Block a user