Releases: bufbuild/protovalidate-python
v0.5.0
Adds support for custom predefined field constraints. See the protovalidate documentation for more information.
Updates protovalidate to v0.8.1. Note that this is a breaking change. You may need to make some adjustments to your code:
- Code that imports
buf.validate.expression_pb2
orbuf.validate.priv.private_pb2
should now only importbuf.validate.validate_pb2
. buf.validate.priv.private_pb2.field
was moved tobuf.validate.validate_pb2.predefined
Note
This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
What's Changed
- Implement predefined field constraints by @jchadwick-buf in #189
Full Changelog: v0.4.0...v0.5.0
v0.4.0
This release adds support for the string.host_and_port
CEL utility function and Protobuf Editions, and bumps the versions of many of the dependencies.
Note
This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
What's Changed
- Bump actions/setup-go from 4 to 5 by @dependabot in #109
- Bump actions/setup-python from 4 to 5 by @dependabot in #108
- Create add-to-project workflow by @chrispine in #131
- Add string.host_and_port support by @rodaine in #132
- Bump pytest from 7.4.3 to 8.1.1 by @dependabot in #144
- Bump mypy from 1.7.1 to 1.9.0 by @dependabot in #143
- Bump actions/download-artifact from 3 to 4 by @dependabot in #114
- Bump actions/upload-artifact from 3 to 4 by @dependabot in #115
- Document import path for code generation by @emcfarlane in #153
- Bump aiohttp from 3.9.1 to 3.9.4 by @dependabot in #151
- Bump idna from 3.6 to 3.7 by @dependabot in #150
- Bump morrisoncole/pr-lint-action from 1.7.0 to 1.7.1 by @dependabot in #136
- Bump types-protobuf from 4.24.0.4 to 5.26.0.20240422 by @dependabot in #154
- Bump requests from 2.31.0 to 2.32.2 by @dependabot in #149
- Test 3.12 by @emcfarlane in #148
- Bump ruff from 0.1.7 to 0.4.9 by @dependabot in #157
- Switch from
black
toruff format
by @stefanvanburen in #162 - Bump ruff from 0.4.9 to 0.5.0 by @dependabot in #168
- Update for Protobuf Editions by @jchadwick-buf in #174
New Contributors
- @chrispine made their first contribution in #131
- @emcfarlane made their first contribution in #153
- @stefanvanburen made their first contribution in #162
- @jchadwick-buf made their first contribution in #174
Full Changelog: v0.3.1...v0.4.0
v0.3.1
What's Changed
- Fix behavior of required + ignore_empty constraints by @rodaine in #97
- Bump ruff from 0.1.3 to 0.1.4 by @dependabot in #94
- Bump protobuf from 4.24.4 to 4.25.0 by @dependabot in #95
- Fix JSON formatting in README.md by @kyleconroy in #98
- Combined dependencies PR by @rodaine in #102
- Support Python >=3.10 by @Alfus in #111
- Support Python >=3.8 by @Alfus in #112
New Contributors
- @rodaine made their first contribution in #97
- @kyleconroy made their first contribution in #98
Full Changelog: v0.3.0...v0.3.1
v0.3.0
What's Changed
- Bump actions/checkout from 3 to 4 by @dependabot in #71
- Bump protobuf from 4.24.1 to 4.24.3 by @dependabot in #72
- Bump black from 23.7.0 to 23.9.1 by @dependabot in #73
- Bump pytest from 7.4.0 to 7.4.2 by @dependabot in #74
- Bump types-protobuf from 4.24.0.1 to 4.24.0.2 by @dependabot in #76
- Bump urllib3 from 2.0.4 to 2.0.6 by @dependabot in #79
- Bump ruff from 0.0.285 to 0.0.292 by @dependabot in #80
- Support only Python 3.11+ by @akshayjshah in #90
- Add isIpPrefix by @higebu in #78
New Contributors
Full Changelog: v0.2.1...v0.3.0
v0.2.1
v0.2.0
Breaking Change: Refactoring of Schema-Level Constraint Enforcement
Summary:
In the recent changes to buf/validate/validate.proto
, we've refactored message definitions, targeting the organization and enforcement of rules within number-centric messages like FloatRules
, DoubleRules
, Int32Rules
, and others.
Specific Changes:
Fields such as gt
, gte
, lt
, and lte
have been structured within a oneof to ensure exclusivity:
- Fields associated with lt
and lte
now reside within the less_than
oneof.
- Fields linked to gt
and gte
have transitioned to the greater_than
oneof.
Additionally, timestamp and duration fields related to lt_now
and gt_now
have been assimilated into their respective less_than
and greater_than
oneof categories.
Action Required:
To ensure seamless compatibility and functionality, users must update their protobuf dependencies and package concurrently with this release. If your protos
were designed with mutually exclusive rules initially, the impact of this change should be minimal.
Rationale:
The restructure aims to make the rule application process more intuitive, thereby eliminating ambiguities and overlaps present in the earlier configuration. This approach ensures that rules are naturally exclusive, reinforcing better design practices.
What's Changed
- Add support for for_key and update protovalidate dep by @Alfus in #63
- Add support for isNan and isInf by @Alfus in #64
Full Changelog: v0.1.0...v0.2.0
v0.1.0
We are excited to introduce protovalidate-python
v0.1.0, the Python implementation of protovalidate, providing runtime validation for Protobuf messages based on user-defined constraints, powered by Google's Common Expression Language (CEL).
Key Features
- Protobuf Validation: Validate Protobuf messages at runtime with user-defined rules.
- CEL Support: Define comprehensive validation rules using Google's CEL.
- Efficiency: Designed for performance and minimal system resource usage.
- Flexibility: Create custom validation rules to suit specific needs.
Refer to our official documentation for detailed instructions. For any issues or suggestions, please open an issue on our GitHub page. Stay tuned for future updates.
Full Changelog: https://github.com/bufbuild/protovalidate-python/commits/v0.1.0