diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index ae4674e7e2f76162828647bbe89ce770ab1caaf7..cb4b48d47e707b75dde561d0f10030c4d5ad9ac6 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -220,7 +220,7 @@ class EventSubscriptionsOperations(Resource): if eventdescription is None: current_app.logger.error("Event subscription not found") - return not_found_error(detail="Event subscription not exist", cause="Event API subscription id not found") + return not_found_error(detail="Event subscription does not exist", cause="Event API subscription id not found") mycol.delete_one(my_query) notifications_col.delete_many({"subscription_id": subscription_id}) diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py index 8d1f8b05fad5eda954a723ae355e22214dc27574..3370c1d68082c9f731f1c7ff492cea26501c9b2a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/validate_user.py @@ -25,7 +25,7 @@ class ControlAccess(Resource): prob = serialize_clean_camel_case(prob) return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype="application/json") - elif event_id is not None and (cert_entry["cert_signature"] != cert_signature or "event_subscriptions" not in cert_entry["resources"] or event_id not in cert_entry["resources"]["event_subscriptions"]): + elif event_id is not None and (cert_entry["cert_signature"] != cert_signature or "event_subscriptions" not in cert_entry["resources"]): prob = ProblemDetails(title="Unauthorized", detail="User not authorized", cause="You are not the owner of this resource") prob = serialize_clean_camel_case(prob) diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 4da4228d806396aad0188ea7cb78a321804e3a2e..df0ea678f2ab6bb1b6ba8408656e1b0a7f5de471 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -135,10 +135,10 @@ Deletes an individual CAPIF Event Subscription with invalid SubscriptionId ... username=${INVOKER_USERNAME} # Check Results - Check Response Variable Type And Values ${resp} 401 ProblemDetails - ... title=Unauthorized - ... detail=User not authorized - ... cause=You are not the owner of this resource + Check Response Variable Type And Values ${resp} 404 ProblemDetails + ... title=Not Found + ... detail=Event subscription does not exist + ... cause=Event API subscription id not found Invoker receives Service API Invocation events [Tags] capif_api_events-6 mockserver smoke