passphera-core 0.12.1__py3-none-any.whl → 0.13.1__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.
@@ -1,5 +1,4 @@
1
1
  from datetime import datetime, timezone
2
- from uuid import UUID
3
2
 
4
3
  from passphera_core.entities import Generator
5
4
  from passphera_core.interfaces import GeneratorRepository
@@ -9,16 +8,16 @@ class GetGeneratorUseCase:
9
8
  def __init__(self, generator_repository: GeneratorRepository):
10
9
  self.generator_repository: GeneratorRepository = generator_repository
11
10
 
12
- def execute(self, generator_id: UUID) -> Generator:
13
- return self.generator_repository.get(generator_id)
11
+ def execute(self) -> Generator:
12
+ return self.generator_repository.get()
14
13
 
15
14
 
16
15
  class GetGeneratorPropertyUseCase:
17
16
  def __init__(self, generator_repository: GeneratorRepository):
18
17
  self.generator_repository: GeneratorRepository = generator_repository
19
18
 
20
- def execute(self, generator_id: UUID, field: str) -> str:
21
- generator_entity: Generator = self.generator_repository.get(generator_id)
19
+ def execute(self, field: str) -> str:
20
+ generator_entity: Generator = self.generator_repository.get()
22
21
  return getattr(generator_entity, field)
23
22
 
24
23
 
@@ -26,8 +25,8 @@ class UpdateGeneratorPropertyUseCase:
26
25
  def __init__(self, generator_repository: GeneratorRepository):
27
26
  self.generator_repository: GeneratorRepository = generator_repository
28
27
 
29
- def execute(self, generator_id: UUID, field: str, value: str) -> None:
30
- generator_entity: Generator = self.generator_repository.get(generator_id)
28
+ def execute(self, field: str, value: str) -> None:
29
+ generator_entity: Generator = self.generator_repository.get()
31
30
  setattr(generator_entity, field, value)
32
31
  if field == 'algorithm':
33
32
  generator_entity.get_algorithm()
@@ -39,8 +38,8 @@ class AddCharacterReplacementUseCase:
39
38
  def __init__(self, generator_repository: GeneratorRepository):
40
39
  self.generator_repository: GeneratorRepository = generator_repository
41
40
 
42
- def execute(self, generator_id: UUID, character: str, replacement: str) -> None:
43
- generator_entity: Generator = self.generator_repository.get(generator_id)
41
+ def execute(self, character: str, replacement: str) -> None:
42
+ generator_entity: Generator = self.generator_repository.get()
44
43
  generator_entity.replace_character(character, replacement)
45
44
  generator_entity.updated_at = datetime.now(timezone.utc)
46
45
  self.generator_repository.update(generator_entity)
@@ -50,8 +49,8 @@ class ResetCharacterReplacementUseCase:
50
49
  def __init__(self, generator_repository: GeneratorRepository,):
51
50
  self.generator_repository: GeneratorRepository = generator_repository
52
51
 
53
- def execute(self, generator_id: UUID, character: str) -> None:
54
- generator_entity: Generator = self.generator_repository.get(generator_id)
52
+ def execute(self, character: str) -> None:
53
+ generator_entity: Generator = self.generator_repository.get()
55
54
  generator_entity.reset_character(character)
56
55
  generator_entity.updated_at = datetime.now(timezone.utc)
57
56
  self.generator_repository.update(generator_entity)
@@ -36,7 +36,7 @@ class GeneratorRepository(ABC):
36
36
  pass
37
37
 
38
38
  @abstractmethod
39
- def get(self, generator_id: UUID) -> Generator:
39
+ def get(self) -> Generator:
40
40
  pass
41
41
 
42
42
  @abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: passphera-core
3
- Version: 0.12.1
3
+ Version: 0.13.1
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -1,11 +1,11 @@
1
1
  passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  passphera_core/entities.py,sha256=OvVU6HzWF0GWElq_VFU-GUyittaOf5x8yMHYlAjemsE,4326
3
3
  passphera_core/exceptions.py,sha256=Xir2lYIH7QYHfjDQu8WJ9qIhCvP-mYcPWYN2LbbbDj8,640
4
- passphera_core/interfaces.py,sha256=HF4g115Rz1sp9-cRDpdOqkZ1ixhrNg1WI2UNftuEykI,911
4
+ passphera_core/interfaces.py,sha256=8_V_08Q2_u56qVIkOOBkkFfyYKqP0aj7IpdMgoQbydI,891
5
5
  passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- passphera_core/application/generator.py,sha256=ljbPw3nRy6KOsF0B_zkILJqx2uMcSgT66YKJBHxvDwo,2491
6
+ passphera_core/application/generator.py,sha256=8VELQch3pl0vP7g2GmSzxEgcjDuuGEZ82jB5Ry_MfL4,2309
7
7
  passphera_core/application/password.py,sha256=YPnNTgBHclvsq88ZfbJMn5VHol8YizCYE-9Mv3MwTlU,3539
8
- passphera_core-0.12.1.dist-info/METADATA,sha256=jxLK_bFVJjp0bEFAYKAqbga6AL9zBRLU3MBIIODAsBw,868
9
- passphera_core-0.12.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
- passphera_core-0.12.1.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
11
- passphera_core-0.12.1.dist-info/RECORD,,
8
+ passphera_core-0.13.1.dist-info/METADATA,sha256=7aDIL4Y3jV-rF51-9xiFkVBUb0UKfjJ34Mke_h6GSkQ,868
9
+ passphera_core-0.13.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
+ passphera_core-0.13.1.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
11
+ passphera_core-0.13.1.dist-info/RECORD,,