pypomes-jwt 0.5.1__py3-none-any.whl → 0.5.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_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: str,
64
- public_key: str,
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: str = env_get_str(key=f"{APP_PREFIX}_JWT_RSA_PRIVATE_KEY")
23
- __pub_key: str = env_get_str(key=f"{APP_PREFIX}_JWT_RSA_PUBLIC_KEY")
24
- if not __priv_key or not __pub_key:
25
- (__priv_key, __pub_key) = crypto_generate_rsa_keys(key_size=2048)
26
- JWT_RSA_PRIVATE_KEY: Final[str] = __priv_key
27
- JWT_RSA_PUBLIC_KEY: Final[str] = __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
+ # if not __priv_key or not __pub_key:
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: str = JWT_RSA_PRIVATE_KEY,
57
- public_key: str = JWT_RSA_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.1
3
+ Version: 0.5.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
@@ -12,6 +12,5 @@ Requires-Python: >=3.12
12
12
  Requires-Dist: pip>=24.3.1
13
13
  Requires-Dist: pyjwt>=2.10.0
14
14
  Requires-Dist: pypomes-core>=1.6.2
15
- Requires-Dist: pypomes-crypto>=0.3.1
16
15
  Requires-Dist: setuptools>=75.5.0
17
16
  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=7ett0sEGQoM7rb28wrPDlctoH1FdCj5b78TvnSPuYkY,11174
4
+ pypomes_jwt-0.5.3.dist-info/METADATA,sha256=Xv9efNA__a6Gi3jNNx4XFkVdzVeH4HPvCKNdLK12EFs,631
5
+ pypomes_jwt-0.5.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
6
+ pypomes_jwt-0.5.3.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
+ pypomes_jwt-0.5.3.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,,