pypomes-jwt 0.5.4__py3-none-any.whl → 0.5.5__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_pomes.py CHANGED
@@ -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) -> Response:
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 the body's JSON
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
- with contextlib.suppress(Exception):
265
- params = request.get_json()
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
@@ -1,16 +1,14 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pypomes_jwt
3
- Version: 0.5.4
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: pip>=24.3.1
13
- Requires-Dist: pyjwt>=2.10.0
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
@@ -0,0 +1,7 @@
1
+ pypomes_jwt/__init__.py,sha256=1IyBb94cZjkXMibHrH_vh043b06QFh5UQ6HTYSDau28,978
2
+ pypomes_jwt/jwt_data.py,sha256=dIRkXvEfM0aWXqJVeeeeGVLH2G5qGnhrpVygCoKj7ws,17602
3
+ pypomes_jwt/jwt_pomes.py,sha256=tKZd3eVMNsNNSJyQv0401JCwq_CPbwv8LxCnwiBBltM,11404
4
+ pypomes_jwt-0.5.5.dist-info/METADATA,sha256=afC2ceWYURWZtUNTzUkCgsL3gUdjBUbHdlKBAj79OVA,563
5
+ pypomes_jwt-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ pypomes_jwt-0.5.5.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
+ pypomes_jwt-0.5.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- pypomes_jwt/__init__.py,sha256=1IyBb94cZjkXMibHrH_vh043b06QFh5UQ6HTYSDau28,978
2
- pypomes_jwt/jwt_data.py,sha256=dIRkXvEfM0aWXqJVeeeeGVLH2G5qGnhrpVygCoKj7ws,17602
3
- pypomes_jwt/jwt_pomes.py,sha256=7ett0sEGQoM7rb28wrPDlctoH1FdCj5b78TvnSPuYkY,11174
4
- pypomes_jwt-0.5.4.dist-info/METADATA,sha256=QLGJLvKCBCk4AZXjUAwy8jq-tHL7YvT0UujntvA5YVE,631
5
- pypomes_jwt-0.5.4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
6
- pypomes_jwt-0.5.4.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
- pypomes_jwt-0.5.4.dist-info/RECORD,,