Skip to content

Commit

Permalink
Update to protovalidate & properly validate for namespaces (#139)
Browse files Browse the repository at this point in the history
* Update to protovalidate & properly validate for namespaces

Signed-off-by: Jonathan Marcantonio <[email protected]>

* remove duplicate namespace from test case

Signed-off-by: Jonathan Marcantonio <[email protected]>

* Validate in middleware & some tests

Signed-off-by: Jonathan Marcantonio <[email protected]>

* Test streaming validation interceptor

Signed-off-by: Jonathan Marcantonio <[email protected]>

* Update tests & move validation logic

Signed-off-by: Jonathan Marcantonio <[email protected]>

---------

Signed-off-by: Jonathan Marcantonio <[email protected]>
  • Loading branch information
lennysgarage authored Aug 22, 2024
1 parent 46658ee commit 7a002b5
Show file tree
Hide file tree
Showing 31 changed files with 481 additions and 3,689 deletions.
2 changes: 0 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ RUN ln -s /usr/local/go/bin/go /usr/local/bin/go
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest
RUN go install github.com/envoyproxy/protoc-gen-validate@latest

# Install Buf
RUN go install github.com/bufbuild/buf/cmd/buf@latest
Expand All @@ -24,5 +23,4 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
COPY --from=builder /root/go/bin/protoc-gen-go /usr/local/bin/protoc-gen-go
COPY --from=builder /root/go/bin/protoc-gen-go-grpc /usr/local/bin/protoc-gen-go-grpc
COPY --from=builder /root/go/bin/protoc-gen-go-http /usr/local/bin/protoc-gen-go-http
COPY --from=builder /root/go/bin/protoc-gen-validate /usr/local/bin/protoc-gen-validate
COPY --from=builder /root/go/bin/buf /usr/local/bin/buf
5 changes: 0 additions & 5 deletions api/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ plugins:
opt:
- fq_schema_naming=true
- default_response=false
- local: protoc-gen-validate
opt:
- paths=source_relative
- lang=go
out: .
10 changes: 5 additions & 5 deletions api/buf.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/envoyproxy/protoc-gen-validate
commit: daf171c6cdb54629b5f51e345a79e4dd
digest: b5:c745e1521879f43740230b1df673d0729f55704efefdcfc489d4a0a2d40c92a26cacfeab62813403040a8b180142d53b398c7ca784a065e43823605ee49681de
- name: buf.build/bufbuild/protovalidate
commit: a6c49f84cc0f4e038680d390392e2ab0
digest: b5:e968392e88ff7915adcbd1635d670b45bff8836ec2415d81fc559ca5470a695dbdc30030bad8bc5764647c731079e9e7bba0023ea25c4e4a1672a7d2561d4a19
- name: buf.build/googleapis/googleapis
commit: f0e53af8f2fc4556b94f482688b57223
digest: b5:24e758f963ee1bb3b5218eb452e0bdfb7a5449d9a77d174b8284b6368ccc1884213689381cdcd79e4231796c281c128ac1ae50825237b1774deb542bdc704b32
commit: 8bc2c51e08c447cd8886cdea48a73e14
digest: b5:b7e0ac9d192bd0eae88160101269550281448c51f25121cd0d51957661a350aab07001bc145fe9029a8da10b99ff000ae5b284ecaca9c75f2a99604a04d9b4ab
2 changes: 1 addition & 1 deletion api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ breaking:
- FILE
deps:
- buf.build/googleapis/googleapis
- buf.build/envoyproxy/protoc-gen-validate
- buf.build/bufbuild/protovalidate
Loading

0 comments on commit 7a002b5

Please sign in to comment.