Download apps/core/protocols/common/security_protocols.py from jun2024/fachuan: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/jun2024/fachuan/resolve/main/apps/core/protocols/common/security_protocols.py
- Command line
-
hf download hf://spaces/jun2024/fachuan/apps/core/protocols/common/security_protocols.py
-
curl -L -o security_protocols.py https://huggingface.co/spaces/jun2024/fachuan/resolve/main/apps/core/protocols/common/security_protocols.py
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: ... | |