pypomes-jwt 0.5.1__py3-none-any.whl → 0.5.2__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_data.py +2 -2
- pypomes_jwt/jwt_pomes.py +10 -8
- {pypomes_jwt-0.5.1.dist-info → pypomes_jwt-0.5.2.dist-info}/METADATA +2 -2
- pypomes_jwt-0.5.2.dist-info/RECORD +7 -0
- pypomes_jwt-0.5.1.dist-info/RECORD +0 -7
- {pypomes_jwt-0.5.1.dist-info → pypomes_jwt-0.5.2.dist-info}/WHEEL +0 -0
- {pypomes_jwt-0.5.1.dist-info → pypomes_jwt-0.5.2.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_data.py
CHANGED
|
@@ -60,8 +60,8 @@ class JwtData:
|
|
|
60
60
|
access_max_age: int,
|
|
61
61
|
refresh_max_age: int,
|
|
62
62
|
secret_key: bytes,
|
|
63
|
-
private_key:
|
|
64
|
-
public_key:
|
|
63
|
+
private_key: bytes,
|
|
64
|
+
public_key: bytes,
|
|
65
65
|
request_timeout: float,
|
|
66
66
|
local_provider: bool,
|
|
67
67
|
logger: Logger = None) -> None:
|
pypomes_jwt/jwt_pomes.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import contextlib
|
|
2
2
|
from flask import Request, Response, request, jsonify
|
|
3
3
|
from logging import Logger
|
|
4
|
+
from OpenSSL import crypto
|
|
4
5
|
from pypomes_core import APP_PREFIX, env_get_str, env_get_bytes, env_get_int
|
|
5
|
-
from pypomes_crypto import crypto_generate_rsa_keys
|
|
6
6
|
from secrets import token_bytes
|
|
7
7
|
from typing import Any, Final, Literal
|
|
8
8
|
|
|
@@ -19,12 +19,14 @@ JWT_HS_SECRET_KEY: Final[bytes] = env_get_bytes(key=f"{APP_PREFIX}_JWT_HS_SECRET
|
|
|
19
19
|
# must point to 'jwt_service()' below
|
|
20
20
|
JWT_ENDPOINT_URL: Final[str] = env_get_str(key=f"{APP_PREFIX}_JWT_ENDPOINT_URL")
|
|
21
21
|
|
|
22
|
-
__priv_key:
|
|
23
|
-
__pub_key:
|
|
22
|
+
__priv_key: bytes = env_get_bytes(key=f"{APP_PREFIX}_JWT_RSA_PRIVATE_KEY")
|
|
23
|
+
__pub_key: bytes = env_get_bytes(key=f"{APP_PREFIX}_JWT_RSA_PUBLIC_KEY")
|
|
24
24
|
if not __priv_key or not __pub_key:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
pk = crypto.PKey()
|
|
26
|
+
__priv_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, pk)
|
|
27
|
+
__pub_key = crypto.dump_publickey(crypto.FILETYPE_PEM, pk)
|
|
28
|
+
JWT_RSA_PRIVATE_KEY: Final[bytes] = __priv_key
|
|
29
|
+
JWT_RSA_PUBLIC_KEY: Final[bytes] = __pub_key
|
|
28
30
|
|
|
29
31
|
# the JWT data object
|
|
30
32
|
__jwt_data: JwtData = JwtData()
|
|
@@ -53,8 +55,8 @@ def jwt_set_service_access(service_url: str,
|
|
|
53
55
|
access_max_age: int = JWT_ACCESS_MAX_AGE,
|
|
54
56
|
refresh_max_age: int = JWT_REFRESH_MAX_AGE,
|
|
55
57
|
secret_key: bytes = JWT_HS_SECRET_KEY,
|
|
56
|
-
private_key:
|
|
57
|
-
public_key:
|
|
58
|
+
private_key: bytes = JWT_RSA_PRIVATE_KEY,
|
|
59
|
+
public_key: bytes = JWT_RSA_PUBLIC_KEY,
|
|
58
60
|
request_timeout: int = None,
|
|
59
61
|
local_provider: bool = False,
|
|
60
62
|
logger: Logger = None) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
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
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Requires-Python: >=3.12
|
|
12
12
|
Requires-Dist: pip>=24.3.1
|
|
13
13
|
Requires-Dist: pyjwt>=2.10.0
|
|
14
|
+
Requires-Dist: pyopenssl>=24.2.1
|
|
14
15
|
Requires-Dist: pypomes-core>=1.6.2
|
|
15
|
-
Requires-Dist: pypomes-crypto>=0.3.1
|
|
16
16
|
Requires-Dist: setuptools>=75.5.0
|
|
17
17
|
Requires-Dist: wheel>=0.45.0
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pypomes_jwt/__init__.py,sha256=1IyBb94cZjkXMibHrH_vh043b06QFh5UQ6HTYSDau28,978
|
|
2
|
+
pypomes_jwt/jwt_data.py,sha256=pXw4MrUAXbLhs12y7F2KVTq78unvHi5JqM2v5EaD-Pw,17528
|
|
3
|
+
pypomes_jwt/jwt_pomes.py,sha256=kXvoJt6F8CbYipFRXDa8rMQF2LJuwCFFjJTHU50hoQE,11164
|
|
4
|
+
pypomes_jwt-0.5.2.dist-info/METADATA,sha256=xy4my_vSAon1fHq506HvkEcQEH5diVMW4OikaRcorow,664
|
|
5
|
+
pypomes_jwt-0.5.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
6
|
+
pypomes_jwt-0.5.2.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
7
|
+
pypomes_jwt-0.5.2.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=1IyBb94cZjkXMibHrH_vh043b06QFh5UQ6HTYSDau28,978
|
|
2
|
-
pypomes_jwt/jwt_data.py,sha256=iRyJZhmx1NJOMXAvJUB5yTIZSTgutQ0fFeYmvmyzo2o,17524
|
|
3
|
-
pypomes_jwt/jwt_pomes.py,sha256=IKfpvC3FO3ts-xfHQMxkPYQjeUjWrbVFOqXnNYJTKnM,11090
|
|
4
|
-
pypomes_jwt-0.5.1.dist-info/METADATA,sha256=3dHLb84c8txBDFYagpN4rFjNIw2zbvtHeiuCJ7h_Ll0,668
|
|
5
|
-
pypomes_jwt-0.5.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
6
|
-
pypomes_jwt-0.5.1.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
7
|
-
pypomes_jwt-0.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|