auth endpoints added
This commit is contained in:
@@ -15,7 +15,7 @@ from typing import Union, Dict, List, Optional, Any, TypeVar
|
||||
from Controllers.Redis.connection import redis_cli
|
||||
|
||||
|
||||
T = TypeVar('T', Dict[str, Any], List[Any])
|
||||
T = TypeVar("T", Dict[str, Any], List[Any])
|
||||
|
||||
|
||||
class RedisKeyError(Exception):
|
||||
@@ -277,18 +277,18 @@ class RedisRow:
|
||||
"""
|
||||
if not key:
|
||||
raise RedisKeyError("Cannot set empty key")
|
||||
|
||||
|
||||
# Convert to string for validation
|
||||
key_str = key.decode() if isinstance(key, bytes) else str(key)
|
||||
|
||||
|
||||
# Validate key length (Redis has a 512MB limit for keys)
|
||||
if len(key_str) > 512 * 1024 * 1024:
|
||||
raise RedisKeyError("Key exceeds maximum length of 512MB")
|
||||
|
||||
|
||||
# Validate key format (basic check for invalid characters)
|
||||
if any(c in key_str for c in ['\n', '\r', '\t', '\0']):
|
||||
if any(c in key_str for c in ["\n", "\r", "\t", "\0"]):
|
||||
raise RedisKeyError("Key contains invalid characters")
|
||||
|
||||
|
||||
self.key = key if isinstance(key, bytes) else str(key).encode()
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user