From 3b086799b0e25c3df576fc0c6d6e8f8137b8046e Mon Sep 17 00:00:00 2001 From: czfdcn Date: Wed, 7 Feb 2024 11:00:50 -0500 Subject: [PATCH 1/4] Add source address to UAttributes #101 --- uprotocol/uattributes.proto | 21 +++++++++++++-------- uprotocol/umessage.proto | 11 +++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index da71220..88ee3c6 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -46,38 +46,43 @@ message UAttributes { // Message type (publish, request, response) UMessageType type = 2; + // The source (address) of the message. For published events this is the producers publish topic + // for requests it is the calling uE respose topic (who sent the request). For responses this is the + // method URI from the uService. + UUri source = 3; + // Destination UUri for a message used for unicast message types // (notification, request, response) - optional UUri sink = 3; + optional UUri sink = 4; // Message priority per // https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/qos.adoc[uProtocol Prioritization] - UPriority priority = 4; + UPriority priority = 5; // TTL is How long this message should live for after it was generated (in milliseconds). // Event expires when: // \$t_current > t_{id} + ttl\$ - optional int32 ttl = 5; + optional int32 ttl = 6; // Permission level per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions] - optional int32 permission_level = 6; + optional int32 permission_level = 7; // Communication error attribute populated by uP-L2 dispatchers only when an error // has occurred in the delivery of RPC request or response events. // The contents of this attribute, if present, is the unsigned integer representation of // UCode - optional int32 commstatus = 7; + optional int32 commstatus = 8; // The correlation ID (UUDI) passed for response type messages to corelate the // response to a request. - optional UUID reqid = 8; + optional UUID reqid = 9; // Authorization token used for TAP per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions] - optional string token = 9; + optional string token = 10; // Optional identifier used to correlate observability across related events - optional string traceparent = 10; + optional string traceparent = 11; } diff --git a/uprotocol/umessage.proto b/uprotocol/umessage.proto index d17a0b8..999c96b 100644 --- a/uprotocol/umessage.proto +++ b/uprotocol/umessage.proto @@ -35,17 +35,12 @@ option java_multiple_files = true; // UMessage is the top-level message type for the uProtocol. -// It contains a UUri, UAttributes, and UPayload and is a way of representing a +// It contains a header (UAttributes), and payload (UPayload) and is a way of representing a // message that would be sent between two uEs. message UMessage { - // The source (address) of the message. For published events this is the producers publish topic - // for requests it is the calling uE respose topic (who sent the request). For responses this is the - // method URI from the uService - UUri source = 1; - // uProtocol mandatory and optional attributes - UAttributes attributes = 2; + UAttributes attributes = 1; // Optional message payload containing the data to be sent - UPayload payload = 3; + UPayload payload = 2; } \ No newline at end of file From 3bb7b0f89fef5dae0fd9a661e1e02bc21ed8660f Mon Sep 17 00:00:00 2001 From: czfdcn Date: Wed, 7 Feb 2024 14:04:00 -0500 Subject: [PATCH 2/4] remove unused import --- uprotocol/umessage.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/uprotocol/umessage.proto b/uprotocol/umessage.proto index 999c96b..7523441 100644 --- a/uprotocol/umessage.proto +++ b/uprotocol/umessage.proto @@ -28,7 +28,6 @@ import "uattributes.proto"; import "upayload.proto"; - import "uri.proto"; option java_package = "org.eclipse.uprotocol.v1"; option java_outer_classname = "UMessageProto"; From f1156eb070a4ed22278867123fc6624225aed5f9 Mon Sep 17 00:00:00 2001 From: czfdcn Date: Wed, 7 Feb 2024 15:46:38 -0500 Subject: [PATCH 3/4] UAuthority cannot have ip and id, it is one or the other --- uprotocol/uri.proto | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/uprotocol/uri.proto b/uprotocol/uri.proto index 07cab9b..7d5e0a2 100644 --- a/uprotocol/uri.proto +++ b/uprotocol/uri.proto @@ -58,9 +58,11 @@ message UUri { // is local. message UAuthority { optional string name = 1; // Domain & device name as a string - optional bytes ip = 2; // IPv4 or IPv6 Address in byte format - optional bytes id = 3; // Unique ID for the device, could be a VIN, SHA 128, or any other identifier - // *NOTE:* MAX length is 255 bytes + oneof number { + bytes ip = 2; // IPv4 or IPv6 Address in byte format + bytes id = 3; // Unique ID for the device, could be a VIN, SHA 128, or any other identifier + // *NOTE:* MAX length is 255 bytes + } } From 873240669c1aa8d8965789f0a324110cf675da4f Mon Sep 17 00:00:00 2001 From: czfdcn Date: Thu, 8 Feb 2024 19:59:51 -0500 Subject: [PATCH 4/4] Remote unnecessary optional keywords --- uprotocol/uattributes.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index 88ee3c6..67ce836 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -53,7 +53,7 @@ message UAttributes { // Destination UUri for a message used for unicast message types // (notification, request, response) - optional UUri sink = 4; + UUri sink = 4; // Message priority per @@ -76,7 +76,7 @@ message UAttributes { // The correlation ID (UUDI) passed for response type messages to corelate the // response to a request. - optional UUID reqid = 9; + UUID reqid = 9; // Authorization token used for TAP per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions] optional string token = 10;