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

Implement payload validation rules #381

Open
codysoyland opened this issue Aug 15, 2024 · 1 comment
Open

Implement payload validation rules #381

codysoyland opened this issue Aug 15, 2024 · 1 comment

Comments

@codysoyland
Copy link
Member

The protocol buffer files in this repo are annotated with AIP-203 field behavior annotations, denoting fields that are marked as required. These annotations are not generally useful for payload validation, as described in AIP-4223:

The reason for this is that the google.api.field_behavior annotation is primarily a machine-readable form of documentation, and not a configuration for payload validation.

In sigstore-go, we've discussed adding additional validation to prevent nil-pointer panics, fail fast, and improve error messages. Ideally, these validation rules could be embedded in the protobuf files as opposed to implemented separately in each client language.

I came across a promising set of libraries designed for adding user-defined constraints to protobuf fields: protovalidate. It has highly-customizable rules and has Go, Java, and Python libraries.

I would like to propose that we add protovalidate annotations to the protobuf files in this repo, or if there are any alternative practices/libraries anybody would like to suggest.

@loosebazooka
Copy link
Member

Yeah, I wouldn't mind removing sigstore-java's custom validator.

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

No branches or pull requests

2 participants