pypomes-iam 0.6.9__tar.gz → 0.7.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_iam
3
- Version: 0.6.9
3
+ Version: 0.7.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.6.9"
9
+ version = "0.7.0"
10
10
  authors = [
11
11
  { name="GT Nunes", email="wisecoder01@gmail.com" }
12
12
  ]
@@ -308,7 +308,13 @@ def action_exchange(iam_server: IamServer,
308
308
 
309
309
  # obtain the token to be exchanged
310
310
  token: str = args.get("access-token") if user_id else None
311
- if token:
311
+ token_claims: dict[str, dict[str, Any]] = token_get_claims(token=token,
312
+ errors=errors,
313
+ logger=logger) if token else None
314
+ token_issuer: str = _iam_server_from_issuer(issuer=token_claims["payload"]["iss"],
315
+ errors=errors,
316
+ logger=logger) if token_claims else None
317
+ if not errors:
312
318
  # HAZARD: only 'IAM_KEYCLOAK' is currently supported
313
319
  with _iam_lock:
314
320
  # retrieve the IAM server's registry
@@ -324,6 +330,8 @@ def action_exchange(iam_server: IamServer,
324
330
  logger=logger)
325
331
  if not errors:
326
332
  # exchange the token
333
+ if logger:
334
+ logger.debug(msg=f"Requesting the token exchange to IAM server '{iam_server}'")
327
335
  header_data: dict[str, Any] = {
328
336
  "Content-Type": "application/x-www-form-urlencoded"
329
337
  }
@@ -333,7 +341,7 @@ def action_exchange(iam_server: IamServer,
333
341
  "subject_token_type": "urn:ietf:params:oauth:token-type:access_token",
334
342
  "requested_token_type": "urn:ietf:params:oauth:token-type:access_token",
335
343
  "audience": registry[IamParam.CLIENT_ID],
336
- "subject_issuer": "oidc"
344
+ "subject_issuer": token_issuer
337
345
  }
338
346
  now: int = int(datetime.now(tz=TZ_LOCAL).timestamp())
339
347
  token_data: dict[str, Any] = __post_for_token(iam_server=iam_server,
File without changes
File without changes
File without changes
File without changes