pypomes-jwt 1.3.2__tar.gz → 1.3.3__tar.gz
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-1.3.2 → pypomes_jwt-1.3.3}/PKG-INFO +1 -1
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/pyproject.toml +1 -1
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/src/pypomes_jwt/jwt_config.py +13 -13
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/.gitignore +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/LICENSE +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/README.md +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/src/pypomes_jwt/__init__.py +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/src/pypomes_jwt/jwt_pomes.py +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/src/pypomes_jwt/jwt_providers.py +0 -0
- {pypomes_jwt-1.3.2 → pypomes_jwt-1.3.3}/src/pypomes_jwt/jwt_registry.py +0 -0
|
@@ -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
|
|
@@ -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):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|