fix: Applied fix for name, the oracle team sharing, sentinel client list visibility

This commit is contained in:
Sagnik
2026-04-19 17:07:12 +05:30
parent 269591a3cc
commit d886e4a669
20 changed files with 940 additions and 109 deletions

View File

@@ -34,13 +34,19 @@ ROLE_HIERARCHY = {
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def _truncate_bcrypt_input(value: str) -> str:
raw = value.encode("utf-8")
if len(raw) <= 72:
return value
return raw[:72].decode("utf-8", errors="ignore")
def hash_password(plain: str) -> str:
return pwd_context.hash(plain)
return pwd_context.hash(_truncate_bcrypt_input(plain))
def verify_password(plain: str, hashed: str) -> bool:
# Truncate to 72 bytes to prevent bcrypt 500 errors
return pwd_context.verify(plain[:72], hashed)
return pwd_context.verify(_truncate_bcrypt_input(plain), hashed)
# ── JWT helpers ───────────────────────────────────────────────────────────────