Coverage for confy_addons/core/abstract.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-02-20 18:19 +0000

1"""Abstract base class for encryption handlers. 

2 

3This module defines an abstract base class that specifies the interface 

4for encryption handlers. Any concrete encryption handler must implement 

5the methods defined in this abstract base class. 

6""" 

7 

8from abc import ABC, abstractmethod 

9 

10 

11class AESEncryptionABC(ABC): 

12 """Abstract base class for encryption handlers. 

13 

14 This class defines the interface for encryption handlers, requiring 

15 implementation of encryption and decryption methods. 

16 """ 

17 

18 @abstractmethod 

19 def encrypt(self, plaintext: str) -> str: 

20 """Encrypts the given plaintext string. 

21 

22 Args: 

23 plaintext (str): The text to be encrypted. 

24 

25 Returns: 

26 str: The encrypted text as a string. 

27 

28 """ 

29 pass # pragma: no cover 

30 

31 @abstractmethod 

32 def decrypt(self, ciphertext: str) -> str: 

33 """Decrypts the given ciphertext string. 

34 

35 Args: 

36 ciphertext (str): The text to be decrypted. 

37 

38 Returns: 

39 str: The decrypted text as a string. 

40 

41 """ 

42 pass # pragma: no cover