pypomes-jwt 1.3.2__py3-none-any.whl → 1.3.3__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.
Potentially problematic release.
This version of pypomes-jwt might be problematic. Click here for more details.
- pypomes_jwt/jwt_config.py +13 -13
- {pypomes_jwt-1.3.2.dist-info → pypomes_jwt-1.3.3.dist-info}/METADATA +1 -1
- {pypomes_jwt-1.3.2.dist-info → pypomes_jwt-1.3.3.dist-info}/RECORD +5 -5
- {pypomes_jwt-1.3.2.dist-info → pypomes_jwt-1.3.3.dist-info}/WHEEL +0 -0
- {pypomes_jwt-1.3.2.dist-info → pypomes_jwt-1.3.3.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_config.py
CHANGED
|
@@ -21,8 +21,9 @@ class JwtAlgorithm(StrEnum):
|
|
|
21
21
|
|
|
22
22
|
# recommended: allow the encode and decode keys to be generated anew when app starts
|
|
23
23
|
_encoding_key: bytes = env_get_bytes(key=f"{APP_PREFIX}_JWT_ENCODING_KEY",
|
|
24
|
-
encoding="
|
|
25
|
-
_decoding_key: bytes
|
|
24
|
+
encoding="base64")
|
|
25
|
+
_decoding_key: bytes = env_get_bytes(key=f"{APP_PREFIX}_JWT_DECODING_KEY")
|
|
26
|
+
# default algorithm may cause encode and decode keys to be overriden
|
|
26
27
|
_default_algorithm: JwtAlgorithm = env_get_enum(key=f"{APP_PREFIX}_JWT_DEFAULT_ALGORITHM",
|
|
27
28
|
enum_class=JwtAlgorithm,
|
|
28
29
|
def_value=JwtAlgorithm.RS256)
|
|
@@ -30,17 +31,16 @@ if _default_algorithm in [JwtAlgorithm.HS256, JwtAlgorithm.HS512]:
|
|
|
30
31
|
if not _encoding_key:
|
|
31
32
|
_encoding_key = token_bytes(nbytes=32)
|
|
32
33
|
_decoding_key = _encoding_key
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
format=serialization.PublicFormat.SubjectPublicKeyInfo)
|
|
34
|
+
elif not _encoding_key or not _decoding_key:
|
|
35
|
+
__priv_key: RSAPrivateKey = rsa.generate_private_key(public_exponent=65537,
|
|
36
|
+
key_size=2048
|
|
37
|
+
if _default_algorithm == JwtAlgorithm.RS256 else 4096)
|
|
38
|
+
_encoding_key = __priv_key.private_bytes(encoding=serialization.Encoding.PEM,
|
|
39
|
+
format=serialization.PrivateFormat.PKCS8,
|
|
40
|
+
encryption_algorithm=serialization.NoEncryption())
|
|
41
|
+
__pub_key: RSAPublicKey = __priv_key.public_key()
|
|
42
|
+
_decoding_key = __pub_key.public_bytes(encoding=serialization.Encoding.PEM,
|
|
43
|
+
format=serialization.PublicFormat.SubjectPublicKeyInfo)
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class JwtConfig(Enum):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: A collection of Python pomes, penyeach (JWT module)
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-JWT
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-JWT/issues
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
pypomes_jwt/__init__.py,sha256=vXAeaEnuUqpvGtV465TsW2Lf3ihijrMP2Hm4My79y88,968
|
|
2
|
-
pypomes_jwt/jwt_config.py,sha256=
|
|
2
|
+
pypomes_jwt/jwt_config.py,sha256=74MFwU5gDx9c1_OHFcFMY-AyD-yqnBQGY6Y2JkkslwQ,3525
|
|
3
3
|
pypomes_jwt/jwt_pomes.py,sha256=WWmZYVpG6wqlIjcJU3jNyBquCgfB-OcgCJBmm6imL4Q,23524
|
|
4
4
|
pypomes_jwt/jwt_providers.py,sha256=LL2OxdyGH3_O-qEOVjg_GsPQVRtaSi37AE-BOZ6tiqs,5928
|
|
5
5
|
pypomes_jwt/jwt_registry.py,sha256=ypBEoL0I2F08sR2G2VO9wXxVeE252lNzjIAC3FGORhA,22631
|
|
6
|
-
pypomes_jwt-1.3.
|
|
7
|
-
pypomes_jwt-1.3.
|
|
8
|
-
pypomes_jwt-1.3.
|
|
9
|
-
pypomes_jwt-1.3.
|
|
6
|
+
pypomes_jwt-1.3.3.dist-info/METADATA,sha256=i_0V4MXAwjJQHNks-9GJX1DnGHX0CouNLJvSZTN3d70,660
|
|
7
|
+
pypomes_jwt-1.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
pypomes_jwt-1.3.3.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
9
|
+
pypomes_jwt-1.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|