passphera-core 0.23.0__py3-none-any.whl → 0.24.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/entities.py +4 -3
- passphera_core/exceptions.py +6 -0
- {passphera_core-0.23.0.dist-info → passphera_core-0.24.0.dist-info}/METADATA +1 -1
- {passphera_core-0.23.0.dist-info → passphera_core-0.24.0.dist-info}/RECORD +6 -6
- {passphera_core-0.23.0.dist-info → passphera_core-0.24.0.dist-info}/WHEEL +0 -0
- {passphera_core-0.23.0.dist-info → passphera_core-0.24.0.dist-info}/top_level.txt +0 -0
passphera_core/entities.py
CHANGED
@@ -8,6 +8,8 @@ from cipherspy.cipher import *
|
|
8
8
|
from cipherspy.exceptions import InvalidAlgorithmException
|
9
9
|
from cipherspy.utilities import generate_salt, derive_key
|
10
10
|
|
11
|
+
from passphera_core.exceptions import InvalidPropertyNameException
|
12
|
+
|
11
13
|
|
12
14
|
@dataclass
|
13
15
|
class Password:
|
@@ -112,7 +114,7 @@ class Generator:
|
|
112
114
|
:return: None
|
113
115
|
"""
|
114
116
|
if prop not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
|
115
|
-
raise
|
117
|
+
raise InvalidPropertyNameException(prop)
|
116
118
|
if prop in ["shift", "multiplier"]:
|
117
119
|
value = int(value)
|
118
120
|
setattr(self, prop, value)
|
@@ -128,8 +130,7 @@ class Generator:
|
|
128
130
|
:return: None
|
129
131
|
"""
|
130
132
|
if prop not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
|
131
|
-
raise
|
132
|
-
|
133
|
+
raise InvalidPropertyNameException(prop)
|
133
134
|
setattr(self, prop, self._default_properties[prop])
|
134
135
|
if prop == "algorithm":
|
135
136
|
self.get_algorithm()
|
passphera_core/exceptions.py
CHANGED
@@ -17,3 +17,9 @@ class DuplicatePasswordException(Exception):
|
|
17
17
|
if hasattr(password, 'context') and password.context:
|
18
18
|
return f"Password for context '{password.context}' already exists"
|
19
19
|
return "Duplicate password detected"
|
20
|
+
|
21
|
+
|
22
|
+
class InvalidPropertyNameException(Exception):
|
23
|
+
def __init__(self, property_name: str) -> None:
|
24
|
+
self.property_name = property_name
|
25
|
+
super().__init__(f"Invalid property name '{property_name}'")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
passphera_core/entities.py,sha256=
|
3
|
-
passphera_core/exceptions.py,sha256=
|
2
|
+
passphera_core/entities.py,sha256=cewoafnMYp-ezjuvwhki0wCHJQyK2NKJ7JnQ8xKrVVE,7279
|
3
|
+
passphera_core/exceptions.py,sha256=T3H6-R-h8BaiRXbeIr2Ak1PlVvzsn8sxbpu8BwLFGD8,853
|
4
4
|
passphera_core/interfaces.py,sha256=DpHFh_vnamORf69P1dwLrZ8AYZPcYIol0Lq_VKRBkXc,855
|
5
5
|
passphera_core/utilities.py,sha256=n7cAVox-yGd60595RjLvrGKSGqFQRm279YqKS3-R1X0,748
|
6
6
|
passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
passphera_core/application/generator.py,sha256=WnMuv-zBPa6d_eCOKtbtsDl1CmZ_YcnXqH5bpVIXhgs,2452
|
8
8
|
passphera_core/application/password.py,sha256=9wsSz3uMWEZCgfnX5V7WYiWp2OqjSmsn6OSWK4HIIfo,2876
|
9
|
-
passphera_core-0.
|
10
|
-
passphera_core-0.
|
11
|
-
passphera_core-0.
|
12
|
-
passphera_core-0.
|
9
|
+
passphera_core-0.24.0.dist-info/METADATA,sha256=2NneeeOO99q-4JKoT6d9MqAy7jelscfPhrPkv4nDWr4,868
|
10
|
+
passphera_core-0.24.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
passphera_core-0.24.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
|
12
|
+
passphera_core-0.24.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|