Skip to content

Commit fd403b0

Browse files
authored
fix: update proton and migrate to runtime proto validation (#1490)
1 parent f355239 commit fd403b0

25 files changed

Lines changed: 6333 additions & 87796 deletions

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TAG := $(shell git rev-list --tags --max-count=1)
44
VERSION := $(shell git describe --tags ${TAG})
55
.PHONY: build check fmt lint test test-race vet test-cover-html help install proto admin-app compose-up-dev
66
.DEFAULT_GOAL := build
7-
PROTON_COMMIT := "eeb82738610b07efaf8f8205c3b00f8b774cf31e"
7+
PROTON_COMMIT := "0b6548e706d14b39f4d2dbd44567d6d4c2c3159e"
88

99
admin-app:
1010
@echo " > generating admin build"

‎buf.gen.yaml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ managed:
44
enabled: true
55
disable:
66
- module: buf.build/googleapis/googleapis
7-
- module: buf.build/envoyproxy/protoc-gen-validate
7+
- file_option: go_package
8+
module: buf.build/bufbuild/protovalidate
89
override:
910
- file_option: "go_package"
1011
value: "github.com/raystack/frontier/proto/v1beta1;frontierv1beta1"
1112
plugins:
1213
- remote: "buf.build/protocolbuffers/go:v1.30.0"
1314
out: "proto"
1415
opt: "paths=source_relative"
15-
- remote: "buf.build/bufbuild/validate-go:v1.0.0"
16-
out: "proto"
17-
opt: "paths=source_relative"
1816
- remote: buf.build/connectrpc/go:v1.18.1
1917
out: "proto"
2018
opt: "paths=source_relative"

‎cmd/group.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ func createGroupCommand(cliConfig *Config) *cli.Command {
6464
return err
6565
}
6666

67-
err := reqBody.ValidateAll()
68-
if err != nil {
69-
return err
70-
}
71-
7267
client, err := createClient(cliConfig.Host)
7368
if err != nil {
7469
return err
@@ -121,11 +116,6 @@ func editGroupCommand(cliConfig *Config) *cli.Command {
121116
return err
122117
}
123118

124-
err := reqBody.ValidateAll()
125-
if err != nil {
126-
return err
127-
}
128-
129119
client, err := createClient(cliConfig.Host)
130120
if err != nil {
131121
return err

‎cmd/organization.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ func createOrganizationCommand(cliConfig *Config) *cli.Command {
6565
return err
6666
}
6767

68-
err := reqBody.ValidateAll()
69-
if err != nil {
70-
return err
71-
}
72-
7368
client, err := createClient(cliConfig.Host)
7469
if err != nil {
7570
return err
@@ -122,11 +117,6 @@ func editOrganizationCommand(cliConfig *Config) *cli.Command {
122117
return err
123118
}
124119

125-
err := reqBody.ValidateAll()
126-
if err != nil {
127-
return err
128-
}
129-
130120
client, err := createClient(cliConfig.Host)
131121
if err != nil {
132122
return err

‎cmd/permission.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ func createPermissionCommand(cliConfig *Config) *cli.Command {
6464
return err
6565
}
6666

67-
err := reqBody.ValidateAll()
68-
if err != nil {
69-
return err
70-
}
71-
7267
client, err := createAdminClient(cliConfig.Host)
7368
if err != nil {
7469
return err
@@ -121,11 +116,6 @@ func editPermissionCommand(cliConfig *Config) *cli.Command {
121116
return err
122117
}
123118

124-
err := reqBody.ValidateAll()
125-
if err != nil {
126-
return err
127-
}
128-
129119
client, err := createAdminClient(cliConfig.Host)
130120
if err != nil {
131121
return err

‎cmd/policy.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ func createPolicyCommand(cliConfig *Config) *cli.Command {
6262
return err
6363
}
6464

65-
err := reqBody.ValidateAll()
66-
if err != nil {
67-
return err
68-
}
69-
7065
client, err := createClient(cliConfig.Host)
7166
if err != nil {
7267
return err
@@ -119,11 +114,6 @@ func editPolicyCommand(cliConfig *Config) *cli.Command {
119114
return err
120115
}
121116

122-
err := reqBody.ValidateAll()
123-
if err != nil {
124-
return err
125-
}
126-
127117
client, err := createClient(cliConfig.Host)
128118
if err != nil {
129119
return err

‎cmd/project.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ func createProjectCommand(cliConfig *Config) *cli.Command {
6464
return err
6565
}
6666

67-
err := reqBody.ValidateAll()
68-
if err != nil {
69-
return err
70-
}
71-
7267
client, err := createClient(cliConfig.Host)
7368
if err != nil {
7469
return err
@@ -121,11 +116,6 @@ func editProjectCommand(cliConfig *Config) *cli.Command {
121116
return err
122117
}
123118

124-
err := reqBody.ValidateAll()
125-
if err != nil {
126-
return err
127-
}
128-
129119
client, err := createClient(cliConfig.Host)
130120
if err != nil {
131121
return err

‎cmd/role.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ func createRoleCommand(cliConfig *Config) *cli.Command {
6565
return err
6666
}
6767

68-
err := reqBody.ValidateAll()
69-
if err != nil {
70-
return err
71-
}
72-
7368
client, err := createClient(cliConfig.Host)
7469
if err != nil {
7570
return err
@@ -122,11 +117,6 @@ func editRoleCommand(cliConfig *Config) *cli.Command {
122117
return err
123118
}
124119

125-
err := reqBody.ValidateAll()
126-
if err != nil {
127-
return err
128-
}
129-
130120
client, err := createClient(cliConfig.Host)
131121
if err != nil {
132122
return err

‎cmd/user.go‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ func createUserCommand(cliConfig *Config) *cli.Command {
6565
return err
6666
}
6767

68-
err := reqBody.ValidateAll()
69-
if err != nil {
70-
return err
71-
}
72-
7368
if reqBody.GetName() == "" {
7469
reqBody.Name = str.GenerateUserSlug(reqBody.GetEmail())
7570
}
@@ -127,11 +122,6 @@ func editUserCommand(cliConfig *Config) *cli.Command {
127122
return err
128123
}
129124

130-
err := reqBody.ValidateAll()
131-
if err != nil {
132-
return err
133-
}
134-
135125
client, err := createClient(cliConfig.Host)
136126
if err != nil {
137127
return err

‎go.mod‎

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
module github.com/raystack/frontier
22

3-
go 1.23.0
3+
go 1.24.0
44

55
require (
6-
connectrpc.com/connect v1.18.1
6+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1
7+
connectrpc.com/connect v1.19.0
78
connectrpc.com/cors v0.1.0
89
connectrpc.com/grpchealth v1.4.0
910
connectrpc.com/grpcreflect v1.3.0
1011
connectrpc.com/otelconnect v0.7.2
12+
connectrpc.com/validate v0.6.0
1113
github.com/MakeNowJust/heredoc v1.0.0
1214
github.com/authzed/authzed-go v0.11.2-0.20240507202708-8b150c491e4a
1315
github.com/authzed/grpcutil v0.0.0-20240123092924-129dc0a6a6e1
1416
github.com/authzed/spicedb v1.33.1
1517
github.com/cespare/xxhash v1.1.0
1618
github.com/coreos/go-oidc/v3 v3.5.0
1719
github.com/doug-martin/goqu/v9 v9.18.0
18-
github.com/envoyproxy/protoc-gen-validate v1.1.0
1920
github.com/ghodss/yaml v1.0.0
2021
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48
2122
github.com/go-webauthn/webauthn v0.8.6
@@ -43,30 +44,32 @@ require (
4344
github.com/robfig/cron/v3 v3.0.1
4445
github.com/rs/cors v1.11.1
4546
github.com/spf13/cobra v1.8.1
46-
github.com/stretchr/testify v1.10.0
47+
github.com/stretchr/testify v1.11.1
4748
github.com/stripe/stripe-go/v79 v79.5.0
4849
github.com/ua-parser/uap-go v0.0.0-20250917011043-9c86a9b0f8f0
4950
go.opentelemetry.io/otel/sdk/metric v1.37.0
5051
go.uber.org/zap v1.26.0
5152
gocloud.dev v0.28.0
52-
golang.org/x/net v0.42.0
53+
golang.org/x/net v0.44.0
5354
golang.org/x/oauth2 v0.30.0
54-
golang.org/x/sync v0.16.0
55-
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9
56-
google.golang.org/grpc v1.67.1
57-
google.golang.org/protobuf v1.36.6
55+
golang.org/x/sync v0.17.0
56+
google.golang.org/genproto/googleapis/api v0.0.0-20250922171735-9219d122eba9
57+
google.golang.org/grpc v1.71.0
58+
google.golang.org/protobuf v1.36.11
5859
gopkg.in/dnaeon/go-vcr.v3 v3.1.2
5960
gopkg.in/mail.v2 v2.3.1
6061
gopkg.in/yaml.v2 v2.4.0
6162
gopkg.in/yaml.v3 v3.0.1
6263
)
6364

6465
require (
66+
buf.build/go/protovalidate v1.0.0 // indirect
67+
cel.dev/expr v0.24.0 // indirect
6568
cloud.google.com/go/auth v0.3.0 // indirect
6669
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
6770
dario.cat/mergo v1.0.0 // indirect
6871
filippo.io/edwards25519 v1.1.0 // indirect
69-
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
72+
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
7073
github.com/authzed/cel-go v0.20.2 // indirect
7174
github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect
7275
github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect
@@ -87,6 +90,7 @@ require (
8790
github.com/creasty/defaults v1.7.0 // indirect
8891
github.com/distribution/reference v0.6.0 // indirect
8992
github.com/ecordell/optgen v0.0.10-0.20230609182709-018141bf9698 // indirect
93+
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
9094
github.com/felixge/httpsnoop v1.0.4 // indirect
9195
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
9296
github.com/go-errors/errors v1.5.1 // indirect
@@ -99,6 +103,7 @@ require (
99103
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
100104
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
101105
github.com/golang/protobuf v1.5.4 // indirect
106+
github.com/google/cel-go v0.26.1 // indirect
102107
github.com/google/go-tpm v0.9.0 // indirect
103108
github.com/google/s2a-go v0.1.7 // indirect
104109
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
@@ -123,18 +128,18 @@ require (
123128
go.opentelemetry.io/otel/metric v1.37.0 // indirect
124129
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
125130
go.opentelemetry.io/otel/trace v1.37.0 // indirect
126-
golang.org/x/mod v0.25.0 // indirect
131+
golang.org/x/mod v0.28.0 // indirect
127132
golang.org/x/time v0.5.0 // indirect
128-
golang.org/x/tools v0.34.0 // indirect
133+
golang.org/x/tools v0.37.0 // indirect
129134
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
130-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
135+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250922171735-9219d122eba9 // indirect
131136
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
132137
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
133138
)
134139

135140
require (
136141
cloud.google.com/go v0.112.2 // indirect
137-
cloud.google.com/go/compute/metadata v0.5.0 // indirect
142+
cloud.google.com/go/compute/metadata v0.6.0 // indirect
138143
cloud.google.com/go/iam v1.1.7 // indirect
139144
cloud.google.com/go/storage v1.39.1 // indirect
140145
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
@@ -225,7 +230,7 @@ require (
225230
github.com/spf13/cast v1.6.0
226231
github.com/spf13/pflag v1.0.5 // indirect
227232
github.com/spf13/viper v1.19.0 // indirect
228-
github.com/stoewer/go-strcase v1.3.0 // indirect
233+
github.com/stoewer/go-strcase v1.3.1 // indirect
229234
github.com/stretchr/objx v0.5.2 // indirect
230235
github.com/subosito/gotenv v1.6.0 // indirect
231236
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
@@ -236,11 +241,11 @@ require (
236241
go.opentelemetry.io/otel/exporters/prometheus v0.59.0
237242
go.uber.org/atomic v1.11.0 // indirect
238243
go.uber.org/multierr v1.11.0 // indirect
239-
golang.org/x/crypto v0.40.0
240-
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
241-
golang.org/x/sys v0.34.0 // indirect
242-
golang.org/x/term v0.33.0 // indirect
243-
golang.org/x/text v0.27.0 // indirect
244+
golang.org/x/crypto v0.42.0
245+
golang.org/x/exp v0.0.0-20250911091902-df9299821621
246+
golang.org/x/sys v0.36.0 // indirect
247+
golang.org/x/term v0.35.0 // indirect
248+
golang.org/x/text v0.29.0 // indirect
244249
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
245250
google.golang.org/api v0.176.1 // indirect
246251
gopkg.in/ini.v1 v1.67.0 // indirect

0 commit comments

Comments
 (0)