passphera-core 0.24.0__tar.gz → 0.25.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.
- {passphera_core-0.24.0 → passphera_core-0.25.0}/PKG-INFO +1 -1
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/application/generator.py +8 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/entities.py +14 -6
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/PKG-INFO +1 -1
- {passphera_core-0.24.0 → passphera_core-0.25.0}/setup.py +1 -1
- {passphera_core-0.24.0 → passphera_core-0.25.0}/README.md +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/__init__.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/application/__init__.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/application/password.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/exceptions.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/interfaces.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core/utilities.py +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/SOURCES.txt +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/dependency_links.txt +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/requires.txt +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/top_level.txt +0 -0
- {passphera_core-0.24.0 → passphera_core-0.25.0}/setup.cfg +0 -0
@@ -40,6 +40,14 @@ class ResetPropertyUseCase:
|
|
40
40
|
return generator_entity
|
41
41
|
|
42
42
|
|
43
|
+
class GetCharacterReplacementUseCase:
|
44
|
+
def __init__(self, generator_repository: GeneratorRepository):
|
45
|
+
self.generator_repository: GeneratorRepository = generator_repository
|
46
|
+
|
47
|
+
def __call__(self, character: str) -> str:
|
48
|
+
return self.generator_repository.get().get_character_replacement(character)
|
49
|
+
|
50
|
+
|
43
51
|
class SetCharacterReplacementUseCase:
|
44
52
|
def __init__(self, generator_repository: GeneratorRepository):
|
45
53
|
self.generator_repository: GeneratorRepository = generator_repository
|
@@ -135,25 +135,33 @@ class Generator:
|
|
135
135
|
if prop == "algorithm":
|
136
136
|
self.get_algorithm()
|
137
137
|
self.updated_at = datetime.now(timezone.utc)
|
138
|
+
|
139
|
+
def get_character_replacement(self, character: str) -> str:
|
140
|
+
"""
|
141
|
+
Get the replacement string for a given character
|
142
|
+
:param character: The character to get its replacement
|
143
|
+
:return: str: The replacement string for the character, or the character itself if no replacement exists
|
144
|
+
"""
|
145
|
+
return self.characters_replacements.get(character, character)
|
138
146
|
|
139
|
-
def replace_character(self,
|
147
|
+
def replace_character(self, character: str, replacement: str) -> None:
|
140
148
|
"""
|
141
149
|
Replace a character with another character or set of characters
|
142
150
|
Eg: pg.replace_character('a', '@1')
|
143
|
-
:param
|
151
|
+
:param character: The character to be replaced
|
144
152
|
:param replacement: The (character|set of characters) to replace the first one
|
145
153
|
:return: None
|
146
154
|
"""
|
147
|
-
self.characters_replacements[
|
155
|
+
self.characters_replacements[character[0]] = replacement
|
148
156
|
self.updated_at = datetime.now(timezone.utc)
|
149
157
|
|
150
|
-
def reset_character(self,
|
158
|
+
def reset_character(self, character: str) -> None:
|
151
159
|
"""
|
152
160
|
Reset a character to its original value (remove its replacement from characters_replacements)
|
153
|
-
:param
|
161
|
+
:param character: The character to be reset to its original value
|
154
162
|
:return: None
|
155
163
|
"""
|
156
|
-
self.characters_replacements.pop(
|
164
|
+
self.characters_replacements.pop(character, None)
|
157
165
|
self.updated_at = datetime.now(timezone.utc)
|
158
166
|
|
159
167
|
def generate_password(self, text: str) -> str:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{passphera_core-0.24.0 → passphera_core-0.25.0}/passphera_core.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|