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

lib: validate extension values #251

Merged
merged 5 commits into from
Jul 27, 2020

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

@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
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!?) 😄

src/event/cloudevent.ts Outdated Show resolved Hide resolved
@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
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>
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