Skip to content

Conversation

lholmquist
Copy link
Contributor

This validates the value of the cloud event extension based on the spec, https://github.com/cloudevents/spec/blob/master/spec.md#type-system

I still need to add a check for the value being a URI

fixes #229

@lholmquist lholmquist force-pushed the 229-validate-ext-values branch from 05362bf to 7bbb303 Compare July 15, 2020 14:02
@lance lance added module/lib Related to the main source code type/bug Something isn't working type/enhancement New feature or request and removed type/bug Something isn't working labels Jul 16, 2020
@lance
Copy link
Member

lance commented Jul 23, 2020

@lholmquist I wonder if we actually need to check for URI. There is no defined URI type in JavaScript, so the actual representation will always be a string. And I don't think we need to be parsing strings to determine if they are a URI. Maybe this can just land as is. What do you think?

@lholmquist
Copy link
Contributor Author

@lance that sounds good to me. The only thing i could think was that we could create a new URL object and maybe do some parsing, but if this really is only a string, then maybe it doesn't make sense to get so involved. I'll click the "Ready for Review" button then

@lholmquist lholmquist marked this pull request as ready for review July 23, 2020 20:58
@lholmquist lholmquist requested review from a team, lance, danbev and helio-frota and removed request for a team July 23, 2020 20:59
@lholmquist lholmquist force-pushed the 229-validate-ext-values branch from 7bbb303 to 59104d6 Compare July 24, 2020 12:58
Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

A single, very minor nit re: spelling in a comment (am I just too picky!?) 😄

@lance lance changed the title Validate extension values lib: validate extension values Jul 24, 2020
@lance lance mentioned this pull request Jul 24, 2020
@lholmquist lholmquist marked this pull request as draft July 24, 2020 19:14
@lholmquist lholmquist force-pushed the 229-validate-ext-values branch from e075d3a to 194cdf3 Compare July 24, 2020 19:18
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
@lholmquist lholmquist force-pushed the 229-validate-ext-values branch from 4365f47 to c3f8e92 Compare July 24, 2020 19:38
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

LGTM

@lholmquist lholmquist marked this pull request as ready for review July 27, 2020 15:45
@lholmquist lholmquist merged commit 3c8273f into cloudevents:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/lib Related to the main source code type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CloudEvent extensions should be restricted to types allowed in spec
3 participants