Loading services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py +6 −6 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case from .resources import Resource from .responses import internal_server_error from .responses import internal_server_error, not_found_error, forbidden_error class ControlAccess(Resource): Loading @@ -20,11 +20,11 @@ class ControlAccess(Resource): my_query = {'id': api_invoker_id} cert_entry = cert_col.find_one(my_query) if cert_entry is not None: if cert_entry is None: return not_found_error(detail="Please provide an existing Network App ID", cause="Certificate not found for invoker") if cert_entry["cert_signature"] != cert_signature: prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") prob = serialize_clean_camel_case(prob) return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") return forbidden_error(detail="User not authorized", cause="You are not the owner of this resource") except Exception as e: exception = "An exception occurred in validate invoker" Loading tests/features/CAPIF Api Discover Service/capif_api_service_discover.robot +2 −2 Original line number Diff line number Diff line Loading @@ -86,8 +86,8 @@ Discover Published service APIs by not registered API Invoker Check Response Variable Type And Values ${resp} 404 ProblemDetails ... title=Not Found ... status=404 ... detail=API Invoker does not exist ... cause=API Invoker id not found ... detail=Please provide an existing Network App ID ... cause=Certificate not found for invoker Discover Published service APIs by registered API Invoker with 1 result filtered [Tags] capif_api_discover_service-4 smoke Loading Loading
services/TS29222_CAPIF_Discover_Service_API/service_apis/core/validate_user.py +6 −6 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ from ..encoder import CustomJSONEncoder from ..models.problem_details import ProblemDetails from ..util import serialize_clean_camel_case from .resources import Resource from .responses import internal_server_error from .responses import internal_server_error, not_found_error, forbidden_error class ControlAccess(Resource): Loading @@ -20,11 +20,11 @@ class ControlAccess(Resource): my_query = {'id': api_invoker_id} cert_entry = cert_col.find_one(my_query) if cert_entry is not None: if cert_entry is None: return not_found_error(detail="Please provide an existing Network App ID", cause="Certificate not found for invoker") if cert_entry["cert_signature"] != cert_signature: prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") prob = serialize_clean_camel_case(prob) return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") return forbidden_error(detail="User not authorized", cause="You are not the owner of this resource") except Exception as e: exception = "An exception occurred in validate invoker" Loading
tests/features/CAPIF Api Discover Service/capif_api_service_discover.robot +2 −2 Original line number Diff line number Diff line Loading @@ -86,8 +86,8 @@ Discover Published service APIs by not registered API Invoker Check Response Variable Type And Values ${resp} 404 ProblemDetails ... title=Not Found ... status=404 ... detail=API Invoker does not exist ... cause=API Invoker id not found ... detail=Please provide an existing Network App ID ... cause=Certificate not found for invoker Discover Published service APIs by registered API Invoker with 1 result filtered [Tags] capif_api_discover_service-4 smoke Loading