fachuan / apps /core /protocols /common /security_protocols.py
jun2024's picture
Upload 2241 files
f8b03c1 verified
Raw History Blame Contribute Delete
1.21 kB
"""Module for security protocols."""
from typing import Any, Protocol
class ISecurityService(Protocol):
def encrypt(self, text: str) -> str: ...
def decrypt(self, encrypted_text: str) -> str: ...
def mask_sensitive_data(self, data: dict[str, Any], keys: list[Any] | None = None) -> dict[str, Any]: ...
def encrypt_config(self, config: dict[str, Any]) -> dict[str, Any]: ...
def decrypt_config(self, config: dict[str, Any]) -> dict[str, Any]: ...
class IValidatorService(Protocol):
def validate_case_number(self, case_number: str) -> bool: ...
def normalize_case_number(self, case_number: str) -> str: ...
def validate_file(self, file_path: str, expected_extensions: list[Any] | None = None) -> dict[str, Any]: ...
def clean_text(self, text: str) -> str: ...
def extract_case_numbers(self, text: str) -> list[str]: ...
class IPermissionService(Protocol):
def can_access_case(self, user_id: int, case_id: int) -> bool: ...
def can_modify_case(self, user_id: int, case_id: int) -> bool: ...
def can_access_contract(self, user_id: int, contract_id: int) -> bool: ...
def has_permission(self, user_id: int, permission: str) -> bool: ...