camaraproject / QualityOnDemand

Repository to describe, develop, document and test the QualityOnDemand API family
https://wiki.camaraproject.org/x/zwOeAQ
Apache License 2.0
40 stars 59 forks source link

Adding `notificationUrl` as an optional property in `CloudEvents` #314

Closed maxl2287 closed 1 month ago

maxl2287 commented 1 month ago

Problem description Currently, the expectation is that a QualityOnDemand service provider sends notifications directly from its service to a webhook using the notificationUrl provided in the request. However, if the provider forwards the event to another service for event dispatching, that intermediary service may not have access to the notificationUrl and therefore cannot fulfill the notification.

Possible evolution To address this scenario, we propose allowing the provider to include the notificationUrl within the data property of a CloudEvent. This approach ensures that essential information for notifications can be transmitted seamlessly, even when events are routed through intermediary services.

    EventQosStatusChanged:
      description: Event to notify a QoS status change
      allOf:
        - $ref: "#/components/schemas/CloudEvent"
        - type: object
          properties:
            data:
              type: object
              description: Event details depending on the event type
              required:
                - sessionId
                - qosStatus
              properties:
                sessionId:
                  $ref: "#/components/schemas/SessionId"
                qosStatus:
                  $ref: "#/components/schemas/EventQosStatus"
                statusInfo:
                  $ref: "#/components/schemas/StatusInfo"
                notificationUrl:
                  type: string
                  format: uri
                  example: "https://application-server.com"
                  description: Allows asynchronous delivery of session related events
          required:
            - data
eric-murray commented 1 month ago

Why not just include this information in a proprietary header that the event dispatcher would understand? If the API consumer included a notificationAuthToken, then that would have to be included in an additional header anyway so that the event dispatcher could construct the Authorization header.