passphera-core 0.9.1__tar.gz → 0.10.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: passphera-core
3
- Version: 0.9.1
3
+ Version: 0.10.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -15,6 +15,15 @@ Classifier: Topic :: Security :: Cryptography
15
15
  Requires-Python: >=3
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: cipherspy
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
18
27
 
19
28
  # passphera-core
20
29
 
@@ -18,7 +18,7 @@ class RegisterUserUseCase:
18
18
  user_entity: User = User(**user.__dict__)
19
19
  generator_entity: Generator = Generator(user_id=user_entity.id)
20
20
  self.generator_repository.save(generator_entity)
21
- user_entity.generator = generator_entity.id
21
+ user_entity.generator_id = generator_entity.id
22
22
  self.user_repository.save(user_entity)
23
23
  return user_entity
24
24
 
@@ -84,7 +84,11 @@ class Generator:
84
84
  user_id: UUID = field(default_factory=uuid4)
85
85
  created_at: datetime = field(default_factory=datetime.now)
86
86
  updated_at: datetime = field(default_factory=datetime.now)
87
+ config_id: UUID = field(default_factory=UUID)
87
88
  config: GeneratorConfig = field(default_factory=GeneratorConfig)
89
+
90
+ def __post_init__(self):
91
+ self.config = GeneratorConfig(generator_id=self.id)
88
92
 
89
93
  def apply_replacements(self, password: str) -> str:
90
94
  """
@@ -115,11 +119,11 @@ class User:
115
119
  username: str = field(default_factory=str)
116
120
  email: str = field(default_factory=str)
117
121
  password: str = field(default_factory=str)
118
- generator: UUID = field(default_factory=UUID)
119
- passwords: list[UUID] = field(default_factory=list[UUID])
122
+ generator_id: UUID = field(default_factory=UUID)
123
+ passwords_ids: list[UUID] = field(default_factory=list[UUID])
120
124
 
121
125
  def add_password(self, password_id: UUID) -> None:
122
- self.passwords.append(password_id)
126
+ self.passwords_ids.append(password_id)
123
127
 
124
128
  def delete_password(self, password_id: UUID) -> None:
125
- self.passwords.remove(password_id)
129
+ self.passwords_ids.remove(password_id)
@@ -31,10 +31,6 @@ class GeneratorRepository(ABC):
31
31
  def update(self, generator: Generator) -> None:
32
32
  pass
33
33
 
34
- @abstractmethod
35
- def delete(self, generator_id: UUID) -> None:
36
- pass
37
-
38
34
  @abstractmethod
39
35
  def find_by_id(self, generator_id: UUID) -> Generator:
40
36
  pass
@@ -53,10 +49,6 @@ class GeneratorConfigRepository(ABC):
53
49
  def update(self, generator_config: GeneratorConfig) -> None:
54
50
  pass
55
51
 
56
- @abstractmethod
57
- def delete(self, generator_config_id: UUID) -> None:
58
- pass
59
-
60
52
  @abstractmethod
61
53
  def find_by_id(self, generator_config_id: UUID) -> GeneratorConfig:
62
54
  pass
@@ -75,10 +67,6 @@ class UserRepository(ABC):
75
67
  def update(self, user: User) -> None:
76
68
  pass
77
69
 
78
- @abstractmethod
79
- def delete(self, user_id: UUID) -> None:
80
- pass
81
-
82
70
  @abstractmethod
83
71
  def find_by_id(self, user_id: UUID) -> User:
84
72
  pass
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: passphera-core
3
- Version: 0.9.1
3
+ Version: 0.10.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -15,6 +15,15 @@ Classifier: Topic :: Security :: Cryptography
15
15
  Requires-Python: >=3
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: cipherspy
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
18
27
 
19
28
  # passphera-core
20
29
 
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name='passphera-core',
8
- version='0.9.1',
8
+ version='0.10.0',
9
9
  author='Fathi Abdelmalek',
10
10
  author_email='abdelmalek.fathi.2001@gmail.com',
11
11
  url='https://github.com/passphera/core',