diff --git a/.gitignore b/.gitignore index 58b7cddb2e..7170d648ab 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ # vendor/ # Go workspace file -go.work +#go.work tmp/ .DS_Store diff --git a/.golangci.yml b/.golangci.yml index a5bc252591..f46c10bd69 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,7 +11,9 @@ run: # Timeout for analysis, e.g. 30s, 5m. # Default: 1m timeout: 5m - + skip-files: + - ".*\\.pb\\.go" + - ".*\\.pb\\.gw.go" # This file contains only configs which differ from defaults. # All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml diff --git a/buf.gen.yaml b/buf.gen.yaml index 05de0e19f8..04d5270e57 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -2,23 +2,23 @@ version: v1 managed: enabled: true go_package_prefix: - default: github.com/opentdf/opentdf-v2-poc/gen + default: github.com/opentdf/opentdf-v2-poc/sdk except: - buf.build/bufbuild/protovalidate - buf.build/googleapis/googleapis - buf.build/grpc-ecosystem/grpc-gateway plugins: - plugin: buf.build/grpc-ecosystem/gateway:v2.18.1 - out: gen + out: sdk opt: - paths=source_relative # dependencies - plugin: buf.build/protocolbuffers/go:v1.31.0 - out: gen + out: sdk opt: - paths=source_relative - plugin: buf.build/grpc/go:v1.3.0 - out: gen + out: sdk opt: - paths=source_relative # - plugin: buf.build/grpc-ecosystem/openapiv2:v2.18.1 diff --git a/cmd/start.go b/cmd/start.go index 8acd25a1d8..d014c7070f 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -16,10 +16,10 @@ import ( "github.com/opentdf/opentdf-v2-poc/internal/logger" "github.com/opentdf/opentdf-v2-poc/internal/opa" "github.com/opentdf/opentdf-v2-poc/internal/server" - "github.com/opentdf/opentdf-v2-poc/pkg/services/acre" - "github.com/opentdf/opentdf-v2-poc/pkg/services/acse" - "github.com/opentdf/opentdf-v2-poc/pkg/services/attributes" - "github.com/opentdf/opentdf-v2-poc/pkg/services/keyaccessgrants" + "github.com/opentdf/opentdf-v2-poc/services/acre" + "github.com/opentdf/opentdf-v2-poc/services/acse" + "github.com/opentdf/opentdf-v2-poc/services/attributes" + "github.com/opentdf/opentdf-v2-poc/services/keyaccessgrants" "github.com/spf13/cobra" ) diff --git a/examples/attributes/go.mod b/examples/attributes/go.mod new file mode 100644 index 0000000000..16e5c3bc9e --- /dev/null +++ b/examples/attributes/go.mod @@ -0,0 +1,23 @@ +module github.com/opentdf/opentdf-v2-poc/examples/attributes + +go 1.21.5 + +replace github.com/opentdf/opentdf-v2-poc/sdk => ../../sdk + +require ( + github.com/opentdf/opentdf-v2-poc/sdk v0.0.0-00010101000000-000000000000 + google.golang.org/grpc v1.60.1 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/protobuf v1.31.0 // indirect +) diff --git a/examples/attributes/go.sum b/examples/attributes/go.sum new file mode 100644 index 0000000000..6931951df4 --- /dev/null +++ b/examples/attributes/go.sum @@ -0,0 +1,29 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 h1:iEPA5SBtdLJNwQis/SrcCuDWJh5E1V0mVO4Ih7/mRbg= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/examples/go/attributes/main.go b/examples/attributes/main.go similarity index 72% rename from examples/go/attributes/main.go rename to examples/attributes/main.go index 1041c51146..d2bf0273de 100644 --- a/examples/go/attributes/main.go +++ b/examples/attributes/main.go @@ -5,10 +5,9 @@ import ( "log/slog" "os" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" + "github.com/opentdf/opentdf-v2-poc/sdk" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" ) func main() { @@ -33,16 +32,14 @@ func main() { }, } - conn, err := grpc.Dial("localhost:9000", grpc.WithTransportCredentials(insecure.NewCredentials())) + s, err := sdk.New("localhost:9000", sdk.WithInsecureConn()) if err != nil { slog.Error("could not connect", slog.String("error", err.Error())) os.Exit(1) } - defer conn.Close() + defer s.Close() - attrClient := attributes.NewAttributesServiceClient(conn) - - _, err = attrClient.CreateAttribute(context.Background(), &attributes.CreateAttributeRequest{ + _, err = s.Attributes.CreateAttribute(context.Background(), &attributes.CreateAttributeRequest{ Definition: &definition, }) if err != nil { @@ -52,7 +49,7 @@ func main() { slog.Info("attribute created") - allAttr, err := attrClient.ListAttributes(context.Background(), &attributes.ListAttributesRequest{}) + allAttr, err := s.Attributes.ListAttributes(context.Background(), &attributes.ListAttributesRequest{}) if err != nil { slog.Error("could not list attributes", slog.String("error", err.Error())) os.Exit(1) diff --git a/go.mod b/go.mod index 4526934e6c..5206d28566 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,10 @@ module github.com/opentdf/opentdf-v2-poc -go 1.21 +go 1.21.5 + +replace github.com/opentdf/opentdf-v2-poc/sdk => ./sdk require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 github.com/Masterminds/squirrel v1.5.4 github.com/bufbuild/protovalidate-go v0.4.3 github.com/creasty/defaults v1.7.0 @@ -12,17 +13,19 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 github.com/jackc/pgx/v5 v5.5.0 github.com/open-policy-agent/opa v0.59.0 + github.com/opentdf/opentdf-v2-poc/sdk v0.0.0-00010101000000-000000000000 github.com/pressly/goose/v3 v3.16.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.1 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.26.0 github.com/valyala/fasthttp v1.51.0 - google.golang.org/grpc v1.59.0 + google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.31.0 ) require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 // indirect dario.cat/mergo v1.0.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect @@ -126,6 +129,6 @@ require ( golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect ) diff --git a/go.sum b/go.sum index b29d19c087..f8a6b8de8d 100644 --- a/go.sum +++ b/go.sum @@ -396,8 +396,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1: google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/go.work b/go.work new file mode 100644 index 0000000000..f32d7a0cc1 --- /dev/null +++ b/go.work @@ -0,0 +1,7 @@ +go 1.21.5 + +use ( + . + ./examples/attributes + ./sdk +) diff --git a/internal/db/db.go b/internal/db/db.go index 43b5f3b715..5f35bdaac2 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -13,8 +13,8 @@ import ( "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" "github.com/jackc/pgx/v5/stdlib" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/migrations" + "github.com/opentdf/opentdf-v2-poc/sdk/common" "github.com/pressly/goose/v3" ) diff --git a/internal/db/db_test.go b/internal/db/db_test.go index 5a1384cc73..19d3f29d33 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -8,8 +8,8 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" - "github.com/opentdf/opentdf-v2-poc/gen/acre" - "github.com/opentdf/opentdf-v2-poc/gen/common" + "github.com/opentdf/opentdf-v2-poc/sdk/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/common" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/encoding/protojson" ) diff --git a/internal/opa/mockBundleServer.go b/internal/opa/mock_bundle_server.go similarity index 100% rename from internal/opa/mockBundleServer.go rename to internal/opa/mock_bundle_server.go diff --git a/proto/key_access_grants/key_access_grants.proto b/proto/keyaccessgrants/key_access_grants.proto similarity index 99% rename from proto/key_access_grants/key_access_grants.proto rename to proto/keyaccessgrants/key_access_grants.proto index 4362cee884..c3a993223b 100644 --- a/proto/key_access_grants/key_access_grants.proto +++ b/proto/keyaccessgrants/key_access_grants.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package key_access_grants; +package keyaccessgrants; import "attributes/attributes.proto"; import "buf/validate/validate.proto"; diff --git a/gen/acre/acre.pb.go b/sdk/acre/acre.pb.go similarity index 99% rename from gen/acre/acre.pb.go rename to sdk/acre/acre.pb.go index 0268910c22..cc3874fd75 100644 --- a/gen/acre/acre.pb.go +++ b/sdk/acre/acre.pb.go @@ -8,8 +8,8 @@ package acre import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - attributes "github.com/opentdf/opentdf-v2-poc/gen/attributes" - common "github.com/opentdf/opentdf-v2-poc/gen/common" + attributes "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + common "github.com/opentdf/opentdf-v2-poc/sdk/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -2107,8 +2107,8 @@ var file_acre_acre_proto_rawDesc = []byte{ 0x64, 0x7d, 0x42, 0x71, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x63, 0x72, 0x65, 0x42, 0x09, 0x41, 0x63, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, - 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, + 0x64, 0x6b, 0x2f, 0x61, 0x63, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x41, 0x63, 0x72, 0x65, 0xca, 0x02, 0x04, 0x41, 0x63, 0x72, 0x65, 0xe2, 0x02, 0x10, 0x41, 0x63, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x41, 0x63, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, diff --git a/gen/acre/acre.pb.gw.go b/sdk/acre/acre.pb.gw.go similarity index 100% rename from gen/acre/acre.pb.gw.go rename to sdk/acre/acre.pb.gw.go diff --git a/gen/acre/acre_grpc.pb.go b/sdk/acre/acre_grpc.pb.go similarity index 100% rename from gen/acre/acre_grpc.pb.go rename to sdk/acre/acre_grpc.pb.go diff --git a/gen/acse/acse.pb.go b/sdk/acse/acse.pb.go similarity index 99% rename from gen/acse/acse.pb.go rename to sdk/acse/acse.pb.go index 98552399e3..6546b9986f 100644 --- a/gen/acse/acse.pb.go +++ b/sdk/acse/acse.pb.go @@ -8,8 +8,8 @@ package acse import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - attributes "github.com/opentdf/opentdf-v2-poc/gen/attributes" - common "github.com/opentdf/opentdf-v2-poc/gen/common" + attributes "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + common "github.com/opentdf/opentdf-v2-poc/sdk/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -751,7 +751,7 @@ var file_acse_acse_proto_rawDesc = []byte{ 0x09, 0x41, 0x63, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x73, 0x65, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, + 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x63, 0x73, 0x65, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x41, 0x63, 0x73, 0x65, 0xca, 0x02, 0x04, 0x41, 0x63, 0x73, 0x65, 0xe2, 0x02, 0x10, 0x41, 0x63, 0x73, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x41, 0x63, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, diff --git a/gen/acse/acse.pb.gw.go b/sdk/acse/acse.pb.gw.go similarity index 100% rename from gen/acse/acse.pb.gw.go rename to sdk/acse/acse.pb.gw.go diff --git a/gen/acse/acse_grpc.pb.go b/sdk/acse/acse_grpc.pb.go similarity index 100% rename from gen/acse/acse_grpc.pb.go rename to sdk/acse/acse_grpc.pb.go diff --git a/gen/attributes/attributes.pb.go b/sdk/attributes/attributes.pb.go similarity index 99% rename from gen/attributes/attributes.pb.go rename to sdk/attributes/attributes.pb.go index a3f293485a..8f865a9451 100644 --- a/gen/attributes/attributes.pb.go +++ b/sdk/attributes/attributes.pb.go @@ -8,7 +8,7 @@ package attributes import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - common "github.com/opentdf/opentdf-v2-poc/gen/common" + common "github.com/opentdf/opentdf-v2-poc/sdk/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -1686,7 +1686,7 @@ var file_attributes_attributes_proto_rawDesc = []byte{ 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, - 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0xca, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0xe2, 0x02, 0x16, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, diff --git a/gen/attributes/attributes.pb.gw.go b/sdk/attributes/attributes.pb.gw.go similarity index 100% rename from gen/attributes/attributes.pb.gw.go rename to sdk/attributes/attributes.pb.gw.go diff --git a/gen/attributes/attributes_grpc.pb.go b/sdk/attributes/attributes_grpc.pb.go similarity index 100% rename from gen/attributes/attributes_grpc.pb.go rename to sdk/attributes/attributes_grpc.pb.go diff --git a/gen/authorization/authorization.pb.go b/sdk/authorization/authorization.pb.go similarity index 99% rename from gen/authorization/authorization.pb.go rename to sdk/authorization/authorization.pb.go index aa8d16cade..82797c5acd 100644 --- a/gen/authorization/authorization.pb.go +++ b/sdk/authorization/authorization.pb.go @@ -7,7 +7,7 @@ package authorization import ( - attributes "github.com/opentdf/opentdf-v2-poc/gen/attributes" + attributes "github.com/opentdf/opentdf-v2-poc/sdk/attributes" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -1181,7 +1181,7 @@ var file_authorization_authorization_proto_rawDesc = []byte{ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, - 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, diff --git a/gen/authorization/authorization.pb.gw.go b/sdk/authorization/authorization.pb.gw.go similarity index 100% rename from gen/authorization/authorization.pb.gw.go rename to sdk/authorization/authorization.pb.gw.go diff --git a/gen/authorization/authorization_grpc.pb.go b/sdk/authorization/authorization_grpc.pb.go similarity index 100% rename from gen/authorization/authorization_grpc.pb.go rename to sdk/authorization/authorization_grpc.pb.go diff --git a/gen/common/common.pb.go b/sdk/common/common.pb.go similarity index 99% rename from gen/common/common.pb.go rename to sdk/common/common.pb.go index ae73dd1c44..c11e10315a 100644 --- a/gen/common/common.pb.go +++ b/sdk/common/common.pb.go @@ -560,8 +560,8 @@ var file_common_common_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, - 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, + 0x64, 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, diff --git a/sdk/go.mod b/sdk/go.mod new file mode 100644 index 0000000000..2c4cf48893 --- /dev/null +++ b/sdk/go.mod @@ -0,0 +1,20 @@ +module github.com/opentdf/opentdf-v2-poc/sdk + +go 1.21.5 + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 + google.golang.org/grpc v1.60.1 + google.golang.org/protobuf v1.31.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect +) diff --git a/sdk/go.sum b/sdk/go.sum new file mode 100644 index 0000000000..6931951df4 --- /dev/null +++ b/sdk/go.sum @@ -0,0 +1,29 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2 h1:iEPA5SBtdLJNwQis/SrcCuDWJh5E1V0mVO4Ih7/mRbg= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231115204500-e097f827e652.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/gen/key_access_grants/key_access_grants.pb.go b/sdk/keyaccessgrants/key_access_grants.pb.go similarity index 50% rename from gen/key_access_grants/key_access_grants.pb.go rename to sdk/keyaccessgrants/key_access_grants.pb.go index 963ca4d06d..f4beae78ef 100644 --- a/gen/key_access_grants/key_access_grants.pb.go +++ b/sdk/keyaccessgrants/key_access_grants.pb.go @@ -2,14 +2,14 @@ // versions: // protoc-gen-go v1.31.0 // protoc (unknown) -// source: key_access_grants/key_access_grants.proto +// source: keyaccessgrants/key_access_grants.proto -package key_access_grants +package keyaccessgrants import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - attributes "github.com/opentdf/opentdf-v2-poc/gen/attributes" - common "github.com/opentdf/opentdf-v2-poc/gen/common" + attributes "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + common "github.com/opentdf/opentdf-v2-poc/sdk/common" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -40,7 +40,7 @@ type KeyAccessServer struct { func (x *KeyAccessServer) Reset() { *x = KeyAccessServer{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[0] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -53,7 +53,7 @@ func (x *KeyAccessServer) String() string { func (*KeyAccessServer) ProtoMessage() {} func (x *KeyAccessServer) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[0] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -66,7 +66,7 @@ func (x *KeyAccessServer) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyAccessServer.ProtoReflect.Descriptor instead. func (*KeyAccessServer) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{0} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{0} } func (x *KeyAccessServer) GetDescriptor_() *common.ResourceDescriptor { @@ -111,7 +111,7 @@ type KeyAccessGrants struct { func (x *KeyAccessGrants) Reset() { *x = KeyAccessGrants{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[1] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -124,7 +124,7 @@ func (x *KeyAccessGrants) String() string { func (*KeyAccessGrants) ProtoMessage() {} func (x *KeyAccessGrants) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[1] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -137,7 +137,7 @@ func (x *KeyAccessGrants) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyAccessGrants.ProtoReflect.Descriptor instead. func (*KeyAccessGrants) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{1} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{1} } func (x *KeyAccessGrants) GetDescriptor_() *common.ResourceDescriptor { @@ -199,7 +199,7 @@ type KeyAccessGrant struct { func (x *KeyAccessGrant) Reset() { *x = KeyAccessGrant{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[2] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -212,7 +212,7 @@ func (x *KeyAccessGrant) String() string { func (*KeyAccessGrant) ProtoMessage() {} func (x *KeyAccessGrant) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[2] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -225,7 +225,7 @@ func (x *KeyAccessGrant) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyAccessGrant.ProtoReflect.Descriptor instead. func (*KeyAccessGrant) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{2} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{2} } func (x *KeyAccessGrant) GetAttributeDefinition() *attributes.AttributeDefinition { @@ -266,7 +266,7 @@ type KeyAccessGrantAttributeValue struct { func (x *KeyAccessGrantAttributeValue) Reset() { *x = KeyAccessGrantAttributeValue{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[3] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +279,7 @@ func (x *KeyAccessGrantAttributeValue) String() string { func (*KeyAccessGrantAttributeValue) ProtoMessage() {} func (x *KeyAccessGrantAttributeValue) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[3] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +292,7 @@ func (x *KeyAccessGrantAttributeValue) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyAccessGrantAttributeValue.ProtoReflect.Descriptor instead. func (*KeyAccessGrantAttributeValue) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{3} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{3} } func (x *KeyAccessGrantAttributeValue) GetValue() *attributes.AttributeValueReference { @@ -320,7 +320,7 @@ type GetKeyAccessGrantRequest struct { func (x *GetKeyAccessGrantRequest) Reset() { *x = GetKeyAccessGrantRequest{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[4] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -333,7 +333,7 @@ func (x *GetKeyAccessGrantRequest) String() string { func (*GetKeyAccessGrantRequest) ProtoMessage() {} func (x *GetKeyAccessGrantRequest) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[4] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -346,7 +346,7 @@ func (x *GetKeyAccessGrantRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetKeyAccessGrantRequest.ProtoReflect.Descriptor instead. func (*GetKeyAccessGrantRequest) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{4} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{4} } func (x *GetKeyAccessGrantRequest) GetId() int32 { @@ -367,7 +367,7 @@ type GetKeyAccessGrantResponse struct { func (x *GetKeyAccessGrantResponse) Reset() { *x = GetKeyAccessGrantResponse{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[5] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -380,7 +380,7 @@ func (x *GetKeyAccessGrantResponse) String() string { func (*GetKeyAccessGrantResponse) ProtoMessage() {} func (x *GetKeyAccessGrantResponse) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[5] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -393,7 +393,7 @@ func (x *GetKeyAccessGrantResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetKeyAccessGrantResponse.ProtoReflect.Descriptor instead. func (*GetKeyAccessGrantResponse) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{5} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{5} } func (x *GetKeyAccessGrantResponse) GetGrants() *KeyAccessGrants { @@ -414,7 +414,7 @@ type ListKeyAccessGrantsRequest struct { func (x *ListKeyAccessGrantsRequest) Reset() { *x = ListKeyAccessGrantsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[6] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -427,7 +427,7 @@ func (x *ListKeyAccessGrantsRequest) String() string { func (*ListKeyAccessGrantsRequest) ProtoMessage() {} func (x *ListKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[6] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -440,7 +440,7 @@ func (x *ListKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListKeyAccessGrantsRequest.ProtoReflect.Descriptor instead. func (*ListKeyAccessGrantsRequest) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{6} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{6} } func (x *ListKeyAccessGrantsRequest) GetSelector() *common.ResourceSelector { @@ -461,7 +461,7 @@ type ListKeyAccessGrantsResponse struct { func (x *ListKeyAccessGrantsResponse) Reset() { *x = ListKeyAccessGrantsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[7] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -474,7 +474,7 @@ func (x *ListKeyAccessGrantsResponse) String() string { func (*ListKeyAccessGrantsResponse) ProtoMessage() {} func (x *ListKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[7] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -487,7 +487,7 @@ func (x *ListKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListKeyAccessGrantsResponse.ProtoReflect.Descriptor instead. func (*ListKeyAccessGrantsResponse) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{7} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{7} } func (x *ListKeyAccessGrantsResponse) GetGrants() []*KeyAccessGrants { @@ -508,7 +508,7 @@ type CreateKeyAccessGrantsRequest struct { func (x *CreateKeyAccessGrantsRequest) Reset() { *x = CreateKeyAccessGrantsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[8] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -521,7 +521,7 @@ func (x *CreateKeyAccessGrantsRequest) String() string { func (*CreateKeyAccessGrantsRequest) ProtoMessage() {} func (x *CreateKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[8] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -534,7 +534,7 @@ func (x *CreateKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateKeyAccessGrantsRequest.ProtoReflect.Descriptor instead. func (*CreateKeyAccessGrantsRequest) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{8} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{8} } func (x *CreateKeyAccessGrantsRequest) GetGrants() *KeyAccessGrants { @@ -553,7 +553,7 @@ type CreateKeyAccessGrantsResponse struct { func (x *CreateKeyAccessGrantsResponse) Reset() { *x = CreateKeyAccessGrantsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[9] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -566,7 +566,7 @@ func (x *CreateKeyAccessGrantsResponse) String() string { func (*CreateKeyAccessGrantsResponse) ProtoMessage() {} func (x *CreateKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[9] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -579,7 +579,7 @@ func (x *CreateKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateKeyAccessGrantsResponse.ProtoReflect.Descriptor instead. func (*CreateKeyAccessGrantsResponse) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{9} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{9} } type UpdateKeyAccessGrantsRequest struct { @@ -594,7 +594,7 @@ type UpdateKeyAccessGrantsRequest struct { func (x *UpdateKeyAccessGrantsRequest) Reset() { *x = UpdateKeyAccessGrantsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[10] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -607,7 +607,7 @@ func (x *UpdateKeyAccessGrantsRequest) String() string { func (*UpdateKeyAccessGrantsRequest) ProtoMessage() {} func (x *UpdateKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[10] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -620,7 +620,7 @@ func (x *UpdateKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateKeyAccessGrantsRequest.ProtoReflect.Descriptor instead. func (*UpdateKeyAccessGrantsRequest) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{10} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{10} } func (x *UpdateKeyAccessGrantsRequest) GetId() int32 { @@ -646,7 +646,7 @@ type UpdateKeyAccessGrantsResponse struct { func (x *UpdateKeyAccessGrantsResponse) Reset() { *x = UpdateKeyAccessGrantsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[11] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -659,7 +659,7 @@ func (x *UpdateKeyAccessGrantsResponse) String() string { func (*UpdateKeyAccessGrantsResponse) ProtoMessage() {} func (x *UpdateKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[11] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -672,7 +672,7 @@ func (x *UpdateKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateKeyAccessGrantsResponse.ProtoReflect.Descriptor instead. func (*UpdateKeyAccessGrantsResponse) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{11} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{11} } type DeleteKeyAccessGrantsRequest struct { @@ -686,7 +686,7 @@ type DeleteKeyAccessGrantsRequest struct { func (x *DeleteKeyAccessGrantsRequest) Reset() { *x = DeleteKeyAccessGrantsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[12] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -699,7 +699,7 @@ func (x *DeleteKeyAccessGrantsRequest) String() string { func (*DeleteKeyAccessGrantsRequest) ProtoMessage() {} func (x *DeleteKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[12] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -712,7 +712,7 @@ func (x *DeleteKeyAccessGrantsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteKeyAccessGrantsRequest.ProtoReflect.Descriptor instead. func (*DeleteKeyAccessGrantsRequest) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{12} + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{12} } func (x *DeleteKeyAccessGrantsRequest) GetId() int32 { @@ -731,7 +731,7 @@ type DeleteKeyAccessGrantsResponse struct { func (x *DeleteKeyAccessGrantsResponse) Reset() { *x = DeleteKeyAccessGrantsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[13] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -744,7 +744,7 @@ func (x *DeleteKeyAccessGrantsResponse) String() string { func (*DeleteKeyAccessGrantsResponse) ProtoMessage() {} func (x *DeleteKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_key_access_grants_key_access_grants_proto_msgTypes[13] + mi := &file_keyaccessgrants_key_access_grants_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -757,252 +757,249 @@ func (x *DeleteKeyAccessGrantsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteKeyAccessGrantsResponse.ProtoReflect.Descriptor instead. func (*DeleteKeyAccessGrantsResponse) Descriptor() ([]byte, []int) { - return file_key_access_grants_key_access_grants_proto_rawDescGZIP(), []int{13} -} - -var File_key_access_grants_key_access_grants_proto protoreflect.FileDescriptor - -var file_key_access_grants_key_access_grants_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6b, 0x65, 0x79, - 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x1a, 0x1b, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x62, 0x75, 0x66, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x0f, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, - 0x3a, 0x0a, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, - 0x0a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x87, 0x03, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xf4, 0x02, 0xba, 0x48, 0xf0, 0x02, - 0xba, 0x01, 0xe9, 0x02, 0x0a, 0x0a, 0x66, 0x71, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x12, 0xd7, 0x01, 0x46, 0x51, 0x4e, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x55, - 0x52, 0x4c, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x27, 0x68, 0x74, 0x74, 0x70, 0x73, - 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x27, 0x29, 0x20, 0x66, - 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, - 0x45, 0x61, 0x63, 0x68, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, - 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, - 0x65, 0x72, 0x69, 0x63, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x2c, 0x20, - 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x68, 0x79, 0x70, 0x68, - 0x65, 0x6e, 0x73, 0x2c, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, - 0x63, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x80, 0x01, 0x74, 0x68, 0x69, - 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x68, 0x74, 0x74, 0x70, - 0x73, 0x3a, 0x2f, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, - 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, - 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, - 0x3f, 0x28, 0x5c, 0x5c, 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, - 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, - 0x30, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, - 0x29, 0x3f, 0x29, 0x2a, 0x28, 0x2f, 0x2e, 0x2a, 0x29, 0x3f, 0x24, 0x27, 0x29, 0xc8, 0x01, 0x01, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x22, 0xee, 0x01, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x12, 0x50, 0x0a, 0x12, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x10, 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x52, 0x0f, 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x52, 0x0a, 0x14, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x65, 0x0a, 0x16, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6b, - 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x14, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x22, 0x72, 0x0a, 0x1c, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + return file_keyaccessgrants_key_access_grants_proto_rawDescGZIP(), []int{13} +} + +var File_keyaccessgrants_key_access_grants_proto protoreflect.FileDescriptor + +var file_keyaccessgrants_key_access_grants_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6b, 0x65, 0x79, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x1a, 0x1b, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x87, 0x03, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xf4, 0x02, 0xba, 0x48, 0xf0, 0x02, 0xba, 0x01, 0xe9, 0x02, + 0x0a, 0x0a, 0x66, 0x71, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0xd7, 0x01, 0x46, + 0x51, 0x4e, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x28, + 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x27, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, + 0x65, 0x6d, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x27, 0x29, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x45, 0x61, 0x63, 0x68, + 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, + 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, + 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x61, 0x6e, 0x20, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x2c, + 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x63, 0x68, + 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x80, 0x01, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, 0x5b, 0x61, 0x2d, 0x7a, + 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, 0x2c, 0x36, 0x31, 0x7d, + 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x28, 0x5c, 0x5c, + 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, 0x5b, 0x61, 0x2d, + 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, 0x2c, 0x36, 0x31, + 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x29, 0x2a, + 0x28, 0x2f, 0x2e, 0x2a, 0x29, 0x3f, 0x24, 0x27, 0x29, 0xc8, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x22, 0xea, 0x01, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x12, 0x4e, 0x0a, 0x12, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, + 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x10, + 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, + 0x12, 0x4b, 0x0a, 0x11, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6b, 0x65, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x0f, 0x6b, 0x65, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0xc9, 0x01, + 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x12, 0x52, 0x0a, 0x14, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x13, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x63, 0x0a, 0x16, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, - 0x0a, 0x07, 0x6b, 0x61, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x6b, 0x61, 0x73, 0x49, 0x64, 0x73, 0x22, 0x32, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4b, 0x65, - 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, - 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x19, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, - 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x59, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, + 0x6c, 0x75, 0x65, 0x52, 0x14, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x72, 0x0a, 0x1c, 0x4b, 0x65, 0x79, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x61, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x61, 0x73, 0x49, 0x64, 0x73, 0x22, 0x32, 0x0a, + 0x18, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x55, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, + 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x22, 0x62, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x57, 0x0a, 0x1b, + 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x67, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, 0x65, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x67, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x60, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7a, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x78, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x42, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, - 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, - 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfa, - 0x05, 0x0a, 0x16, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x12, 0x2d, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2e, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x6b, 0x65, 0x79, - 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, - 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x96, - 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6b, 0x65, 0x79, 0x5f, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x14, 0x3a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x0a, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x9b, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x12, 0x2f, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, + 0x12, 0x40, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x67, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, + 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, 0x1d, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe6, 0x05, 0x0a, + 0x16, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, + 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, + 0x2b, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6b, + 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x83, + 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2a, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2d, + 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x0a, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x15, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x06, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x1a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, - 0x2f, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x2a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xc2, 0x01, 0x0a, 0x15, - 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x14, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, - 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x4b, - 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0xca, 0x02, - 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0xe2, 0x02, 0x1b, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x06, 0x67, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x1a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2d, 0x2e, + 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6b, + 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x11, 0x2a, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xbe, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x65, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x14, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, + 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x6b, 0x65, 0x79, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x4b, + 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x0f, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x1b, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_key_access_grants_key_access_grants_proto_rawDescOnce sync.Once - file_key_access_grants_key_access_grants_proto_rawDescData = file_key_access_grants_key_access_grants_proto_rawDesc + file_keyaccessgrants_key_access_grants_proto_rawDescOnce sync.Once + file_keyaccessgrants_key_access_grants_proto_rawDescData = file_keyaccessgrants_key_access_grants_proto_rawDesc ) -func file_key_access_grants_key_access_grants_proto_rawDescGZIP() []byte { - file_key_access_grants_key_access_grants_proto_rawDescOnce.Do(func() { - file_key_access_grants_key_access_grants_proto_rawDescData = protoimpl.X.CompressGZIP(file_key_access_grants_key_access_grants_proto_rawDescData) +func file_keyaccessgrants_key_access_grants_proto_rawDescGZIP() []byte { + file_keyaccessgrants_key_access_grants_proto_rawDescOnce.Do(func() { + file_keyaccessgrants_key_access_grants_proto_rawDescData = protoimpl.X.CompressGZIP(file_keyaccessgrants_key_access_grants_proto_rawDescData) }) - return file_key_access_grants_key_access_grants_proto_rawDescData -} - -var file_key_access_grants_key_access_grants_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_key_access_grants_key_access_grants_proto_goTypes = []interface{}{ - (*KeyAccessServer)(nil), // 0: key_access_grants.KeyAccessServer - (*KeyAccessGrants)(nil), // 1: key_access_grants.KeyAccessGrants - (*KeyAccessGrant)(nil), // 2: key_access_grants.KeyAccessGrant - (*KeyAccessGrantAttributeValue)(nil), // 3: key_access_grants.KeyAccessGrantAttributeValue - (*GetKeyAccessGrantRequest)(nil), // 4: key_access_grants.GetKeyAccessGrantRequest - (*GetKeyAccessGrantResponse)(nil), // 5: key_access_grants.GetKeyAccessGrantResponse - (*ListKeyAccessGrantsRequest)(nil), // 6: key_access_grants.ListKeyAccessGrantsRequest - (*ListKeyAccessGrantsResponse)(nil), // 7: key_access_grants.ListKeyAccessGrantsResponse - (*CreateKeyAccessGrantsRequest)(nil), // 8: key_access_grants.CreateKeyAccessGrantsRequest - (*CreateKeyAccessGrantsResponse)(nil), // 9: key_access_grants.CreateKeyAccessGrantsResponse - (*UpdateKeyAccessGrantsRequest)(nil), // 10: key_access_grants.UpdateKeyAccessGrantsRequest - (*UpdateKeyAccessGrantsResponse)(nil), // 11: key_access_grants.UpdateKeyAccessGrantsResponse - (*DeleteKeyAccessGrantsRequest)(nil), // 12: key_access_grants.DeleteKeyAccessGrantsRequest - (*DeleteKeyAccessGrantsResponse)(nil), // 13: key_access_grants.DeleteKeyAccessGrantsResponse + return file_keyaccessgrants_key_access_grants_proto_rawDescData +} + +var file_keyaccessgrants_key_access_grants_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_keyaccessgrants_key_access_grants_proto_goTypes = []interface{}{ + (*KeyAccessServer)(nil), // 0: keyaccessgrants.KeyAccessServer + (*KeyAccessGrants)(nil), // 1: keyaccessgrants.KeyAccessGrants + (*KeyAccessGrant)(nil), // 2: keyaccessgrants.KeyAccessGrant + (*KeyAccessGrantAttributeValue)(nil), // 3: keyaccessgrants.KeyAccessGrantAttributeValue + (*GetKeyAccessGrantRequest)(nil), // 4: keyaccessgrants.GetKeyAccessGrantRequest + (*GetKeyAccessGrantResponse)(nil), // 5: keyaccessgrants.GetKeyAccessGrantResponse + (*ListKeyAccessGrantsRequest)(nil), // 6: keyaccessgrants.ListKeyAccessGrantsRequest + (*ListKeyAccessGrantsResponse)(nil), // 7: keyaccessgrants.ListKeyAccessGrantsResponse + (*CreateKeyAccessGrantsRequest)(nil), // 8: keyaccessgrants.CreateKeyAccessGrantsRequest + (*CreateKeyAccessGrantsResponse)(nil), // 9: keyaccessgrants.CreateKeyAccessGrantsResponse + (*UpdateKeyAccessGrantsRequest)(nil), // 10: keyaccessgrants.UpdateKeyAccessGrantsRequest + (*UpdateKeyAccessGrantsResponse)(nil), // 11: keyaccessgrants.UpdateKeyAccessGrantsResponse + (*DeleteKeyAccessGrantsRequest)(nil), // 12: keyaccessgrants.DeleteKeyAccessGrantsRequest + (*DeleteKeyAccessGrantsResponse)(nil), // 13: keyaccessgrants.DeleteKeyAccessGrantsResponse (*common.ResourceDescriptor)(nil), // 14: common.ResourceDescriptor (*attributes.AttributeDefinition)(nil), // 15: attributes.AttributeDefinition (*attributes.AttributeValueReference)(nil), // 16: attributes.AttributeValueReference (*common.ResourceSelector)(nil), // 17: common.ResourceSelector } -var file_key_access_grants_key_access_grants_proto_depIdxs = []int32{ - 14, // 0: key_access_grants.KeyAccessServer.descriptor:type_name -> common.ResourceDescriptor - 14, // 1: key_access_grants.KeyAccessGrants.descriptor:type_name -> common.ResourceDescriptor - 0, // 2: key_access_grants.KeyAccessGrants.key_access_servers:type_name -> key_access_grants.KeyAccessServer - 2, // 3: key_access_grants.KeyAccessGrants.key_access_grants:type_name -> key_access_grants.KeyAccessGrant - 15, // 4: key_access_grants.KeyAccessGrant.attribute_definition:type_name -> attributes.AttributeDefinition - 3, // 5: key_access_grants.KeyAccessGrant.attribute_value_grants:type_name -> key_access_grants.KeyAccessGrantAttributeValue - 16, // 6: key_access_grants.KeyAccessGrantAttributeValue.value:type_name -> attributes.AttributeValueReference - 1, // 7: key_access_grants.GetKeyAccessGrantResponse.grants:type_name -> key_access_grants.KeyAccessGrants - 17, // 8: key_access_grants.ListKeyAccessGrantsRequest.selector:type_name -> common.ResourceSelector - 1, // 9: key_access_grants.ListKeyAccessGrantsResponse.grants:type_name -> key_access_grants.KeyAccessGrants - 1, // 10: key_access_grants.CreateKeyAccessGrantsRequest.grants:type_name -> key_access_grants.KeyAccessGrants - 1, // 11: key_access_grants.UpdateKeyAccessGrantsRequest.grants:type_name -> key_access_grants.KeyAccessGrants - 6, // 12: key_access_grants.KeyAccessGrantsService.ListKeyAccessGrants:input_type -> key_access_grants.ListKeyAccessGrantsRequest - 4, // 13: key_access_grants.KeyAccessGrantsService.GetKeyAccessGrant:input_type -> key_access_grants.GetKeyAccessGrantRequest - 8, // 14: key_access_grants.KeyAccessGrantsService.CreateKeyAccessGrants:input_type -> key_access_grants.CreateKeyAccessGrantsRequest - 10, // 15: key_access_grants.KeyAccessGrantsService.UpdateKeyAccessGrants:input_type -> key_access_grants.UpdateKeyAccessGrantsRequest - 12, // 16: key_access_grants.KeyAccessGrantsService.DeleteKeyAccessGrants:input_type -> key_access_grants.DeleteKeyAccessGrantsRequest - 7, // 17: key_access_grants.KeyAccessGrantsService.ListKeyAccessGrants:output_type -> key_access_grants.ListKeyAccessGrantsResponse - 5, // 18: key_access_grants.KeyAccessGrantsService.GetKeyAccessGrant:output_type -> key_access_grants.GetKeyAccessGrantResponse - 9, // 19: key_access_grants.KeyAccessGrantsService.CreateKeyAccessGrants:output_type -> key_access_grants.CreateKeyAccessGrantsResponse - 11, // 20: key_access_grants.KeyAccessGrantsService.UpdateKeyAccessGrants:output_type -> key_access_grants.UpdateKeyAccessGrantsResponse - 13, // 21: key_access_grants.KeyAccessGrantsService.DeleteKeyAccessGrants:output_type -> key_access_grants.DeleteKeyAccessGrantsResponse +var file_keyaccessgrants_key_access_grants_proto_depIdxs = []int32{ + 14, // 0: keyaccessgrants.KeyAccessServer.descriptor:type_name -> common.ResourceDescriptor + 14, // 1: keyaccessgrants.KeyAccessGrants.descriptor:type_name -> common.ResourceDescriptor + 0, // 2: keyaccessgrants.KeyAccessGrants.key_access_servers:type_name -> keyaccessgrants.KeyAccessServer + 2, // 3: keyaccessgrants.KeyAccessGrants.key_access_grants:type_name -> keyaccessgrants.KeyAccessGrant + 15, // 4: keyaccessgrants.KeyAccessGrant.attribute_definition:type_name -> attributes.AttributeDefinition + 3, // 5: keyaccessgrants.KeyAccessGrant.attribute_value_grants:type_name -> keyaccessgrants.KeyAccessGrantAttributeValue + 16, // 6: keyaccessgrants.KeyAccessGrantAttributeValue.value:type_name -> attributes.AttributeValueReference + 1, // 7: keyaccessgrants.GetKeyAccessGrantResponse.grants:type_name -> keyaccessgrants.KeyAccessGrants + 17, // 8: keyaccessgrants.ListKeyAccessGrantsRequest.selector:type_name -> common.ResourceSelector + 1, // 9: keyaccessgrants.ListKeyAccessGrantsResponse.grants:type_name -> keyaccessgrants.KeyAccessGrants + 1, // 10: keyaccessgrants.CreateKeyAccessGrantsRequest.grants:type_name -> keyaccessgrants.KeyAccessGrants + 1, // 11: keyaccessgrants.UpdateKeyAccessGrantsRequest.grants:type_name -> keyaccessgrants.KeyAccessGrants + 6, // 12: keyaccessgrants.KeyAccessGrantsService.ListKeyAccessGrants:input_type -> keyaccessgrants.ListKeyAccessGrantsRequest + 4, // 13: keyaccessgrants.KeyAccessGrantsService.GetKeyAccessGrant:input_type -> keyaccessgrants.GetKeyAccessGrantRequest + 8, // 14: keyaccessgrants.KeyAccessGrantsService.CreateKeyAccessGrants:input_type -> keyaccessgrants.CreateKeyAccessGrantsRequest + 10, // 15: keyaccessgrants.KeyAccessGrantsService.UpdateKeyAccessGrants:input_type -> keyaccessgrants.UpdateKeyAccessGrantsRequest + 12, // 16: keyaccessgrants.KeyAccessGrantsService.DeleteKeyAccessGrants:input_type -> keyaccessgrants.DeleteKeyAccessGrantsRequest + 7, // 17: keyaccessgrants.KeyAccessGrantsService.ListKeyAccessGrants:output_type -> keyaccessgrants.ListKeyAccessGrantsResponse + 5, // 18: keyaccessgrants.KeyAccessGrantsService.GetKeyAccessGrant:output_type -> keyaccessgrants.GetKeyAccessGrantResponse + 9, // 19: keyaccessgrants.KeyAccessGrantsService.CreateKeyAccessGrants:output_type -> keyaccessgrants.CreateKeyAccessGrantsResponse + 11, // 20: keyaccessgrants.KeyAccessGrantsService.UpdateKeyAccessGrants:output_type -> keyaccessgrants.UpdateKeyAccessGrantsResponse + 13, // 21: keyaccessgrants.KeyAccessGrantsService.DeleteKeyAccessGrants:output_type -> keyaccessgrants.DeleteKeyAccessGrantsResponse 17, // [17:22] is the sub-list for method output_type 12, // [12:17] is the sub-list for method input_type 12, // [12:12] is the sub-list for extension type_name @@ -1010,13 +1007,13 @@ var file_key_access_grants_key_access_grants_proto_depIdxs = []int32{ 0, // [0:12] is the sub-list for field type_name } -func init() { file_key_access_grants_key_access_grants_proto_init() } -func file_key_access_grants_key_access_grants_proto_init() { - if File_key_access_grants_key_access_grants_proto != nil { +func init() { file_keyaccessgrants_key_access_grants_proto_init() } +func file_keyaccessgrants_key_access_grants_proto_init() { + if File_keyaccessgrants_key_access_grants_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_key_access_grants_key_access_grants_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyAccessServer); i { case 0: return &v.state @@ -1028,7 +1025,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyAccessGrants); i { case 0: return &v.state @@ -1040,7 +1037,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyAccessGrant); i { case 0: return &v.state @@ -1052,7 +1049,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyAccessGrantAttributeValue); i { case 0: return &v.state @@ -1064,7 +1061,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetKeyAccessGrantRequest); i { case 0: return &v.state @@ -1076,7 +1073,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetKeyAccessGrantResponse); i { case 0: return &v.state @@ -1088,7 +1085,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListKeyAccessGrantsRequest); i { case 0: return &v.state @@ -1100,7 +1097,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListKeyAccessGrantsResponse); i { case 0: return &v.state @@ -1112,7 +1109,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateKeyAccessGrantsRequest); i { case 0: return &v.state @@ -1124,7 +1121,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateKeyAccessGrantsResponse); i { case 0: return &v.state @@ -1136,7 +1133,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateKeyAccessGrantsRequest); i { case 0: return &v.state @@ -1148,7 +1145,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateKeyAccessGrantsResponse); i { case 0: return &v.state @@ -1160,7 +1157,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteKeyAccessGrantsRequest); i { case 0: return &v.state @@ -1172,7 +1169,7 @@ func file_key_access_grants_key_access_grants_proto_init() { return nil } } - file_key_access_grants_key_access_grants_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_keyaccessgrants_key_access_grants_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteKeyAccessGrantsResponse); i { case 0: return &v.state @@ -1189,18 +1186,18 @@ func file_key_access_grants_key_access_grants_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_key_access_grants_key_access_grants_proto_rawDesc, + RawDescriptor: file_keyaccessgrants_key_access_grants_proto_rawDesc, NumEnums: 0, NumMessages: 14, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_key_access_grants_key_access_grants_proto_goTypes, - DependencyIndexes: file_key_access_grants_key_access_grants_proto_depIdxs, - MessageInfos: file_key_access_grants_key_access_grants_proto_msgTypes, + GoTypes: file_keyaccessgrants_key_access_grants_proto_goTypes, + DependencyIndexes: file_keyaccessgrants_key_access_grants_proto_depIdxs, + MessageInfos: file_keyaccessgrants_key_access_grants_proto_msgTypes, }.Build() - File_key_access_grants_key_access_grants_proto = out.File - file_key_access_grants_key_access_grants_proto_rawDesc = nil - file_key_access_grants_key_access_grants_proto_goTypes = nil - file_key_access_grants_key_access_grants_proto_depIdxs = nil + File_keyaccessgrants_key_access_grants_proto = out.File + file_keyaccessgrants_key_access_grants_proto_rawDesc = nil + file_keyaccessgrants_key_access_grants_proto_goTypes = nil + file_keyaccessgrants_key_access_grants_proto_depIdxs = nil } diff --git a/gen/key_access_grants/key_access_grants.pb.gw.go b/sdk/keyaccessgrants/key_access_grants.pb.gw.go similarity index 95% rename from gen/key_access_grants/key_access_grants.pb.gw.go rename to sdk/keyaccessgrants/key_access_grants.pb.gw.go index f03bd3f8d7..f8af68130c 100644 --- a/gen/key_access_grants/key_access_grants.pb.gw.go +++ b/sdk/keyaccessgrants/key_access_grants.pb.gw.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: key_access_grants/key_access_grants.proto +// source: keyaccessgrants/key_access_grants.proto /* -Package key_access_grants is a reverse proxy. +Package keyaccessgrants is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package key_access_grants +package keyaccessgrants import ( "context" @@ -287,7 +287,7 @@ func RegisterKeyAccessGrantsServiceHandlerServer(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/ListKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/ListKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -312,7 +312,7 @@ func RegisterKeyAccessGrantsServiceHandlerServer(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/GetKeyAccessGrant", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/GetKeyAccessGrant", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -337,7 +337,7 @@ func RegisterKeyAccessGrantsServiceHandlerServer(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/CreateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/CreateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -362,7 +362,7 @@ func RegisterKeyAccessGrantsServiceHandlerServer(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/UpdateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/UpdateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -387,7 +387,7 @@ func RegisterKeyAccessGrantsServiceHandlerServer(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/DeleteKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/DeleteKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -451,7 +451,7 @@ func RegisterKeyAccessGrantsServiceHandlerClient(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/ListKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/ListKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -473,7 +473,7 @@ func RegisterKeyAccessGrantsServiceHandlerClient(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/GetKeyAccessGrant", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/GetKeyAccessGrant", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -495,7 +495,7 @@ func RegisterKeyAccessGrantsServiceHandlerClient(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/CreateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/CreateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -517,7 +517,7 @@ func RegisterKeyAccessGrantsServiceHandlerClient(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/UpdateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/UpdateKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -539,7 +539,7 @@ func RegisterKeyAccessGrantsServiceHandlerClient(ctx context.Context, mux *runti inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/key_access_grants.KeyAccessGrantsService/DeleteKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/keyaccessgrants.KeyAccessGrantsService/DeleteKeyAccessGrants", runtime.WithHTTPPathPattern("/v1/grants/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/gen/key_access_grants/key_access_grants_grpc.pb.go b/sdk/keyaccessgrants/key_access_grants_grpc.pb.go similarity index 95% rename from gen/key_access_grants/key_access_grants_grpc.pb.go rename to sdk/keyaccessgrants/key_access_grants_grpc.pb.go index 98df6ab06b..9c4e2bea1e 100644 --- a/gen/key_access_grants/key_access_grants_grpc.pb.go +++ b/sdk/keyaccessgrants/key_access_grants_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc (unknown) -// source: key_access_grants/key_access_grants.proto +// source: keyaccessgrants/key_access_grants.proto -package key_access_grants +package keyaccessgrants import ( context "context" @@ -19,11 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - KeyAccessGrantsService_ListKeyAccessGrants_FullMethodName = "/key_access_grants.KeyAccessGrantsService/ListKeyAccessGrants" - KeyAccessGrantsService_GetKeyAccessGrant_FullMethodName = "/key_access_grants.KeyAccessGrantsService/GetKeyAccessGrant" - KeyAccessGrantsService_CreateKeyAccessGrants_FullMethodName = "/key_access_grants.KeyAccessGrantsService/CreateKeyAccessGrants" - KeyAccessGrantsService_UpdateKeyAccessGrants_FullMethodName = "/key_access_grants.KeyAccessGrantsService/UpdateKeyAccessGrants" - KeyAccessGrantsService_DeleteKeyAccessGrants_FullMethodName = "/key_access_grants.KeyAccessGrantsService/DeleteKeyAccessGrants" + KeyAccessGrantsService_ListKeyAccessGrants_FullMethodName = "/keyaccessgrants.KeyAccessGrantsService/ListKeyAccessGrants" + KeyAccessGrantsService_GetKeyAccessGrant_FullMethodName = "/keyaccessgrants.KeyAccessGrantsService/GetKeyAccessGrant" + KeyAccessGrantsService_CreateKeyAccessGrants_FullMethodName = "/keyaccessgrants.KeyAccessGrantsService/CreateKeyAccessGrants" + KeyAccessGrantsService_UpdateKeyAccessGrants_FullMethodName = "/keyaccessgrants.KeyAccessGrantsService/UpdateKeyAccessGrants" + KeyAccessGrantsService_DeleteKeyAccessGrants_FullMethodName = "/keyaccessgrants.KeyAccessGrantsService/DeleteKeyAccessGrants" ) // KeyAccessGrantsServiceClient is the client API for KeyAccessGrantsService service. @@ -229,7 +229,7 @@ func _KeyAccessGrantsService_DeleteKeyAccessGrants_Handler(srv interface{}, ctx // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var KeyAccessGrantsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "key_access_grants.KeyAccessGrantsService", + ServiceName: "keyaccessgrants.KeyAccessGrantsService", HandlerType: (*KeyAccessGrantsServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -254,5 +254,5 @@ var KeyAccessGrantsService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "key_access_grants/key_access_grants.proto", + Metadata: "keyaccessgrants/key_access_grants.proto", } diff --git a/sdk/options.go b/sdk/options.go new file mode 100644 index 0000000000..6cb79786ab --- /dev/null +++ b/sdk/options.go @@ -0,0 +1,52 @@ +package sdk + +import ( + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type Option func(*config) + +// Internal config struct for building SDK options. +type config struct { + token grpc.DialOption + clientCredentials grpc.DialOption + tls grpc.DialOption +} + +func (c *config) build() []grpc.DialOption { + var opts []grpc.DialOption + + if c.clientCredentials != nil { + opts = append(opts, c.clientCredentials) + } + + if c.token != nil { + opts = append(opts, c.token) + } + + opts = append(opts, c.tls) + + return opts +} + +// WithInsecureConn returns an Option that sets up an http connection. +func WithInsecureConn() Option { + return func(c *config) { + c.tls = grpc.WithTransportCredentials(insecure.NewCredentials()) + } +} + +// WithToken returns an Option that sets up authentication with a access token. +func WithToken(token string) Option { + return func(c *config) { + c.token = grpc.WithPerRPCCredentials(nil) + } +} + +// WithClientCredentials returns an Option that sets up authentication with client credentials. +func WithClientCredentials(clientID, clientSecret string) Option { + return func(c *config) { + c.clientCredentials = grpc.WithPerRPCCredentials(nil) + } +} diff --git a/sdk/sdk.go b/sdk/sdk.go new file mode 100644 index 0000000000..3d11f8b1ca --- /dev/null +++ b/sdk/sdk.go @@ -0,0 +1,78 @@ +package sdk + +import ( + "errors" + + "github.com/opentdf/opentdf-v2-poc/sdk/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/acse" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/keyaccessgrants" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +const ( + ErrGrpcDialFailed = Error("failed to dial grpc endpoint") + ErrShutdownFailed = Error("failed to shutdown sdk") +) + +type Error string + +func (c Error) Error() string { + return string(c) +} + +type SDK struct { + conn *grpc.ClientConn + Attributes attributes.AttributesServiceClient + ResourceEncoding acre.ResourcEncodingServiceClient + SubjectEncoding acse.SubjectEncodingServiceClient + KeyAccessGrants keyaccessgrants.KeyAccessGrantsServiceClient +} + +func New(platformEndpoint string, opts ...Option) (*SDK, error) { + // Set default options + cfg := &config{ + tls: grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), + } + + // Apply options + for _, opt := range opts { + opt(cfg) + } + + conn, err := grpc.Dial(platformEndpoint, cfg.build()...) + if err != nil { + return nil, errors.Join(ErrGrpcDialFailed, err) + } + + return newSDK(conn), nil +} + +func newSDK(conn *grpc.ClientConn) *SDK { + return &SDK{ + conn: conn, + Attributes: attributes.NewAttributesServiceClient(conn), + ResourceEncoding: acre.NewResourcEncodingServiceClient(conn), + SubjectEncoding: acse.NewSubjectEncodingServiceClient(conn), + KeyAccessGrants: keyaccessgrants.NewKeyAccessGrantsServiceClient(conn), + } +} + +// Close closes the underlying grpc.ClientConn. +func (s SDK) Close() error { + if err := s.conn.Close(); err != nil { + return errors.Join(ErrShutdownFailed, err) + } + return nil +} + +// Conn returns the underlying grpc.ClientConn. +func (s SDK) Conn() *grpc.ClientConn { + return s.conn +} + +// ExchangeToken exchanges a access token for a new token. https://datatracker.ietf.org/doc/html/rfc8693 +func (s SDK) TokenExchange(token string) (string, error) { + return "", nil +} diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go new file mode 100644 index 0000000000..a08c1e2aaa --- /dev/null +++ b/sdk/sdk_test.go @@ -0,0 +1,120 @@ +package sdk_test + +import ( + "reflect" + "testing" + + "github.com/opentdf/opentdf-v2-poc/sdk" + "github.com/opentdf/opentdf-v2-poc/sdk/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/acse" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/keyaccessgrants" +) + +var goodPlatformEndpoint = "localhost:9000" +var badPlatformEndpoint = "localhost:9999" + +func GetMethods(i interface{}) (m []string) { + r := reflect.TypeOf(i) + for i := 0; i < r.NumMethod(); i++ { + m = append(m, r.Method(i).Name) + } + return m +} + +func Test_ShouldCreateNewSDK(t *testing.T) { + // When + sdk, err := sdk.New(goodPlatformEndpoint) + // Then + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if sdk == nil { + t.Errorf("Expected sdk, got nil") + } + + // check if the clients are available + if sdk.Attributes == nil { + t.Errorf("Expected Attributes client, got nil") + } + if sdk.ResourceEncoding == nil { + t.Errorf("Expected ResourceEncoding client, got nil") + } + if sdk.SubjectEncoding == nil { + t.Errorf("Expected SubjectEncoding client, got nil") + } + if sdk.KeyAccessGrants == nil { + t.Errorf("Expected KeyAccessGrants client, got nil") + } +} + +func Test_ShouldCloseSDKConnection(t *testing.T) { + t.Skip("Skipping test since close is broken") + // Given + sdk, err := sdk.New(goodPlatformEndpoint) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + // When + err = sdk.Close() + // Then + if err != nil { + t.Errorf("Expected no error, got %v", err) + } +} + +func Test_ShouldHaveSameMethods(t *testing.T) { + sdk, err := sdk.New(goodPlatformEndpoint) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + + tests := []struct { + name string + expected []string + actual []string + }{ + { + name: "Attributes", + expected: GetMethods(reflect.TypeOf(attributes.NewAttributesServiceClient(sdk.Conn()))), + actual: GetMethods(reflect.TypeOf(sdk.Attributes)), + }, + { + name: "ResourceEncoding", + expected: GetMethods(reflect.TypeOf(acre.NewResourcEncodingServiceClient(sdk.Conn()))), + actual: GetMethods(reflect.TypeOf(sdk.ResourceEncoding)), + }, + { + name: "SubjectEncoding", + expected: GetMethods(reflect.TypeOf(acse.NewSubjectEncodingServiceClient(sdk.Conn()))), + actual: GetMethods(reflect.TypeOf(sdk.SubjectEncoding)), + }, + { + name: "KeyAccessGrants", + expected: GetMethods(reflect.TypeOf(keyaccessgrants.NewKeyAccessGrantsServiceClient(sdk.Conn()))), + actual: GetMethods(reflect.TypeOf(sdk.KeyAccessGrants)), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if !reflect.DeepEqual(tt.expected, tt.actual) { + t.Errorf("Expected Attributes client to have methods %v, got %v", tt.actual, tt.expected) + } + }) + } +} + +func Test_ShouldCreateNewSDKWithBadEndpoint(t *testing.T) { + // Bad endpoints are not detected until the first call to the platform + t.Skip("Skipping test since this is expected but not great behavior") + // When + sdk, err := sdk.New(badPlatformEndpoint) + // Then + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if sdk == nil { + t.Errorf("Expected sdk, got nil") + } +} diff --git a/pkg/services/acre/acre.go b/services/acre/acre.go similarity index 91% rename from pkg/services/acre/acre.go rename to services/acre/acre.go index ad98e52e0b..2b29d59e42 100644 --- a/pkg/services/acre/acre.go +++ b/services/acre/acre.go @@ -7,23 +7,24 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/jackc/pgx/v5" - "github.com/opentdf/opentdf-v2-poc/gen/acre" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" ) -type ResourceEncoding struct { +type ResourceEncodingService struct { acre.UnimplementedResourcEncodingServiceServer dbClient *db.Client } func NewResourceEncoding(dbClient *db.Client, grpcServer *grpc.Server, mux *runtime.ServeMux) error { - as := &ResourceEncoding{ + as := &ResourceEncodingService{ dbClient: dbClient, } acre.RegisterResourcEncodingServiceServer(grpcServer, as) @@ -38,7 +39,7 @@ func NewResourceEncoding(dbClient *db.Client, grpcServer *grpc.Server, mux *runt Resource Mappings */ -func (s ResourceEncoding) CreateResourceMapping(ctx context.Context, +func (s ResourceEncodingService) CreateResourceMapping(ctx context.Context, req *acre.CreateResourceMappingRequest) (*acre.CreateResourceMappingResponse, error) { slog.Debug("creating resource mapping") @@ -62,7 +63,7 @@ func (s ResourceEncoding) CreateResourceMapping(ctx context.Context, } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s ResourceEncoding) ListResourceMappings(ctx context.Context, +func (s ResourceEncodingService) ListResourceMappings(ctx context.Context, req *acre.ListResourceMappingsRequest) (*acre.ListResourceMappingsResponse, error) { mappings := &acre.ListResourceMappingsResponse{} @@ -107,7 +108,7 @@ func (s ResourceEncoding) ListResourceMappings(ctx context.Context, return mappings, nil } -func (s ResourceEncoding) GetResourceMapping(ctx context.Context, +func (s ResourceEncodingService) GetResourceMapping(ctx context.Context, req *acre.GetResourceMappingRequest) (*acre.GetResourceMappingResponse, error) { var ( mapping = &acre.GetResourceMappingResponse{ @@ -148,7 +149,7 @@ func (s ResourceEncoding) GetResourceMapping(ctx context.Context, return mapping, nil } -func (s ResourceEncoding) UpdateResourceMapping(ctx context.Context, +func (s ResourceEncodingService) UpdateResourceMapping(ctx context.Context, req *acre.UpdateResourceMappingRequest) (*acre.UpdateResourceMappingResponse, error) { resource, err := protojson.Marshal(req.Mapping) if err != nil { @@ -170,7 +171,7 @@ func (s ResourceEncoding) UpdateResourceMapping(ctx context.Context, return &acre.UpdateResourceMappingResponse{}, nil } -func (s ResourceEncoding) DeleteResourceMapping(ctx context.Context, +func (s ResourceEncodingService) DeleteResourceMapping(ctx context.Context, req *acre.DeleteResourceMappingRequest) (*acre.DeleteResourceMappingResponse, error) { if err := s.dbClient.DeleteResource( ctx, @@ -188,7 +189,7 @@ func (s ResourceEncoding) DeleteResourceMapping(ctx context.Context, Resource Groups */ -func (s ResourceEncoding) CreateResourceGroup(ctx context.Context, +func (s ResourceEncodingService) CreateResourceGroup(ctx context.Context, req *acre.CreateResourceGroupRequest) (*acre.CreateResourceGroupResponse, error) { slog.Debug("creating resource group") @@ -212,7 +213,7 @@ func (s ResourceEncoding) CreateResourceGroup(ctx context.Context, } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s ResourceEncoding) ListResourceGroups(ctx context.Context, +func (s ResourceEncodingService) ListResourceGroups(ctx context.Context, req *acre.ListResourceGroupsRequest) (*acre.ListResourceGroupsResponse, error) { groups := &acre.ListResourceGroupsResponse{} @@ -258,7 +259,7 @@ func (s ResourceEncoding) ListResourceGroups(ctx context.Context, return groups, nil } -func (s ResourceEncoding) GetResourceGroup(ctx context.Context, +func (s ResourceEncodingService) GetResourceGroup(ctx context.Context, req *acre.GetResourceGroupRequest) (*acre.GetResourceGroupResponse, error) { var ( group = &acre.GetResourceGroupResponse{ @@ -298,7 +299,7 @@ func (s ResourceEncoding) GetResourceGroup(ctx context.Context, return group, nil } -func (s ResourceEncoding) UpdateResourceGroup(ctx context.Context, +func (s ResourceEncodingService) UpdateResourceGroup(ctx context.Context, req *acre.UpdateResourceGroupRequest) (*acre.UpdateResourceGroupResponse, error) { resource, err := protojson.Marshal(req.Group) @@ -320,7 +321,7 @@ func (s ResourceEncoding) UpdateResourceGroup(ctx context.Context, return &acre.UpdateResourceGroupResponse{}, nil } -func (s ResourceEncoding) DeleteResourceGroup(ctx context.Context, +func (s ResourceEncodingService) DeleteResourceGroup(ctx context.Context, req *acre.DeleteResourceGroupRequest) (*acre.DeleteResourceGroupResponse, error) { if err := s.dbClient.DeleteResource( ctx, @@ -338,7 +339,7 @@ func (s ResourceEncoding) DeleteResourceGroup(ctx context.Context, Synonyms */ -func (s ResourceEncoding) CreateResourceSynonym(ctx context.Context, +func (s ResourceEncodingService) CreateResourceSynonym(ctx context.Context, req *acre.CreateResourceSynonymRequest) (*acre.CreateResourceSynonymResponse, error) { slog.Debug("creating resource synonym") @@ -362,7 +363,7 @@ func (s ResourceEncoding) CreateResourceSynonym(ctx context.Context, } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s ResourceEncoding) ListResourceSynonyms(ctx context.Context, +func (s ResourceEncodingService) ListResourceSynonyms(ctx context.Context, req *acre.ListResourceSynonymsRequest) (*acre.ListResourceSynonymsResponse, error) { synonyms := &acre.ListResourceSynonymsResponse{} @@ -406,7 +407,7 @@ func (s ResourceEncoding) ListResourceSynonyms(ctx context.Context, return synonyms, nil } -func (s ResourceEncoding) GetResourceSynonym(ctx context.Context, +func (s ResourceEncodingService) GetResourceSynonym(ctx context.Context, req *acre.GetResourceSynonymRequest) (*acre.GetResourceSynonymResponse, error) { var ( synonym = &acre.GetResourceSynonymResponse{ @@ -447,7 +448,7 @@ func (s ResourceEncoding) GetResourceSynonym(ctx context.Context, return synonym, nil } -func (s ResourceEncoding) UpdateResourceSynonym(ctx context.Context, +func (s ResourceEncodingService) UpdateResourceSynonym(ctx context.Context, req *acre.UpdateResourceSynonymRequest) (*acre.UpdateResourceSynonymResponse, error) { resource, err := protojson.Marshal(req.Synonym) @@ -470,7 +471,7 @@ func (s ResourceEncoding) UpdateResourceSynonym(ctx context.Context, return &acre.UpdateResourceSynonymResponse{}, nil } -func (s ResourceEncoding) DeleteResourceSynonym(ctx context.Context, +func (s ResourceEncodingService) DeleteResourceSynonym(ctx context.Context, req *acre.DeleteResourceSynonymRequest) (*acre.DeleteResourceSynonymResponse, error) { if err := s.dbClient.DeleteResource( ctx, diff --git a/pkg/services/acre/acre_test.go b/services/acre/acre_test.go similarity index 99% rename from pkg/services/acre/acre_test.go rename to services/acre/acre_test.go index 3b805de1d0..ba7c5a5dfe 100644 --- a/pkg/services/acre/acre_test.go +++ b/services/acre/acre_test.go @@ -7,11 +7,11 @@ import ( "testing" "github.com/jackc/pgx/v5" - "github.com/opentdf/opentdf-v2-poc/gen/acre" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" "github.com/pashagolub/pgxmock/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -23,7 +23,7 @@ import ( type AcreSuite struct { suite.Suite mock pgxmock.PgxPoolIface - acreServer *ResourceEncoding + acreServer *ResourceEncodingService } func (suite *AcreSuite) SetupSuite() { @@ -33,7 +33,7 @@ func (suite *AcreSuite) SetupSuite() { } suite.mock = mock - suite.acreServer = &ResourceEncoding{ + suite.acreServer = &ResourceEncodingService{ dbClient: &db.Client{ PgxIface: mock, }, diff --git a/pkg/services/acse/acse.go b/services/acse/acse.go similarity index 89% rename from pkg/services/acse/acse.go rename to services/acse/acse.go index 251c077cc9..f8d1fe629f 100644 --- a/pkg/services/acse/acse.go +++ b/services/acse/acse.go @@ -8,24 +8,25 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/jackc/pgx/v5" - "github.com/opentdf/opentdf-v2-poc/gen/acse" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/acse" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + + "github.com/opentdf/opentdf-v2-poc/services" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" ) -type SubjectEncoding struct { +type SubjectEncodingService struct { acse.UnimplementedSubjectEncodingServiceServer dbClient *db.Client } func NewSubjectEncodingServer(dbClient *db.Client, grpcServer *grpc.Server, grpcInprocess *grpc.Server, mux *runtime.ServeMux) error { - as := &SubjectEncoding{ + as := &SubjectEncodingService{ dbClient: dbClient, } acse.RegisterSubjectEncodingServiceServer(grpcServer, as) @@ -39,13 +40,10 @@ func NewSubjectEncodingServer(dbClient *db.Client, grpcServer *grpc.Server, return nil } -func (s SubjectEncoding) CreateSubjectMapping(ctx context.Context, +func (s SubjectEncodingService) CreateSubjectMapping(ctx context.Context, req *acse.CreateSubjectMappingRequest) (*acse.CreateSubjectMappingResponse, error) { slog.Debug("creating subject mapping") - // Set the version of the resource to 1 on create - req.SubjectMapping.Descriptor_.Version = 1 - resource, err := protojson.Marshal(req.SubjectMapping) if err != nil { return &acse.CreateSubjectMappingResponse{}, @@ -62,7 +60,7 @@ func (s SubjectEncoding) CreateSubjectMapping(ctx context.Context, return &acse.CreateSubjectMappingResponse{}, nil } -func (s SubjectEncoding) ListSubjectMappings(ctx context.Context, +func (s SubjectEncodingService) ListSubjectMappings(ctx context.Context, req *acse.ListSubjectMappingsRequest) (*acse.ListSubjectMappingsResponse, error) { mappings := &acse.ListSubjectMappingsResponse{} @@ -112,7 +110,7 @@ func (s SubjectEncoding) ListSubjectMappings(ctx context.Context, return mappings, nil } -func (s SubjectEncoding) GetSubjectMapping(ctx context.Context, +func (s SubjectEncodingService) GetSubjectMapping(ctx context.Context, req *acse.GetSubjectMappingRequest) (*acse.GetSubjectMappingResponse, error) { var ( mapping = &acse.GetSubjectMappingResponse{ @@ -153,7 +151,7 @@ func (s SubjectEncoding) GetSubjectMapping(ctx context.Context, return mapping, nil } -func (s SubjectEncoding) UpdateSubjectMapping(ctx context.Context, +func (s SubjectEncodingService) UpdateSubjectMapping(ctx context.Context, req *acse.UpdateSubjectMappingRequest) (*acse.UpdateSubjectMappingResponse, error) { resource, err := protojson.Marshal(req.SubjectMapping) if err != nil { @@ -175,7 +173,7 @@ func (s SubjectEncoding) UpdateSubjectMapping(ctx context.Context, return &acse.UpdateSubjectMappingResponse{}, nil } -func (s SubjectEncoding) DeleteSubjectMapping(ctx context.Context, +func (s SubjectEncodingService) DeleteSubjectMapping(ctx context.Context, req *acse.DeleteSubjectMappingRequest) (*acse.DeleteSubjectMappingResponse, error) { if err := s.dbClient.DeleteResource( ctx, diff --git a/pkg/services/acse/acse_test.go b/services/acse/acse_test.go similarity index 97% rename from pkg/services/acse/acse_test.go rename to services/acse/acse_test.go index 765e0a0ae3..bef85c8f5e 100644 --- a/pkg/services/acse/acse_test.go +++ b/services/acse/acse_test.go @@ -6,11 +6,11 @@ import ( "log/slog" "testing" - "github.com/opentdf/opentdf-v2-poc/gen/acse" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/acse" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" "github.com/pashagolub/pgxmock/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -22,7 +22,7 @@ import ( type AcseSuite struct { suite.Suite mock pgxmock.PgxPoolIface - acseSerer *SubjectEncoding + acseSerer *SubjectEncodingService } func (suite *AcseSuite) SetupSuite() { @@ -32,7 +32,7 @@ func (suite *AcseSuite) SetupSuite() { } suite.mock = mock - suite.acseSerer = &SubjectEncoding{ + suite.acseSerer = &SubjectEncodingService{ dbClient: &db.Client{ PgxIface: mock, }, diff --git a/pkg/services/attributes/attributes.go b/services/attributes/attributes.go similarity index 92% rename from pkg/services/attributes/attributes.go rename to services/attributes/attributes.go index 71f1e5c524..397891b28d 100644 --- a/pkg/services/attributes/attributes.go +++ b/services/attributes/attributes.go @@ -8,23 +8,23 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/jackc/pgx/v5" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" ) -type Attributes struct { +type AttributesService struct { attributes.UnimplementedAttributesServiceServer dbClient *db.Client } func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMux) error { - as := &Attributes{ + as := &AttributesService{ dbClient: dbClient, } attributes.RegisterAttributesServiceServer(g, as) @@ -35,7 +35,7 @@ func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMu return nil } -func (s Attributes) CreateAttribute(ctx context.Context, +func (s AttributesService) CreateAttribute(ctx context.Context, req *attributes.CreateAttributeRequest) (*attributes.CreateAttributeResponse, error) { slog.Debug("creating new attribute definition", slog.String("name", req.Definition.Name)) @@ -59,7 +59,7 @@ func (s Attributes) CreateAttribute(ctx context.Context, return &attributes.CreateAttributeResponse{}, nil } -func (s Attributes) CreateAttributeGroup(ctx context.Context, +func (s AttributesService) CreateAttributeGroup(ctx context.Context, req *attributes.CreateAttributeGroupRequest) (*attributes.CreateAttributeGroupResponse, error) { slog.Debug("creating new attribute group definition") @@ -81,7 +81,7 @@ func (s Attributes) CreateAttributeGroup(ctx context.Context, return &attributes.CreateAttributeGroupResponse{}, nil } -func (s *Attributes) ListAttributes(ctx context.Context, +func (s *AttributesService) ListAttributes(ctx context.Context, req *attributes.ListAttributesRequest) (*attributes.ListAttributesResponse, error) { attributesList := &attributes.ListAttributesResponse{} @@ -127,7 +127,7 @@ func (s *Attributes) ListAttributes(ctx context.Context, return attributesList, nil } -func (s *Attributes) ListAttributeGroups(ctx context.Context, +func (s *AttributesService) ListAttributeGroups(ctx context.Context, req *attributes.ListAttributeGroupsRequest) (*attributes.ListAttributeGroupsResponse, error) { var ( groups = new(attributes.ListAttributeGroupsResponse) @@ -174,7 +174,7 @@ func (s *Attributes) ListAttributeGroups(ctx context.Context, } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s *Attributes) GetAttribute(ctx context.Context, +func (s *AttributesService) GetAttribute(ctx context.Context, req *attributes.GetAttributeRequest) (*attributes.GetAttributeResponse, error) { var ( definition = &attributes.GetAttributeResponse{ @@ -216,7 +216,7 @@ func (s *Attributes) GetAttribute(ctx context.Context, } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s *Attributes) GetAttributeGroup(ctx context.Context, +func (s *AttributesService) GetAttributeGroup(ctx context.Context, req *attributes.GetAttributeGroupRequest) (*attributes.GetAttributeGroupResponse, error) { var ( group = &attributes.GetAttributeGroupResponse{ @@ -257,7 +257,7 @@ func (s *Attributes) GetAttributeGroup(ctx context.Context, return group, nil } -func (s *Attributes) UpdateAttribute(ctx context.Context, +func (s *AttributesService) UpdateAttribute(ctx context.Context, req *attributes.UpdateAttributeRequest) (*attributes.UpdateAttributeResponse, error) { resource, err := protojson.Marshal(req.Definition) if err != nil { @@ -279,7 +279,7 @@ func (s *Attributes) UpdateAttribute(ctx context.Context, return &attributes.UpdateAttributeResponse{}, nil } -func (s *Attributes) UpdateAttributeGroup(ctx context.Context, +func (s *AttributesService) UpdateAttributeGroup(ctx context.Context, req *attributes.UpdateAttributeGroupRequest) (*attributes.UpdateAttributeGroupResponse, error) { resource, err := protojson.Marshal(req.Group) if err != nil { @@ -300,7 +300,7 @@ func (s *Attributes) UpdateAttributeGroup(ctx context.Context, return &attributes.UpdateAttributeGroupResponse{}, nil } -func (s *Attributes) DeleteAttribute(ctx context.Context, +func (s *AttributesService) DeleteAttribute(ctx context.Context, req *attributes.DeleteAttributeRequest) (*attributes.DeleteAttributeResponse, error) { if err := s.dbClient.DeleteResource( ctx, @@ -314,7 +314,7 @@ func (s *Attributes) DeleteAttribute(ctx context.Context, return &attributes.DeleteAttributeResponse{}, nil } -func (s *Attributes) DeleteAttributeGroup(ctx context.Context, +func (s *AttributesService) DeleteAttributeGroup(ctx context.Context, req *attributes.DeleteAttributeGroupRequest) (*attributes.DeleteAttributeGroupResponse, error) { if err := s.dbClient.DeleteResource( ctx, diff --git a/pkg/services/attributes/attributes_test.go b/services/attributes/attributes_test.go similarity index 99% rename from pkg/services/attributes/attributes_test.go rename to services/attributes/attributes_test.go index baec667ed0..6fc5c67fcd 100644 --- a/pkg/services/attributes/attributes_test.go +++ b/services/attributes/attributes_test.go @@ -6,10 +6,10 @@ import ( "log/slog" "testing" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" "github.com/pashagolub/pgxmock/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -21,7 +21,7 @@ import ( type AttributesSuite struct { suite.Suite mock pgxmock.PgxPoolIface - attrServer *Attributes + attrServer *AttributesService } func (suite *AttributesSuite) SetupSuite() { @@ -31,7 +31,7 @@ func (suite *AttributesSuite) SetupSuite() { } suite.mock = mock - suite.attrServer = &Attributes{ + suite.attrServer = &AttributesService{ dbClient: &db.Client{ PgxIface: mock, }, diff --git a/pkg/services/keyaccessgrants/key_access_grants.go b/services/keyaccessgrants/key_access_grants.go similarity index 90% rename from pkg/services/keyaccessgrants/key_access_grants.go rename to services/keyaccessgrants/key_access_grants.go index 474552393e..5b253a293d 100644 --- a/pkg/services/keyaccessgrants/key_access_grants.go +++ b/services/keyaccessgrants/key_access_grants.go @@ -8,23 +8,23 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/jackc/pgx/v5" - "github.com/opentdf/opentdf-v2-poc/gen/common" - kag "github.com/opentdf/opentdf-v2-poc/gen/key_access_grants" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + kag "github.com/opentdf/opentdf-v2-poc/sdk/keyaccessgrants" + "github.com/opentdf/opentdf-v2-poc/services" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" ) -type KeyAccessGrants struct { +type KeyAccessGrantsService struct { kag.UnimplementedKeyAccessGrantsServiceServer dbClient *db.Client } func NewKeyAccessGrantsServer(dbClient *db.Client, grpcServer *grpc.Server, mux *runtime.ServeMux) error { - kagSvc := &KeyAccessGrants{ + kagSvc := &KeyAccessGrantsService{ dbClient: dbClient, } kag.RegisterKeyAccessGrantsServiceServer(grpcServer, kagSvc) @@ -36,7 +36,7 @@ func NewKeyAccessGrantsServer(dbClient *db.Client, grpcServer *grpc.Server, mux return nil } -func (s KeyAccessGrants) CreateKeyAccessGrants(ctx context.Context, +func (s KeyAccessGrantsService) CreateKeyAccessGrants(ctx context.Context, req *kag.CreateKeyAccessGrantsRequest) (*kag.CreateKeyAccessGrantsResponse, error) { slog.Debug("creating key access grant") @@ -59,7 +59,7 @@ func (s KeyAccessGrants) CreateKeyAccessGrants(ctx context.Context, return &kag.CreateKeyAccessGrantsResponse{}, nil } -func (s KeyAccessGrants) ListKeyAccessGrants(ctx context.Context, +func (s KeyAccessGrantsService) ListKeyAccessGrants(ctx context.Context, req *kag.ListKeyAccessGrantsRequest) (*kag.ListKeyAccessGrantsResponse, error) { grants := &kag.ListKeyAccessGrantsResponse{} @@ -109,7 +109,7 @@ func (s KeyAccessGrants) ListKeyAccessGrants(ctx context.Context, return grants, nil } -func (s KeyAccessGrants) GetKeyAccessGrant(ctx context.Context, +func (s KeyAccessGrantsService) GetKeyAccessGrant(ctx context.Context, req *kag.GetKeyAccessGrantRequest) (*kag.GetKeyAccessGrantResponse, error) { var ( grant = &kag.GetKeyAccessGrantResponse{ @@ -150,7 +150,7 @@ func (s KeyAccessGrants) GetKeyAccessGrant(ctx context.Context, return grant, nil } -func (s KeyAccessGrants) UpdateKeyAccessGrants(ctx context.Context, +func (s KeyAccessGrantsService) UpdateKeyAccessGrants(ctx context.Context, req *kag.UpdateKeyAccessGrantsRequest) (*kag.UpdateKeyAccessGrantsResponse, error) { resource, err := protojson.Marshal(req.Grants) if err != nil { @@ -172,7 +172,7 @@ func (s KeyAccessGrants) UpdateKeyAccessGrants(ctx context.Context, return &kag.UpdateKeyAccessGrantsResponse{}, nil } -func (s KeyAccessGrants) DeleteKeyAccessGrants(ctx context.Context, +func (s KeyAccessGrantsService) DeleteKeyAccessGrants(ctx context.Context, req *kag.DeleteKeyAccessGrantsRequest) (*kag.DeleteKeyAccessGrantsResponse, error) { if err := s.dbClient.DeleteResource( ctx, diff --git a/pkg/services/keyaccessgrants/key_access_grants_test.go b/services/keyaccessgrants/key_access_grants_test.go similarity index 97% rename from pkg/services/keyaccessgrants/key_access_grants_test.go rename to services/keyaccessgrants/key_access_grants_test.go index b3fdca215a..03a39cd387 100644 --- a/pkg/services/keyaccessgrants/key_access_grants_test.go +++ b/services/keyaccessgrants/key_access_grants_test.go @@ -6,11 +6,11 @@ import ( "log/slog" "testing" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" - kag "github.com/opentdf/opentdf-v2-poc/gen/key_access_grants" "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + kag "github.com/opentdf/opentdf-v2-poc/sdk/keyaccessgrants" + "github.com/opentdf/opentdf-v2-poc/services" "github.com/pashagolub/pgxmock/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -22,7 +22,7 @@ import ( type KeyAccessGrantSuite struct { suite.Suite mock pgxmock.PgxPoolIface - kagServer *KeyAccessGrants + kagServer *KeyAccessGrantsService } func (suite *KeyAccessGrantSuite) SetupSuite() { @@ -32,7 +32,7 @@ func (suite *KeyAccessGrantSuite) SetupSuite() { } suite.mock = mock - suite.kagServer = &KeyAccessGrants{ + suite.kagServer = &KeyAccessGrantsService{ dbClient: &db.Client{ PgxIface: mock, }, diff --git a/pkg/services/responseMessages.go b/services/response_messages.go similarity index 100% rename from pkg/services/responseMessages.go rename to services/response_messages.go diff --git a/tests/acre_test.go b/tests/acre_test.go index cc3088f289..639ddee33e 100644 --- a/tests/acre_test.go +++ b/tests/acre_test.go @@ -3,7 +3,7 @@ package tests import ( "testing" - "github.com/opentdf/opentdf-v2-poc/gen/acre" + "github.com/opentdf/opentdf-v2-poc/sdk/acre" "github.com/stretchr/testify/suite" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/tests/acse_test.go b/tests/acse_test.go index 2ae3920e05..c8caa626d7 100644 --- a/tests/acse_test.go +++ b/tests/acse_test.go @@ -3,7 +3,7 @@ package tests import ( "testing" - "github.com/opentdf/opentdf-v2-poc/gen/acse" + "github.com/opentdf/opentdf-v2-poc/sdk/acse" "github.com/stretchr/testify/suite" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/tests/attributes_test.go b/tests/attributes_test.go index 9a6e925c2e..72b42480d4 100644 --- a/tests/attributes_test.go +++ b/tests/attributes_test.go @@ -7,9 +7,9 @@ import ( "os" "testing" - "github.com/opentdf/opentdf-v2-poc/gen/attributes" - "github.com/opentdf/opentdf-v2-poc/gen/common" - "github.com/opentdf/opentdf-v2-poc/pkg/services" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -46,16 +46,16 @@ func (suite *AttributesSuite) SetupSuite() { suite.T().Fatal(err) } - var attributesDef = make([]*attributes.AttributeDefinition, 0) + var attrs = make([]*attributes.AttributeDefinition, 0) - err = json.Unmarshal(testData, &attributesDef) + err = json.Unmarshal(testData, &attrs) if err != nil { slog.Error("could not unmarshal attributes.json", slog.String("error", err.Error())) suite.T().Fatal(err) } - for _, attr := range attributesDef { + for _, attr := range attrs { _, err = suite.client.CreateAttribute(ctx, &attributes.CreateAttributeRequest{ Definition: attr, })