passphera-core 0.25.2__tar.gz → 0.27.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.25.2 → passphera_core-0.27.0}/PKG-INFO +1 -1
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/entities.py +36 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/interfaces.py +2 -1
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/PKG-INFO +1 -1
- {passphera_core-0.25.2 → passphera_core-0.27.0}/setup.py +1 -1
- {passphera_core-0.25.2 → passphera_core-0.27.0}/README.md +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/__init__.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/application/__init__.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/application/generator.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/application/password.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/exceptions.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core/utilities.py +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/SOURCES.txt +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/dependency_links.txt +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/requires.txt +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/top_level.txt +0 -0
- {passphera_core-0.25.2 → passphera_core-0.27.0}/setup.cfg +0 -0
@@ -61,6 +61,23 @@ class Password:
|
|
61
61
|
key = derive_key(self.password, self.salt)
|
62
62
|
return Fernet(key).decrypt(self.password.encode()).decode()
|
63
63
|
|
64
|
+
def to_dict(self) -> dict:
|
65
|
+
"""Convert the Password entity to a dictionary."""
|
66
|
+
return {
|
67
|
+
"id": self.id,
|
68
|
+
"created_at": self.created_at,
|
69
|
+
"updated_at": self.updated_at,
|
70
|
+
"context": self.context,
|
71
|
+
"text": self.text,
|
72
|
+
"password": self.password,
|
73
|
+
"salt": self.salt,
|
74
|
+
}
|
75
|
+
|
76
|
+
def from_dict(self, data: dict) -> None:
|
77
|
+
"""Convert a dictionary to a Password entity."""
|
78
|
+
for key, value in data.items():
|
79
|
+
setattr(self, key, value)
|
80
|
+
|
64
81
|
|
65
82
|
@dataclass
|
66
83
|
class Generator:
|
@@ -177,3 +194,22 @@ class Generator:
|
|
177
194
|
password: str = main_algorithm.encrypt(intermediate)
|
178
195
|
password = password.translate(str.maketrans(self.characters_replacements))
|
179
196
|
return ''.join(c.upper() if c in text else c for c in password)
|
197
|
+
|
198
|
+
def to_dict(self) -> dict:
|
199
|
+
"""Convert the Generator entity to a dictionary."""
|
200
|
+
return {
|
201
|
+
"id": self.id,
|
202
|
+
"created_at": self.created_at,
|
203
|
+
"updated_at": self.updated_at,
|
204
|
+
"shift": self.shift,
|
205
|
+
"multiplier": self.multiplier,
|
206
|
+
"key": self.key,
|
207
|
+
"algorithm": self.algorithm,
|
208
|
+
"prefix": self.prefix,
|
209
|
+
"postfix": self.postfix,
|
210
|
+
}
|
211
|
+
|
212
|
+
def from_dict(self, data: dict) -> None:
|
213
|
+
"""Convert a dictionary to a Generator entity."""
|
214
|
+
for key, value in data.items():
|
215
|
+
setattr(self, key, value)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
+
from uuid import UUID
|
2
3
|
|
3
4
|
from passphera_core.entities import Password, Generator
|
4
5
|
|
@@ -35,7 +36,7 @@ class GeneratorRepository(ABC):
|
|
35
36
|
pass
|
36
37
|
|
37
38
|
@abstractmethod
|
38
|
-
def get(self) -> Generator:
|
39
|
+
def get(self, id: UUID) -> Generator:
|
39
40
|
pass
|
40
41
|
|
41
42
|
@abstractmethod
|
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.25.2 → passphera_core-0.27.0}/passphera_core.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|