OpenOrchestrator 1.1.0__py3-none-any.whl → 1.3.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.
- OpenOrchestrator/common/crypto_util.py +21 -9
- OpenOrchestrator/common/datetime_util.py +1 -1
- OpenOrchestrator/database/db_util.py +167 -131
- OpenOrchestrator/database/queues.py +1 -0
- OpenOrchestrator/database/triggers.py +1 -0
- OpenOrchestrator/database/truncated_string.py +18 -0
- OpenOrchestrator/orchestrator/application.py +18 -1
- OpenOrchestrator/orchestrator/datetime_input.py +16 -2
- OpenOrchestrator/orchestrator/popups/constant_popup.py +8 -7
- OpenOrchestrator/orchestrator/popups/credential_popup.py +8 -7
- OpenOrchestrator/orchestrator/popups/trigger_popup.py +27 -15
- OpenOrchestrator/orchestrator/tabs/constants_tab.py +1 -1
- OpenOrchestrator/orchestrator/tabs/logging_tab.py +4 -3
- OpenOrchestrator/orchestrator/tabs/queue_tab.py +19 -11
- OpenOrchestrator/orchestrator/tabs/settings_tab.py +2 -2
- OpenOrchestrator/orchestrator/tabs/trigger_tab.py +4 -7
- OpenOrchestrator/orchestrator_connection/connection.py +11 -9
- OpenOrchestrator/scheduler/application.py +1 -1
- OpenOrchestrator/scheduler/connection_frame.py +1 -1
- OpenOrchestrator/scheduler/run_tab.py +85 -87
- OpenOrchestrator/scheduler/runner.py +34 -23
- {OpenOrchestrator-1.1.0.dist-info → OpenOrchestrator-1.3.0.dist-info}/METADATA +1 -1
- OpenOrchestrator-1.3.0.dist-info/RECORD +39 -0
- {OpenOrchestrator-1.1.0.dist-info → OpenOrchestrator-1.3.0.dist-info}/WHEEL +1 -1
- OpenOrchestrator-1.1.0.dist-info/RECORD +0 -38
- {OpenOrchestrator-1.1.0.dist-info → OpenOrchestrator-1.3.0.dist-info}/LICENSE +0 -0
- {OpenOrchestrator-1.1.0.dist-info → OpenOrchestrator-1.3.0.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@ from cryptography.fernet import Fernet
|
|
4
4
|
from cryptography.exceptions import InvalidSignature
|
5
5
|
|
6
6
|
|
7
|
-
_encryption_key: str = None
|
7
|
+
_encryption_key: str | None = None
|
8
8
|
|
9
9
|
|
10
10
|
def generate_key() -> bytes:
|
@@ -16,7 +16,7 @@ def generate_key() -> bytes:
|
|
16
16
|
return Fernet.generate_key()
|
17
17
|
|
18
18
|
|
19
|
-
def set_key(key: str) -> None:
|
19
|
+
def set_key(key: str | None) -> None:
|
20
20
|
"""Set the crypto key for the module.
|
21
21
|
The key will be used in all subsequent calls to this module.
|
22
22
|
"""
|
@@ -24,7 +24,7 @@ def set_key(key: str) -> None:
|
|
24
24
|
_encryption_key = key
|
25
25
|
|
26
26
|
|
27
|
-
def get_key() -> str:
|
27
|
+
def get_key() -> str | None:
|
28
28
|
"""Get the encryption key last set using
|
29
29
|
crypto_util.set_key.
|
30
30
|
|
@@ -43,10 +43,16 @@ def encrypt_string(data: str) -> str:
|
|
43
43
|
|
44
44
|
Returns:
|
45
45
|
str: The encrypted string.
|
46
|
+
|
47
|
+
Raises:
|
48
|
+
RuntimeError: If the encryption key has not been set.
|
46
49
|
"""
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
+
if not _encryption_key:
|
51
|
+
raise RuntimeError("Can't encrypt without an encryption key.")
|
52
|
+
|
53
|
+
byte_data = data.encode()
|
54
|
+
byte_data = Fernet(_encryption_key).encrypt(byte_data)
|
55
|
+
return byte_data.decode()
|
50
56
|
|
51
57
|
|
52
58
|
def decrypt_string(data: str) -> str:
|
@@ -61,14 +67,20 @@ def decrypt_string(data: str) -> str:
|
|
61
67
|
|
62
68
|
Returns:
|
63
69
|
str: The decrypted string.
|
70
|
+
|
71
|
+
Raises:
|
72
|
+
RuntimeError: If the encryption key has not been set.
|
64
73
|
"""
|
74
|
+
if not _encryption_key:
|
75
|
+
raise RuntimeError("Can't decrypt without an encryption key.")
|
76
|
+
|
65
77
|
try:
|
66
|
-
|
67
|
-
|
78
|
+
byte_data = data.encode()
|
79
|
+
byte_data = Fernet(_encryption_key).decrypt(byte_data)
|
68
80
|
except InvalidSignature as exc:
|
69
81
|
raise ValueError("Couldn't verify signature. The decryption key is not the same as the encryption key.") from exc
|
70
82
|
|
71
|
-
return
|
83
|
+
return byte_data.decode()
|
72
84
|
|
73
85
|
|
74
86
|
def validate_key(key: str) -> bool:
|