passphera-core 0.12.0__py3-none-any.whl → 0.13.0__py3-none-any.whl
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/application/generator.py +10 -10
- passphera_core/application/password.py +1 -1
- passphera_core/interfaces.py +1 -1
- {passphera_core-0.12.0.dist-info → passphera_core-0.13.0.dist-info}/METADATA +1 -1
- passphera_core-0.13.0.dist-info/RECORD +11 -0
- passphera_core-0.12.0.dist-info/RECORD +0 -11
- {passphera_core-0.12.0.dist-info → passphera_core-0.13.0.dist-info}/WHEEL +0 -0
- {passphera_core-0.12.0.dist-info → passphera_core-0.13.0.dist-info}/top_level.txt +0 -0
@@ -9,16 +9,16 @@ class GetGeneratorUseCase:
|
|
9
9
|
def __init__(self, generator_repository: GeneratorRepository):
|
10
10
|
self.generator_repository: GeneratorRepository = generator_repository
|
11
11
|
|
12
|
-
def execute(self
|
13
|
-
return self.generator_repository.get(
|
12
|
+
def execute(self) -> Generator:
|
13
|
+
return self.generator_repository.get()
|
14
14
|
|
15
15
|
|
16
16
|
class GetGeneratorPropertyUseCase:
|
17
17
|
def __init__(self, generator_repository: GeneratorRepository):
|
18
18
|
self.generator_repository: GeneratorRepository = generator_repository
|
19
19
|
|
20
|
-
def execute(self,
|
21
|
-
generator_entity: Generator = self.generator_repository.get(
|
20
|
+
def execute(self, field: str) -> str:
|
21
|
+
generator_entity: Generator = self.generator_repository.get()
|
22
22
|
return getattr(generator_entity, field)
|
23
23
|
|
24
24
|
|
@@ -26,8 +26,8 @@ class UpdateGeneratorPropertyUseCase:
|
|
26
26
|
def __init__(self, generator_repository: GeneratorRepository):
|
27
27
|
self.generator_repository: GeneratorRepository = generator_repository
|
28
28
|
|
29
|
-
def execute(self,
|
30
|
-
generator_entity: Generator = self.generator_repository.get(
|
29
|
+
def execute(self, field: str, value: str) -> None:
|
30
|
+
generator_entity: Generator = self.generator_repository.get()
|
31
31
|
setattr(generator_entity, field, value)
|
32
32
|
if field == 'algorithm':
|
33
33
|
generator_entity.get_algorithm()
|
@@ -39,8 +39,8 @@ class AddCharacterReplacementUseCase:
|
|
39
39
|
def __init__(self, generator_repository: GeneratorRepository):
|
40
40
|
self.generator_repository: GeneratorRepository = generator_repository
|
41
41
|
|
42
|
-
def execute(self,
|
43
|
-
generator_entity: Generator = self.generator_repository.get(
|
42
|
+
def execute(self, character: str, replacement: str) -> None:
|
43
|
+
generator_entity: Generator = self.generator_repository.get()
|
44
44
|
generator_entity.replace_character(character, replacement)
|
45
45
|
generator_entity.updated_at = datetime.now(timezone.utc)
|
46
46
|
self.generator_repository.update(generator_entity)
|
@@ -50,8 +50,8 @@ class ResetCharacterReplacementUseCase:
|
|
50
50
|
def __init__(self, generator_repository: GeneratorRepository,):
|
51
51
|
self.generator_repository: GeneratorRepository = generator_repository
|
52
52
|
|
53
|
-
def execute(self,
|
54
|
-
generator_entity: Generator = self.generator_repository.get(
|
53
|
+
def execute(self, character: str) -> None:
|
54
|
+
generator_entity: Generator = self.generator_repository.get()
|
55
55
|
generator_entity.reset_character(character)
|
56
56
|
generator_entity.updated_at = datetime.now(timezone.utc)
|
57
57
|
self.generator_repository.update(generator_entity)
|
@@ -16,7 +16,7 @@ class GeneratePasswordUseCase:
|
|
16
16
|
|
17
17
|
def execute(self, generator_id: UUID, context: str, text: str) -> Password:
|
18
18
|
password_entity: Password = self.password_repository.get_by_context(context)
|
19
|
-
if password_entity:
|
19
|
+
if password_entity and password_entity.deleted_at is not None:
|
20
20
|
raise DuplicatePasswordException(password_entity)
|
21
21
|
generator_entity: Generator = self.generator_repository.get(generator_id)
|
22
22
|
password: str = generator_entity.generate_password(text)
|
passphera_core/interfaces.py
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
passphera_core/entities.py,sha256=OvVU6HzWF0GWElq_VFU-GUyittaOf5x8yMHYlAjemsE,4326
|
3
|
+
passphera_core/exceptions.py,sha256=Xir2lYIH7QYHfjDQu8WJ9qIhCvP-mYcPWYN2LbbbDj8,640
|
4
|
+
passphera_core/interfaces.py,sha256=8_V_08Q2_u56qVIkOOBkkFfyYKqP0aj7IpdMgoQbydI,891
|
5
|
+
passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
passphera_core/application/generator.py,sha256=Ki96CqrBFOvvX79Zh-FRQtiP9BMpTG_sskzyI7slbqo,2331
|
7
|
+
passphera_core/application/password.py,sha256=YPnNTgBHclvsq88ZfbJMn5VHol8YizCYE-9Mv3MwTlU,3539
|
8
|
+
passphera_core-0.13.0.dist-info/METADATA,sha256=IlPA2uX1eZ4pDrxGFcseGj8Z0xymkgARRKs09GBxxJI,868
|
9
|
+
passphera_core-0.13.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
+
passphera_core-0.13.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
|
11
|
+
passphera_core-0.13.0.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
passphera_core/entities.py,sha256=OvVU6HzWF0GWElq_VFU-GUyittaOf5x8yMHYlAjemsE,4326
|
3
|
-
passphera_core/exceptions.py,sha256=Xir2lYIH7QYHfjDQu8WJ9qIhCvP-mYcPWYN2LbbbDj8,640
|
4
|
-
passphera_core/interfaces.py,sha256=HF4g115Rz1sp9-cRDpdOqkZ1ixhrNg1WI2UNftuEykI,911
|
5
|
-
passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
passphera_core/application/generator.py,sha256=ljbPw3nRy6KOsF0B_zkILJqx2uMcSgT66YKJBHxvDwo,2491
|
7
|
-
passphera_core/application/password.py,sha256=Y_XnoTGS6QHeIPHDCvfj8cscaMyDkflYexE8dkLVUW0,3496
|
8
|
-
passphera_core-0.12.0.dist-info/METADATA,sha256=8vRsv-NFcSVhlPn24GgTTpfOY4mod_DgLJIPEOTmxj4,868
|
9
|
-
passphera_core-0.12.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
-
passphera_core-0.12.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
|
11
|
-
passphera_core-0.12.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|