pypomes-iam 0.0.9__tar.gz → 0.1.0__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-iam might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_iam
3
- Version: 0.0.9
3
+ Version: 0.1.0
4
4
  Summary: A collection of Python pomes, penyeach (IAM modules)
5
5
  Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-IAM
6
6
  Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-IAM/issues
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "pypomes_iam"
9
- version = "0.0.9"
9
+ version = "0.1.0"
10
10
  authors = [
11
11
  { name="GT Nunes", email="wisecoder01@gmail.com" }
12
12
  ]
@@ -35,7 +35,7 @@ JUSBR_URL_AUTH_TOKEN: Final[str] = env_get_str(key=f"{APP_PREFIX}JUSBR_URL_AUTH_
35
35
  # "auth-url": <str>,
36
36
  # "token-url": <str>,
37
37
  # "client-timeout": <int>,
38
- # "users": [
38
+ # "users": {
39
39
  # "<user-id>": {
40
40
  # "cache-obj": <Cache>,
41
41
  # "oauth-scope": <str>,
@@ -45,7 +45,7 @@ JUSBR_URL_AUTH_TOKEN: Final[str] = env_get_str(key=f"{APP_PREFIX}JUSBR_URL_AUTH_
45
45
  # "access-token": <str>
46
46
  # "refresh-token": <str>
47
47
  # }
48
- # ]
48
+ # }
49
49
  # }
50
50
  _jusbr_registry: dict[str, Any] = {
51
51
  "client-id": None,
@@ -54,7 +54,7 @@ _jusbr_registry: dict[str, Any] = {
54
54
  "auth-url": None,
55
55
  "callback-url": None,
56
56
  "token-url": None,
57
- "users": []
57
+ "users": {}
58
58
  }
59
59
 
60
60
  # dafault logger
@@ -183,12 +183,12 @@ def service_logout() -> Response:
183
183
  global _jusbr_registry
184
184
 
185
185
  # retrieve user id
186
- input_params: dict[str, Any] = request.values
186
+ input_params: dict[str, Any] = request.args
187
187
  user_id: str = input_params.get("user-id") or input_params.get("login")
188
188
 
189
189
  # remove user data
190
190
  if user_id in _jusbr_registry.get("users"):
191
- _jusbr_registry.pop(user_id)
191
+ _jusbr_registry["users"].pop(user_id)
192
192
  if _logger:
193
193
  _logger.debug(f"User '{user_id}' removed from the registry")
194
194
 
@@ -256,7 +256,7 @@ def service_token() -> Response:
256
256
  :return: the response containing the token, or *NOT AUTHORIZED*
257
257
  """
258
258
  # retrieve user id
259
- input_params: dict[str, Any] = request.values
259
+ input_params: dict[str, Any] = request.args
260
260
  user_id: str = input_params.get("user-id") or input_params.get("login")
261
261
 
262
262
  # retrieve the token
@@ -287,9 +287,10 @@ def jusbr_get_token(user_id: str,
287
287
  # initialize the return variable
288
288
  result: str | None = None
289
289
 
290
- user_data: dict[str, Any] = _jusbr_registry["users"].get(user_id)
291
- safe_cache: Cache = user_data["cache-obj"] if user_data else None
292
- if user_data and safe_cache:
290
+ user_data: dict[str, Any] = __get_user_data(user_id=user_id,
291
+ logger=logger)
292
+ safe_cache: Cache = user_data.get("cache-obj")
293
+ if safe_cache:
293
294
  access_expiration: int = user_data.get("access-expiration")
294
295
  now: int = int(datetime.now(tz=TZ_LOCAL).timestamp())
295
296
  if now < access_expiration:
File without changes
File without changes
File without changes