Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TERCC: Add UUID validation pattern to links.target #275

Merged

Conversation

magnusbaeck
Copy link
Member

Applicable Issues

Fixes #271

Description of the Change

The TERCC event's validation pattern for links.target disappeared in 2.0.0 of the event which no doubt must've been a mistake. Introduce 4.1.1 to fix this bug and align TERCC with all other event types.

Here's the diff between 4.1.0 and 4.1.1:

$ diff -u 4.1.0.json 4.1.1.json                             
--- 4.1.0.json	2021-09-20 14:37:09.475728017 +0200
+++ 4.1.1.json	2021-09-20 16:10:53.794895663 +0200
@@ -15,8 +15,8 @@
         },
         "version": {
           "type": "string",
-          "enum": [ "4.1.0" ],
-          "default": "4.1.0"
+          "enum": [ "4.1.1" ],
+          "default": "4.1.1"
         },
         "time": {
           "type": "integer"
@@ -257,7 +257,8 @@
             "type": "string"
           },
           "target": {
-            "type": "string"
+            "type": "string",
+            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
           },
           "domainId": {
             "type": "string"

Alternate Designs

None.

Benefits

TERCC enforces UUIDs for link targets just like all other events.

Possible Drawbacks

None.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

Signed-off-by: Magnus Bäck <magnus.back@axis.com>

The TERCC event's validation pattern for links.target disappeared in
2.0.0 of the event which no doubt must've been a mistake. Introduce
4.1.1 to fix this bug and align TERCC with all other event types.
Copy link
Member

@e-backmark-ericsson e-backmark-ericsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a non-backwards compatible change in the json schema, as we restrict the value range for the target uuid field, so the version should be stepped by it's major component. But I'd say we can consider it defacto backwards compatible, as I have a very hard time seeing that anyone would have misused the possibility to state anything else than a uuid there, so I'd say it is ok to make this a patch version update.

@e-backmark-ericsson e-backmark-ericsson merged commit 64b4a1c into eiffel-community:master Sep 20, 2021
@magnusbaeck magnusbaeck deleted the tercc-pattern branch September 20, 2021 15:01
@magnusbaeck
Copy link
Member Author

Technically yes, but I'd argue that bugfixes of this kind are still bugfixes even if they theoretically break someone's spacebar heating. The rest of the spec (e.g. the-links-object.md) says UUID for all event types.

e-backmark-ericsson pushed a commit to e-backmark-ericsson/eiffel that referenced this pull request Apr 13, 2022
)

The TERCC event's validation pattern for links.target disappeared in
2.0.0 of the event which no doubt must've been a mistake. Introduce
4.1.1 to fix this bug and align TERCC with all other event types.
@magnusbaeck magnusbaeck added the protocol All protocol changes label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug protocol All protocol changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TERCC missing pattern for links.target
3 participants