passphera-core 0.16.0__tar.gz → 0.17.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: passphera-core
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -27,7 +27,7 @@ class GeneratePasswordUseCase:
27
27
  return password_entity
28
28
 
29
29
 
30
- class GetPasswordByContextUseCase:
30
+ class GetPasswordUseCase:
31
31
  def __init__(self, password_repository: PasswordRepository):
32
32
  self.password_repository: PasswordRepository = password_repository
33
33
 
@@ -63,7 +63,7 @@ class DeletePasswordUseCase:
63
63
  self.password_repository.delete(get_password(self.password_repository, context))
64
64
 
65
65
 
66
- class GetAllPasswordsUseCase:
66
+ class ListPasswordsUseCase:
67
67
  def __init__(self, password_repository: PasswordRepository):
68
68
  self.password_repository: PasswordRepository = password_repository
69
69
 
@@ -71,7 +71,7 @@ class GetAllPasswordsUseCase:
71
71
  return self.password_repository.list()
72
72
 
73
73
 
74
- class DeleteAllPasswordsUseCase:
74
+ class FlushPasswordsUseCase:
75
75
  def __init__(self, password_repository: PasswordRepository):
76
76
  self.password_repository: PasswordRepository = password_repository
77
77
 
@@ -75,14 +75,6 @@ class Generator:
75
75
  """
76
76
  self.characters_replacements.pop(char, None)
77
77
 
78
- def apply_replacements(self, password: str) -> str:
79
- """
80
- Replace character from the ciphered password with character replacements from the generator configurations
81
- :param password: The password to perform the action on it
82
- :return: str: The new ciphered password after character replacements
83
- """
84
- return password.translate(str.maketrans(self.characters_replacements))
85
-
86
78
  def generate_password(self, text: str) -> str:
87
79
  """
88
80
  Generate a strong password string using the raw password (add another layer of encryption to it)
@@ -93,5 +85,5 @@ class Generator:
93
85
  secondary_algorithm: AffineCipherAlgorithm = AffineCipherAlgorithm(self.shift, self.multiplier)
94
86
  intermediate: str = secondary_algorithm.encrypt(f"{self.prefix}{text}{self.postfix}")
95
87
  password: str = main_algorithm.encrypt(intermediate)
96
- password = self.apply_replacements(password)
88
+ password = password.translate(str.maketrans(self.characters_replacements))
97
89
  return ''.join(c.upper() if c in text else c for c in password)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: passphera-core
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -5,7 +5,7 @@ with open("README.md", "r") as f:
5
5
 
6
6
  setup(
7
7
  name='passphera-core',
8
- version='0.16.0',
8
+ version='0.17.0',
9
9
  author='Fathi Abdelmalek',
10
10
  author_email='abdelmalek.fathi.2001@gmail.com',
11
11
  url='https://github.com/passphera/core',