Skip to content

Commit af2cf0f

Browse files
authored
Allow lower-case base16 encoding when creating UUris from URIs
Made the rules for reading uEntity properties from URI path segments more lenient by allowing lower-case base16 encoding as well. This improves interoperability with uProtocol implementations that are not strictly following the specification but generally do the right thing.
1 parent 9e79470 commit af2cf0f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

basics/uri.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ NOTE: The ABNF fragments above only contain the rules that differ from the origi
152152
A URI's _authority_ *MUST* be mapped to/from the UUri's `authority_name` property following the rules defined in link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[RFC3986, Section 3.2.2]. In particular, the URI *MUST NOT* contain an _authority_ if `authority_name` is empty and vice versa.
153153
--
154154

155-
[.specitem,oft-sid="dsn~uri-path-mapping~1",oft-needs="impl,utest"]
155+
[.specitem,oft-sid="dsn~uri-path-mapping~2",oft-needs="impl,utest"]
156156
--
157157
A URI's _path_ *MUST* be mapped to/from the UUri's `ue_id`, `ue_version_major` and `resource_id` properties.
158158

159159
Each property value *MUST* be mapped to a _segment_ following the rules defined in link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[RFC3986, Section 3.3].
160160

161161
The `ue_id`, `ue_version_major` and `resource_id` *MUST* be mapped to the _upper-case_ link:https://www.rfc-editor.org/rfc/rfc4648#section-8[base16 encoding]
162-
of the corresponding property values. Leading zeros (`0`) *MAY* be omitted.
162+
of the corresponding property values. Leading zeros (`0`) *SHOULD* be omitted in order to reduce the length of the URI. When creating a UUri from a URI, lower-case base16 encoded values *MUST* be accepted as well in order to improve interoperability. Note that this does not conflict with the rules defined in <<Pattern Matching>>.
163163
--
164164

165165
=== Examples

basics/uuri_uri_serialization.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,18 @@ Feature: String representation of endpoint identfiers (UUri)
6969
| "/" | not a URI |
7070
| "//" | not a URI |
7171
| "//vcu.my_vin" | just an authority |
72-
| "//VCU" | authority with uppercase characters |
7372
| "//vcu.my_vin//1/A1FB" | missing entity ID |
7473
| "//vcu.my_vin/101//A1FB" | missing version |
7574
| "//vcu.my_vin/101/1/" | missing resource ID |
7675
| "up://vcu.my_vin/101/1/A/unexpected" | too many path segments |
7776
| "xy://vcu.my_vin/101/1/A" | unsupported schema |
7877
| "//vcu.my_vin/101/1/A?foo=bar" | URI with query |
7978
| "//vcu.my_vin/101/1/A#foo" | URI with fragment |
79+
| "//VCU.my-vin/101/1/A" | server-based authority with upper-case letters |
8080
| "//vcu.my-vin:1516/101/1/A" | server-based authority with port |
8181
| "//user:pwd@vcu.my-vin/101/1/A" | server-based authority with user info |
82+
| "//[2001:db87aa::8]/101/1/A" | invalid IP literal authority |
83+
| "//MY_VIN/101/1/A" | registry-based authority with uppercase characters |
8284
| "//reg_based:1516/101/1/A" | registry-based authority name with invalid characters |
8385
| "up://vcu.my-vin/1G1/1/A1FB" | non-hex entity ID |
8486
| "/123456789/1/A1FB" | entity ID exceeds max length |

0 commit comments

Comments
 (0)