Commit 8a1f3005 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF124-event-filter-without-enhanced-event-report-response' into 'staging'

Resolve "event filter without enhanced event report response"

Closes #124

See merge request !108
parents cff24653 e11502a8
Loading
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -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:
            # 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)
+5 −5
Original line number Diff line number Diff line
@@ -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
+3 −3
Original line number Diff line number Diff line
@@ -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