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 e5348759e0982583bbcf5eb91527dfed483e3f7f..d6b0bdf2bdaa027436ad514b0ad23dc303d58969 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 @@ -87,11 +87,22 @@ class EventSubscriptionsOperations(Resource): return result - if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"] and event_subscription.event_filters: - current_app.logger.debug(event_subscription.event_filters) - result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) - if isinstance(result, Response): - return result + # Check if EnhancedEventReport is enabled and validate event filters + + if EventSubscription.return_supp_feat_dict(event_subscription.supported_features)["EnhancedEventReport"]: + if event_subscription.event_filters: + current_app.logger.debug(event_subscription.event_filters) + result = self.__check_event_filters(event_subscription.events, clean_empty(event_subscription.to_dict()["event_filters"])) + if isinstance(result, Response): + return result + else: + if event_subscription.event_filters: + current_app.logger.error("Event filters provided but EnhancedEventReport is not enabled") + return bad_request_error( + detail="Bad Param", + cause="Event filters provided but EnhancedEventReport is not enabled", + invalid_params=[{"param": "eventFilters", "reason": "EnhancedEventReport is not enabled"}] + ) # Generate subscriptionID subscription_id = secrets.token_hex(15) diff --git a/services/monitoring/docker-compose.yml b/services/monitoring/docker-compose.yml index e71dff523f44176692e339f8b88d1ca1a9495c27..3a83d2396dd0f9b175a2491889fa3da281313040 100644 --- a/services/monitoring/docker-compose.yml +++ b/services/monitoring/docker-compose.yml @@ -32,7 +32,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock:rw grafana: - image: grafana/grafana + image: grafana/grafana:11.5.2 user: "${DUID}:${DGID}" environment: - GF_SECURITY_ADMIN_PASSWORD=secure_pass @@ -68,7 +68,7 @@ services: # grafana image renderer renderer: - image: grafana/grafana-image-renderer:latest + image: grafana/grafana-image-renderer:3.12.1 container_name: grafana-image-renderer expose: - "8081" @@ -77,7 +77,7 @@ services: # fluent-bit send logs to loki fluent-bit: - image: grafana/fluent-bit-plugin-loki:latest + image: grafana/fluent-bit-plugin-loki:3.1.2 container_name: fluent-bit environment: - LOKI_URL=http://loki:3100/loki/api/v1/push @@ -89,7 +89,7 @@ services: # opentelemetry collector otel-collector: - image: otel/opentelemetry-collector:latest + image: otel/opentelemetry-collector:0.120.0 ports: - 55680:55680 - 4317:4317 @@ -99,7 +99,7 @@ services: # tempo is a distributed tracing backend tempo: - image: grafana/tempo:latest + image: grafana/tempo:r190-70f6095 command: [ "-config.file=/etc/tempo.yaml" ] volumes: - ./tempo/tempo.yaml:/etc/tempo.yaml diff --git a/tests/features/CAPIF Api Events/capif_events_api.robot b/tests/features/CAPIF Api Events/capif_events_api.robot index 69071ab56368f1cf06d8003b9f45e8da713cc855..1368e0cfeed2e45f3e9035359f773bac6563e143 100644 --- a/tests/features/CAPIF Api Events/capif_events_api.robot +++ b/tests/features/CAPIF Api Events/capif_events_api.robot @@ -717,7 +717,7 @@ Invoker receives Service API Invocation events without Enhanced Event Report ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -791,7 +791,7 @@ Invoker subscribe to Service API Available and Unavailable events without Enhanc ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions @@ -863,7 +863,7 @@ Invoker subscribe to Service API Update without Enhanced Event Report ${request_body}= Create Events Subscription ... events=@{events_list} ... notification_destination=${NOTIFICATION_DESTINATION_URL}/testing - ... event_filters=${event_filters} + # ... event_filters=${event_filters} ... supported_features=0 ${resp}= Post Request Capif ... /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions