pypomes-jwt 0.5.4__tar.gz → 0.5.5__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-0.5.4 → pypomes_jwt-0.5.5}/PKG-INFO +5 -7
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/pyproject.toml +3 -6
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/src/pypomes_jwt/jwt_pomes.py +9 -6
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/.gitignore +0 -0
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/LICENSE +0 -0
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/README.md +0 -0
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/src/__init__.py +0 -0
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/src/pypomes_jwt/__init__.py +0 -0
- {pypomes_jwt-0.5.4 → pypomes_jwt-0.5.5}/src/pypomes_jwt/jwt_data.py +0 -0
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.5
|
|
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
|
|
7
7
|
Author-email: GT Nunes <wisecoder01@gmail.com>
|
|
8
|
+
License-File: LICENSE
|
|
8
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
10
|
Classifier: Operating System :: OS Independent
|
|
10
11
|
Classifier: Programming Language :: Python :: 3
|
|
11
12
|
Requires-Python: >=3.12
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist: pypomes-core>=1.6.2
|
|
15
|
-
Requires-Dist: setuptools>=75.5.0
|
|
16
|
-
Requires-Dist: wheel>=0.45.0
|
|
13
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
14
|
+
Requires-Dist: pypomes-core>=1.6.6
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "pypomes_jwt"
|
|
9
|
-
version = "0.5.
|
|
9
|
+
version = "0.5.5"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="GT Nunes", email="wisecoder01@gmail.com" }
|
|
12
12
|
]
|
|
@@ -19,12 +19,9 @@ classifiers = [
|
|
|
19
19
|
"Operating System :: OS Independent"
|
|
20
20
|
]
|
|
21
21
|
dependencies = [
|
|
22
|
-
"
|
|
23
|
-
"PyJWT>=2.10.0",
|
|
22
|
+
"PyJWT>=2.10.1",
|
|
24
23
|
# "PyOpenSSL>=24.2.1", - pending fixing runtime error in jwt_data.py
|
|
25
|
-
"pypomes_core>=1.6.
|
|
26
|
-
"setuptools>=75.5.0",
|
|
27
|
-
"wheel>=0.45.0"
|
|
24
|
+
"pypomes_core>=1.6.6"
|
|
28
25
|
]
|
|
29
26
|
|
|
30
27
|
[project.urls]
|
|
@@ -233,11 +233,12 @@ def jwt_verify_request(request: Request,
|
|
|
233
233
|
|
|
234
234
|
# @flask_app.route(rule="/jwt-service",
|
|
235
235
|
# methods=["POST"])
|
|
236
|
-
def jwt_service(service_url: str = None
|
|
236
|
+
def jwt_service(service_url: str = None,
|
|
237
|
+
service_params: dict[str, Any] = None) -> Response:
|
|
237
238
|
"""
|
|
238
239
|
Entry point for obtaining JWT tokens.
|
|
239
240
|
|
|
240
|
-
In order to be serviced, the invoker must send, in the body of the request,
|
|
241
|
+
In order to be serviced, the invoker must send, as parameter *service_params* or in the body of the request,
|
|
241
242
|
a JSON containing:
|
|
242
243
|
{
|
|
243
244
|
"service-url": "<url>", - the JWT reference URL (if not as parameter)
|
|
@@ -252,7 +253,8 @@ def jwt_service(service_url: str = None) -> Response:
|
|
|
252
253
|
"expires_in": <seconds-to-expiration>
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
:param service_url: the JWT reference URL, alternatively passed in
|
|
256
|
+
:param service_url: the JWT reference URL, alternatively passed in JSON
|
|
257
|
+
:param service_params: the optional JSON containing the request parameters (defaults to body's JSON)
|
|
256
258
|
:return: the requested JWT token, along with its duration.
|
|
257
259
|
"""
|
|
258
260
|
# declare the return variable
|
|
@@ -260,9 +262,10 @@ def jwt_service(service_url: str = None) -> Response:
|
|
|
260
262
|
|
|
261
263
|
# obtain the parameters
|
|
262
264
|
# noinspection PyUnusedLocal
|
|
263
|
-
params: dict[str, Any] = {}
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
params: dict[str, Any] = service_params or {}
|
|
266
|
+
if not params:
|
|
267
|
+
with contextlib.suppress(Exception):
|
|
268
|
+
params = request.get_json()
|
|
266
269
|
|
|
267
270
|
# validate the parameters
|
|
268
271
|
valid: bool = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|