From 5a11928323e952757c47a22c57a06d83a54992cd Mon Sep 17 00:00:00 2001 From: Michael Lagally Date: Wed, 30 Nov 2022 12:39:53 +0100 Subject: [PATCH 1/2] cloud events payload - initial draft --- index.html | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/index.html b/index.html index a7852ea..8067546 100644 --- a/index.html +++ b/index.html @@ -3322,6 +3322,154 @@

Event Connections

+ + +
+

Cloud Events Message Format

+

+ This section defines a JSON object format for events, which provides interoperability with cloud systems + that use the cloud events specification with the + HTTP Webhook profile +

+ This message format is one way of using the WebHook profile in a well defined way + that is supported by several cloud systems. +

+

+ Using other message formats is not prohibited by this section - They should be used for deployments, + where consumers use a different event payload. +

+ +
+

Identifier

+

+ In order to denote that a given + Web Thing + conforms to the HTTP Webhook Profile and uses Cloud Events, + its Thing Description MUST have a + + profile member containing both profile identifiers: + https://www.w3.org/2022/wot/profile/http-webhook/v1 + and https://www.w3.org/2022/wot/profile/http-cloudevent/v1 + . +

+
+

Note that the profile member is an array that may contain multiple + profile entries, which indicates that a Web Thing conforms to all of the profiles in that array.

+
+
+ + + +

+ If the consumer is providing an endpoint for cloud events, + event notification messages SHOULD comply with the following data schema. +

+ +

+ The format is aligned with the cloud events specification + to ensure interoperability with cloud systems that adopt that specification. +

+

+ An event message contains a set of metadata properties and an optional data payload. + The metadata fields allow to determine the type and source of the event as well as + a timestamp indicating when the event occured and an optional data payload. +

+

+ + The following constraints MUST be + applied to the event payload: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
keywordtypetype constraintsvalue constraints
specversionstringmandatory, non-emptyThe specversion MUST have the value "1.0"
idstringmandatory, non-emptyFor each distinct event the combination of source + id MUST be unique. + A WebThing MAY resend the same event with the same id. + If an event is resent with the same id, a consumer SHOULD treat it as + duplicate.
sourceurimandatory, non-emptyThe combination of source + id MUST be unique for each distinct event. + The source MUST be set to the baseURI of the WebThing.
subjectstringoptionalWhen this field is used, it MUST be set to the title of the event or property + affordance.
typestringmandatory, non-emptyFor event affordances the source MUST be set to the string "/events/eventName" of the + event affordance.
+ For property affordances the source MUST be set to the string "/properties/propertyName" of + the property affordance. +
timestringoptional, compliant with [[RFC3339]]time when the event occurred. If the WebThing does not have a clock, it MUST use the same + algorithm on all event affordances to determine the value of this field. +
datacontenttypestringoptional, [[RFC2046]] compliant MIME type, when set the value MUST be "application/json" + If a WebThing contains a data member, this field MUST be present.
datastringoptionalJSON encoded data object of the event affordance.
+ + The size of an event object MUST NOT exceed 64KB, to ensure interoperability with all kinds of consumers. + +

+ For each notification message, the Web Thing MUST set the event field to the + name of the EventAffordance. +

+

+ The event data MUST follow the data schema specified in the + EventAffordance and MUST be serialized in JSON. +

+

+ The id field MUST be set to a unique identifier for + the event. +

+
+ + +

Privacy Considerations

From 7223c012c4214f347723064f35bc00328c671554 Mon Sep 17 00:00:00 2001 From: Michael Lagally <31951801+mlagally@users.noreply.github.com> Date: Thu, 16 Feb 2023 19:13:02 +0100 Subject: [PATCH 2/2] Update index.html --- index.html | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/index.html b/index.html index 8067546..9821a58 100644 --- a/index.html +++ b/index.html @@ -2975,18 +2975,6 @@

Identifier

profile entries, which indicates that a Web Thing conforms to all of the profiles in that array.

- -
-

Message Format

-

- Event notification messages MUST comply with the following data schema. -

- -

- - TODO: Describe data and dataResponse schemas. -

-

Protocol Binding