"""
=========================================
CV6 AI Trading OS
Security Manager
=========================================
"""

from passlib.context import CryptContext

# =========================================
# Password Hash
# =========================================

pwd_context = CryptContext(
    schemes=["bcrypt"],
    deprecated="auto"
)

# =========================================
# Password Functions
# =========================================

def hash_password(password: str) -> str:
    return pwd_context.hash(password)


def verify_password(
    plain_password: str,
    hashed_password: str
) -> bool:
    return pwd_context.verify(
        plain_password,
        hashed_password
    )

# NOTE: JWT create_access_token/verify_token live solely in app.core.auth —
# this file previously had a second, dead, unused duplicate here.