bufbuild / protovalidate-go

Protocol Buffer Validation for Go
https://pkg.go.dev/github.com/bufbuild/protovalidate-go
Apache License 2.0
294 stars 19 forks source link

feature: add option to extend CEL environment #118

Closed igor-tsiglyar closed 7 months ago

igor-tsiglyar commented 7 months ago

Adding an option to extend the CEL environment used for validation with custom functions or constants. This would greatly improve the protovalidate usage in dynamic environment (e.g. when some of the constraints are not static and hence cannot be defined using existing rules like gt, min_len etc.). This would also allow for custom format support, e.g. the formats that are not widely used and thus not making sence to be supported at celext level.

CLAassistant commented 7 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

rodaine commented 7 months ago

Hi, @igor-tsiglyar! Thanks for the patch. However, we are not going to expose the CEL environment for extension. For a previous discussion on this topic (and others), see https://github.com/bufbuild/protovalidate-go/issues/73#issuecomment-1792999337