winipedia-utils 0.1.38__py3-none-any.whl → 0.1.39__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.
- winipedia_utils/security/keyring.py +9 -6
- {winipedia_utils-0.1.38.dist-info → winipedia_utils-0.1.39.dist-info}/METADATA +1 -1
- {winipedia_utils-0.1.38.dist-info → winipedia_utils-0.1.39.dist-info}/RECORD +5 -5
- {winipedia_utils-0.1.38.dist-info → winipedia_utils-0.1.39.dist-info}/LICENSE +0 -0
- {winipedia_utils-0.1.38.dist-info → winipedia_utils-0.1.39.dist-info}/WHEEL +0 -0
@@ -5,6 +5,7 @@ including getting and creating secrets and fernets.
|
|
5
5
|
These utilities help with secure storage and retrieval of secrets.
|
6
6
|
"""
|
7
7
|
|
8
|
+
from base64 import b64decode, b64encode
|
8
9
|
from collections.abc import Callable
|
9
10
|
|
10
11
|
import keyring
|
@@ -43,9 +44,11 @@ def get_or_create_key[T](
|
|
43
44
|
If it does not exist, create it with the generate_func.
|
44
45
|
"""
|
45
46
|
service_name = f"{service_name}_{key_class.__name__}"
|
46
|
-
|
47
|
-
if
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
key = keyring.get_password(service_name, username)
|
48
|
+
if key is None:
|
49
|
+
binary_key = generate_key_func()
|
50
|
+
key = b64encode(binary_key).decode("ascii")
|
51
|
+
keyring.set_password(service_name, username, key)
|
52
|
+
|
53
|
+
binary_key = b64decode(key)
|
54
|
+
return key_class(binary_key)
|
@@ -69,7 +69,7 @@ winipedia_utils/resources/svgs/play_icon.svg,sha256=U0RQ-S_WbcyyjeWC55BkcOtG64Gf
|
|
69
69
|
winipedia_utils/resources/svgs/svg.py,sha256=-Dw6m7cm9CHT2076oZIMx7kTQw0v_ifJajXzWcpUtI0,430
|
70
70
|
winipedia_utils/security/__init__.py,sha256=ZBa72J6MNtYumBFMoVc0ia4jsoS7oNgjaTCW0xDb6EI,53
|
71
71
|
winipedia_utils/security/cryptography.py,sha256=zfxSDo7aE9ecmZNC6URMSEUYRpOuJ1iESg-WCSS5HP0,822
|
72
|
-
winipedia_utils/security/keyring.py,sha256=
|
72
|
+
winipedia_utils/security/keyring.py,sha256=35bCXBmsFWyd7Ja2w9zHElayABeRZEaNXoEDDRb8ItQ,1698
|
73
73
|
winipedia_utils/setup.py,sha256=F4NneO0wVTf7JCXLorWjTOdJl36N5fLSksoWMe4p86o,1650
|
74
74
|
winipedia_utils/testing/__init__.py,sha256=kXhB5xw02ec5xpcW_KV--9CBKdyCjnuR-NZzAJ5tq0g,51
|
75
75
|
winipedia_utils/testing/assertions.py,sha256=0JF4mqVTnLQ1qkAL_FuTwyN_idr00rvVlta7aDdnUXA,851
|
@@ -91,7 +91,7 @@ winipedia_utils/testing/tests/base/utils/utils.py,sha256=dUPDrgAxlfREQb33zz23Mfz
|
|
91
91
|
winipedia_utils/testing/tests/conftest.py,sha256=8RounBlI8Jq1aLaLNpv84MW4ne8Qq0aavQextDOp5ng,920
|
92
92
|
winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
|
93
93
|
winipedia_utils/text/string.py,sha256=1jbBftlgxffGgSlPnQh3aRPIr8XekEwpSenjFCW6JyM,3478
|
94
|
-
winipedia_utils-0.1.
|
95
|
-
winipedia_utils-0.1.
|
96
|
-
winipedia_utils-0.1.
|
97
|
-
winipedia_utils-0.1.
|
94
|
+
winipedia_utils-0.1.39.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
|
95
|
+
winipedia_utils-0.1.39.dist-info/METADATA,sha256=PEZW6MkX2O4ZuDOXmfWUuhYLriJJQjGbOqKmvL8hOS4,12576
|
96
|
+
winipedia_utils-0.1.39.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
97
|
+
winipedia_utils-0.1.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|