diff --git a/dd-sso/admin/src/admin/lib/admin.py b/dd-sso/admin/src/admin/lib/admin.py index 4d3de22..da0ab80 100644 --- a/dd-sso/admin/src/admin/lib/admin.py +++ b/dd-sso/admin/src/admin/lib/admin.py @@ -116,19 +116,25 @@ class Admin: def third_party_add_user(self, user_id : str, user : DDUser) -> bool: res = True + log.warning(f" 3P Callbacks: Add {user_id}") for tp in self.third_party_cbs: + log.warning(f" 3P Callbacks: Add {user_id} to {tp.tpkeys.their_name}") res = res and tp.add_user(user_id, user) return res def third_party_update_user(self, user_id : str, user : DDUser) -> bool: res = True + log.warning(f" 3P Callbacks: update {user_id}") for tp in self.third_party_cbs: + log.warning(f" 3P Callbacks: update {user_id} to {tp.tpkeys.their_name}") res = res and tp.update_user(user_id, user) return res def third_party_delete_user(self, user_id : str) -> bool: res = True + log.warning(f" 3P Callbacks: delete {user_id}") for tp in self.third_party_cbs: + log.warning(f" 3P Callbacks: delete {user_id} to {tp.tpkeys.their_name}") res = res and tp.delete_user(user_id) return res diff --git a/dd-sso/admin/src/admin/lib/callbacks.py b/dd-sso/admin/src/admin/lib/callbacks.py index 8f66002..f197910 100644 --- a/dd-sso/admin/src/admin/lib/callbacks.py +++ b/dd-sso/admin/src/admin/lib/callbacks.py @@ -19,6 +19,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later import copy +import logging as log +import traceback from typing import Any, Dict, Tuple import requests @@ -77,25 +79,27 @@ class ThirdPartyCallbacks: @property def add_users_url(self) -> str: - return f"{self.tpkeys.their_service_domain}{self.endpoint_add_users[1]}" + return f"https://{self.tpkeys.their_service_domain}{self.endpoint_add_users[1]}" @property def update_users_url(self) -> str: - return f"{self.tpkeys.their_service_domain}{self.endpoint_update_users[1]}" + return f"https://{self.tpkeys.their_service_domain}{self.endpoint_update_users[1]}" @property def delete_users_url(self) -> str: - return f"{self.tpkeys.their_service_domain}{self.endpoint_delete_users[1]}" + return f"https://{self.tpkeys.their_service_domain}{self.endpoint_delete_users[1]}" def _request(self, method: str, url: str, data: DDUser) -> bool: # The endpoints are prepared for batch operations, but the way # the admin lib is set up, it is currently not doable. prepared_data = [user_parser(data)] + log.warning(f" {method} {url} {data.get('id', '?')}") try: enc_data = self.tpkeys.sign_and_encrypt_outgoing_json(prepared_data) headers = self.tpkeys.get_outgoing_request_headers() res = requests.request(method, url, data=enc_data, headers=headers) except: + log.error(traceback.format_exc()) # Something went wrong sending the request return False return res.status_code == 200