passphera-core 0.15.0__py3-none-any.whl → 0.17.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 +3 -6
- passphera_core/application/password.py +4 -5
- passphera_core/entities.py +1 -9
- {passphera_core-0.15.0.dist-info → passphera_core-0.17.0.dist-info}/METADATA +2 -2
- passphera_core-0.17.0.dist-info/RECORD +12 -0
- {passphera_core-0.15.0.dist-info → passphera_core-0.17.0.dist-info}/WHEEL +1 -1
- passphera_core-0.15.0.dist-info/RECORD +0 -12
- {passphera_core-0.15.0.dist-info → passphera_core-0.17.0.dist-info}/top_level.txt +0 -0
|
@@ -25,35 +25,32 @@ class UpdateGeneratorPropertyUseCase:
|
|
|
25
25
|
def __init__(self, generator_repository: GeneratorRepository):
|
|
26
26
|
self.generator_repository: GeneratorRepository = generator_repository
|
|
27
27
|
|
|
28
|
-
def execute(self, field: str, value: str) ->
|
|
28
|
+
def execute(self, field: str, value: str) -> None:
|
|
29
29
|
generator_entity: Generator = self.generator_repository.get()
|
|
30
30
|
setattr(generator_entity, field, value)
|
|
31
31
|
if field == 'algorithm':
|
|
32
32
|
generator_entity.get_algorithm()
|
|
33
33
|
generator_entity.updated_at = datetime.now(timezone.utc)
|
|
34
34
|
self.generator_repository.update(generator_entity)
|
|
35
|
-
return generator_entity
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
class AddCharacterReplacementUseCase:
|
|
39
38
|
def __init__(self, generator_repository: GeneratorRepository):
|
|
40
39
|
self.generator_repository: GeneratorRepository = generator_repository
|
|
41
40
|
|
|
42
|
-
def execute(self, character: str, replacement: str) ->
|
|
41
|
+
def execute(self, character: str, replacement: str) -> None:
|
|
43
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)
|
|
47
|
-
return generator_entity
|
|
48
46
|
|
|
49
47
|
|
|
50
48
|
class ResetCharacterReplacementUseCase:
|
|
51
49
|
def __init__(self, generator_repository: GeneratorRepository,):
|
|
52
50
|
self.generator_repository: GeneratorRepository = generator_repository
|
|
53
51
|
|
|
54
|
-
def execute(self, character: str) ->
|
|
52
|
+
def execute(self, character: str) -> None:
|
|
55
53
|
generator_entity: Generator = self.generator_repository.get()
|
|
56
54
|
generator_entity.reset_character(character)
|
|
57
55
|
generator_entity.updated_at = datetime.now(timezone.utc)
|
|
58
56
|
self.generator_repository.update(generator_entity)
|
|
59
|
-
return generator_entity
|
|
@@ -27,7 +27,7 @@ class GeneratePasswordUseCase:
|
|
|
27
27
|
return password_entity
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
class
|
|
30
|
+
class GetPasswordUseCase:
|
|
31
31
|
def __init__(self, password_repository: PasswordRepository):
|
|
32
32
|
self.password_repository: PasswordRepository = password_repository
|
|
33
33
|
|
|
@@ -44,7 +44,7 @@ class UpdatePasswordUseCase:
|
|
|
44
44
|
self.password_repository: PasswordRepository = password_repository
|
|
45
45
|
self.generator_repository: GeneratorRepository = generator_repository
|
|
46
46
|
|
|
47
|
-
def execute(self, context: str, text: str) ->
|
|
47
|
+
def execute(self, context: str, text: str) -> None:
|
|
48
48
|
password_entity: Password = get_password(self.password_repository, context)
|
|
49
49
|
generator_entity: Generator = self.generator_repository.get()
|
|
50
50
|
password: str = generator_entity.generate_password(text)
|
|
@@ -53,7 +53,6 @@ class UpdatePasswordUseCase:
|
|
|
53
53
|
password_entity.updated_at = datetime.now(timezone.utc)
|
|
54
54
|
password_entity.encrypt()
|
|
55
55
|
self.password_repository.update(password_entity)
|
|
56
|
-
return password_entity
|
|
57
56
|
|
|
58
57
|
|
|
59
58
|
class DeletePasswordUseCase:
|
|
@@ -64,7 +63,7 @@ class DeletePasswordUseCase:
|
|
|
64
63
|
self.password_repository.delete(get_password(self.password_repository, context))
|
|
65
64
|
|
|
66
65
|
|
|
67
|
-
class
|
|
66
|
+
class ListPasswordsUseCase:
|
|
68
67
|
def __init__(self, password_repository: PasswordRepository):
|
|
69
68
|
self.password_repository: PasswordRepository = password_repository
|
|
70
69
|
|
|
@@ -72,7 +71,7 @@ class GetAllPasswordsUseCase:
|
|
|
72
71
|
return self.password_repository.list()
|
|
73
72
|
|
|
74
73
|
|
|
75
|
-
class
|
|
74
|
+
class FlushPasswordsUseCase:
|
|
76
75
|
def __init__(self, password_repository: PasswordRepository):
|
|
77
76
|
self.password_repository: PasswordRepository = password_repository
|
|
78
77
|
|
passphera_core/entities.py
CHANGED
|
@@ -75,14 +75,6 @@ class Generator:
|
|
|
75
75
|
"""
|
|
76
76
|
self.characters_replacements.pop(char, None)
|
|
77
77
|
|
|
78
|
-
def apply_replacements(self, password: str) -> str:
|
|
79
|
-
"""
|
|
80
|
-
Replace character from the ciphered password with character replacements from the generator configurations
|
|
81
|
-
:param password: The password to perform the action on it
|
|
82
|
-
:return: str: The new ciphered password after character replacements
|
|
83
|
-
"""
|
|
84
|
-
return password.translate(str.maketrans(self.characters_replacements))
|
|
85
|
-
|
|
86
78
|
def generate_password(self, text: str) -> str:
|
|
87
79
|
"""
|
|
88
80
|
Generate a strong password string using the raw password (add another layer of encryption to it)
|
|
@@ -93,5 +85,5 @@ class Generator:
|
|
|
93
85
|
secondary_algorithm: AffineCipherAlgorithm = AffineCipherAlgorithm(self.shift, self.multiplier)
|
|
94
86
|
intermediate: str = secondary_algorithm.encrypt(f"{self.prefix}{text}{self.postfix}")
|
|
95
87
|
password: str = main_algorithm.encrypt(intermediate)
|
|
96
|
-
password = self.
|
|
88
|
+
password = password.translate(str.maketrans(self.characters_replacements))
|
|
97
89
|
return ''.join(c.upper() if c in text else c for c in password)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
passphera_core/entities.py,sha256=eQTPjskD4oHd4RTjXIJcaGrASVBKZA35uLYZebgc8_c,3791
|
|
3
|
+
passphera_core/exceptions.py,sha256=Xir2lYIH7QYHfjDQu8WJ9qIhCvP-mYcPWYN2LbbbDj8,640
|
|
4
|
+
passphera_core/interfaces.py,sha256=zk-9X28Vful3bdZO5q4crsl06AFmI6N9cdGu0UfuEws,869
|
|
5
|
+
passphera_core/utilities.py,sha256=N-JNJ7hfJnOV4XP06t2f1zEkIoThNLl5nrcvoB3mlmg,439
|
|
6
|
+
passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
passphera_core/application/generator.py,sha256=8VELQch3pl0vP7g2GmSzxEgcjDuuGEZ82jB5Ry_MfL4,2309
|
|
8
|
+
passphera_core/application/password.py,sha256=bwUVaqtJ3VDiONkNq_UiEsjYLIJ4DglQFmS37irB0DM,3146
|
|
9
|
+
passphera_core-0.17.0.dist-info/METADATA,sha256=uU-saul_rAKK0PMcLkcqXuhIDsuhNkCH6N-v5w_ySQU,868
|
|
10
|
+
passphera_core-0.17.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
passphera_core-0.17.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
|
|
12
|
+
passphera_core-0.17.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
passphera_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
passphera_core/entities.py,sha256=g1elnWnNQufnQn9hY6vtAovKWQnfjlJ0tmwCDTWcayc,4179
|
|
3
|
-
passphera_core/exceptions.py,sha256=Xir2lYIH7QYHfjDQu8WJ9qIhCvP-mYcPWYN2LbbbDj8,640
|
|
4
|
-
passphera_core/interfaces.py,sha256=zk-9X28Vful3bdZO5q4crsl06AFmI6N9cdGu0UfuEws,869
|
|
5
|
-
passphera_core/utilities.py,sha256=N-JNJ7hfJnOV4XP06t2f1zEkIoThNLl5nrcvoB3mlmg,439
|
|
6
|
-
passphera_core/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
passphera_core/application/generator.py,sha256=UKsukvpItbq2Vn3XZSZf8Iwr1WPmDFYP7i14R_Hp9pU,2420
|
|
8
|
-
passphera_core/application/password.py,sha256=uwYo1PBIIC0pDRNYjU33Iccr0jqXxfhSZKxP5NQZqjg,3196
|
|
9
|
-
passphera_core-0.15.0.dist-info/METADATA,sha256=BsJjUaestF2SbgegeXdQVQ5m_JBXqP3XSHr_0tkDIPE,868
|
|
10
|
-
passphera_core-0.15.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
11
|
-
passphera_core-0.15.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
|
|
12
|
-
passphera_core-0.15.0.dist-info/RECORD,,
|
|
File without changes
|