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

[Feature Request]: Add wellknown regex for URL encoded parameters #184

Open
weeco opened this issue Mar 4, 2024 · 1 comment
Open

[Feature Request]: Add wellknown regex for URL encoded parameters #184

weeco opened this issue Mar 4, 2024 · 1 comment
Labels
Feature New feature or request

Comments

@weeco
Copy link

weeco commented Mar 4, 2024

Feature description:

Protovalidate offers two wellknown regexes for header keys & values. It would be nice if it could be extended by one Regex that allows the character set for URL encoding only.

Problem it solves or use case:

It's common to use URL encoding for path parameters. If you want to setup a strict validation you are up to your own to define this regex.

Proposed implementation or solution:

I'm not entirely sure what the most correct Regex for this would be, but the RFC may help finding one: https://www.ietf.org/rfc/rfc3986.txt#:%7E:text=2.4.%20%20When%20to%20Encode%20or%20Decode%0A

Contribution:

It should be fairly simple to add, happy to do it as soon as we agreed on adding this and found a reasonable Regex.

Examples or references:

Additional context:

@weeco weeco added the Feature New feature or request label Mar 4, 2024
@rodaine rodaine transferred this issue from bufbuild/protovalidate-go Mar 11, 2024
@rodaine
Copy link
Member

rodaine commented Mar 25, 2024

Hey, @weeco! The KnownRegex are a holdover from the protoc-gen-validate days that we will likely deprecated prior to v1. Instead of putting this feature there, I'd say it's better suited as its own rule under the well_known oneof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants