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

[V2] Make sure the name field only contains the unreserved characters in RFC3986 #343

Closed
cloudxxx8 opened this issue Oct 15, 2020 · 2 comments · Fixed by #399
Closed

[V2] Make sure the name field only contains the unreserved characters in RFC3986 #343

cloudxxx8 opened this issue Oct 15, 2020 · 2 comments · Fixed by #399
Assignees
Labels
2-medium priority denoting issues with cross-cutting project impact enhancement New feature or request ireland

Comments

@cloudxxx8
Copy link
Member

In 15-OCT-2020 Core WG meeting, we decided to use only unreserved characters in the name field according to RFC3986.

https://en.wikipedia.org/wiki/Percent-encoding

@cloudxxx8 cloudxxx8 added enhancement New feature or request hanoi Hanoi release 2-medium priority denoting issues with cross-cutting project impact labels Oct 15, 2020
@cloudxxx8 cloudxxx8 added this to New Issues in Core WG via automation Oct 15, 2020
@jpwhitemn jpwhitemn moved this from New Issues to Release Backlog in Core WG Oct 20, 2020
@cloudxxx8 cloudxxx8 moved this from Release Backlog to Icebox in Core WG Oct 23, 2020
@cloudxxx8 cloudxxx8 added ireland and removed hanoi Hanoi release labels Oct 23, 2020
@weichou1229
Copy link
Member

This tag might help:
https://pkg.go.dev/github.com/go-playground/validator/v10#hdr-URL_Encoded

This validates that a string value is percent-encoded (URL encoded) according to https://tools.ietf.org/html/rfc3986#section-2.1

@jpwhitemn jpwhitemn moved this from Icebox to Release Backlog in Core WG Dec 2, 2020
@judehung
Copy link
Member

This tag might help:
https://pkg.go.dev/github.com/go-playground/validator/v10#hdr-URL_Encoded

This validates that a string value is percent-encoded (URL encoded) according to https://tools.ietf.org/html/rfc3986#section-2.1

@weichou1229 thanks for the information. Unfortunately, ulr_encoded tag is used to validate if a string is url-encoded or not, which is a little bit different to what we would like to validate. I'll implement a custom tag to validate that name field only allows RFC3986 section 2.3 defined unreserved characters, which should be ALPHA / DIGIT / "-" / "." / "_" / "~".

judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 15, 2020
…acters

A custom validation tag to ensure name filed only allows RFC3986 unreserved characters

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
@cloudxxx8 cloudxxx8 moved this from Release Backlog to In progress in Core WG Dec 15, 2020
judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 16, 2020
…acters

Implement a new custom validation tag "edgex-dto-rfc3986-unreserved-chars" to
ensure name fields only allows RFC3986 unreserved characters.

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 16, 2020
…acters

Implement a new custom validation tag "edgex-dto-rfc3986-unreserved-chars" to
ensure name fields only allows RFC3986 unreserved characters.

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 16, 2020
…acters

Implement a new custom validation tag "edgex-dto-rfc3986-unreserved-chars" to
ensure name fields only allows RFC3986 unreserved characters.

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 16, 2020
…acters

Implement a new custom validation tag "edgex-dto-rfc3986-unreserved-chars" to
ensure name fields only allows RFC3986 unreserved characters.

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung added a commit to judehung/go-mod-core-contracts that referenced this issue Dec 17, 2020
…acters

Implement a new custom validation tag "edgex-dto-rfc3986-unreserved-chars" to
ensure name fields only allows RFC3986 unreserved characters.

fix edgexfoundry#343

Signed-off-by: Jude Hung <jude@iotechsys.com>
Core WG automation moved this from In progress to Done Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-medium priority denoting issues with cross-cutting project impact enhancement New feature or request ireland
Projects
No open projects
3 participants