From 6ef1eff32a92c9fb9cea3b8a9275240f5ae6b1fe Mon Sep 17 00:00:00 2001 From: Marcus Hines Date: Fri, 19 Apr 2024 21:31:16 +0000 Subject: [PATCH] Fix bazel build update deps --- BUILD.bazel | 5 - acctz/BUILD.bazel | 12 +- acctz/acctz.pb.go | 215 ++++++++++++++++++++++++++++ authz/BUILD.bazel | 14 +- authz/authz.pb.go | 189 +++++++++++++++++++++++++ certz/BUILD.bazel | 9 +- credentialz/BUILD.bazel | 7 +- credentialz/credentialz.pb.go | 257 ++++++++++++++++++++++++++++++++++ deps.bzl | 4 +- pathz/BUILD.bazel | 30 ++-- pathz/authorization.pb.go | 193 +++++++++++++------------ version/BUILD.bazel | 17 ++- 12 files changed, 792 insertions(+), 160 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 7847882..56fa671 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,11 +3,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle") # gazelle:prefix github.com/openconfig/gnsi gazelle(name = "gazelle") -alias( - name = "yang", - actual = "//yang:ocbinds", -) - alias( name = "authz_go", actual = "//authz:authz", diff --git a/acctz/BUILD.bazel b/acctz/BUILD.bazel index ad7c541..6c5eed4 100644 --- a/acctz/BUILD.bazel +++ b/acctz/BUILD.bazel @@ -4,14 +4,9 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") load("//:common.bzl", "use_new_compilers") -use_new_compilers() - package(default_visibility = ["//visibility:public"]) -filegroup( - name = "yang", - srcs = glob(["*.yang"]), -) +use_new_compilers() proto_library( name = "acctz_proto", @@ -40,10 +35,7 @@ cpp_grpc_library( ############################################################################## go_proto_library( name = "acctz_go_proto", - compilers = [ - "go_protoc_gen_go", - "go_protoc_gen_go_grpc", - ], + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnsi/acctz", proto = ":acctz_proto", deps = ["//version:version_go_proto"], diff --git a/acctz/acctz.pb.go b/acctz/acctz.pb.go index 5bfaf8f..fe6e891 100755 --- a/acctz/acctz.pb.go +++ b/acctz/acctz.pb.go @@ -7,7 +7,11 @@ package acctz import ( + context "context" _ "github.com/openconfig/gnsi/version" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" @@ -1617,3 +1621,214 @@ func file_github_com_openconfig_gnsi_acctz_acctz_proto_init() { file_github_com_openconfig_gnsi_acctz_acctz_proto_goTypes = nil file_github_com_openconfig_gnsi_acctz_acctz_proto_depIdxs = nil } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AcctzClient is the client API for Acctz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AcctzClient interface { + RecordSubscribe(ctx context.Context, opts ...grpc.CallOption) (Acctz_RecordSubscribeClient, error) +} + +type acctzClient struct { + cc grpc.ClientConnInterface +} + +func NewAcctzClient(cc grpc.ClientConnInterface) AcctzClient { + return &acctzClient{cc} +} + +func (c *acctzClient) RecordSubscribe(ctx context.Context, opts ...grpc.CallOption) (Acctz_RecordSubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &_Acctz_serviceDesc.Streams[0], "/gnsi.acctz.v1.Acctz/RecordSubscribe", opts...) + if err != nil { + return nil, err + } + x := &acctzRecordSubscribeClient{stream} + return x, nil +} + +type Acctz_RecordSubscribeClient interface { + Send(*RecordRequest) error + Recv() (*RecordResponse, error) + grpc.ClientStream +} + +type acctzRecordSubscribeClient struct { + grpc.ClientStream +} + +func (x *acctzRecordSubscribeClient) Send(m *RecordRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *acctzRecordSubscribeClient) Recv() (*RecordResponse, error) { + m := new(RecordResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AcctzServer is the server API for Acctz service. +type AcctzServer interface { + RecordSubscribe(Acctz_RecordSubscribeServer) error +} + +// UnimplementedAcctzServer can be embedded to have forward compatible implementations. +type UnimplementedAcctzServer struct { +} + +func (*UnimplementedAcctzServer) RecordSubscribe(Acctz_RecordSubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method RecordSubscribe not implemented") +} + +func RegisterAcctzServer(s *grpc.Server, srv AcctzServer) { + s.RegisterService(&_Acctz_serviceDesc, srv) +} + +func _Acctz_RecordSubscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AcctzServer).RecordSubscribe(&acctzRecordSubscribeServer{stream}) +} + +type Acctz_RecordSubscribeServer interface { + Send(*RecordResponse) error + Recv() (*RecordRequest, error) + grpc.ServerStream +} + +type acctzRecordSubscribeServer struct { + grpc.ServerStream +} + +func (x *acctzRecordSubscribeServer) Send(m *RecordResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *acctzRecordSubscribeServer) Recv() (*RecordRequest, error) { + m := new(RecordRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Acctz_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.acctz.v1.Acctz", + HandlerType: (*AcctzServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "RecordSubscribe", + Handler: _Acctz_RecordSubscribe_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/acctz/acctz.proto", +} + +// AcctzStreamClient is the client API for AcctzStream service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AcctzStreamClient interface { + RecordSubscribe(ctx context.Context, in *RecordRequest, opts ...grpc.CallOption) (AcctzStream_RecordSubscribeClient, error) +} + +type acctzStreamClient struct { + cc grpc.ClientConnInterface +} + +func NewAcctzStreamClient(cc grpc.ClientConnInterface) AcctzStreamClient { + return &acctzStreamClient{cc} +} + +func (c *acctzStreamClient) RecordSubscribe(ctx context.Context, in *RecordRequest, opts ...grpc.CallOption) (AcctzStream_RecordSubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &_AcctzStream_serviceDesc.Streams[0], "/gnsi.acctz.v1.AcctzStream/RecordSubscribe", opts...) + if err != nil { + return nil, err + } + x := &acctzStreamRecordSubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AcctzStream_RecordSubscribeClient interface { + Recv() (*RecordResponse, error) + grpc.ClientStream +} + +type acctzStreamRecordSubscribeClient struct { + grpc.ClientStream +} + +func (x *acctzStreamRecordSubscribeClient) Recv() (*RecordResponse, error) { + m := new(RecordResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AcctzStreamServer is the server API for AcctzStream service. +type AcctzStreamServer interface { + RecordSubscribe(*RecordRequest, AcctzStream_RecordSubscribeServer) error +} + +// UnimplementedAcctzStreamServer can be embedded to have forward compatible implementations. +type UnimplementedAcctzStreamServer struct { +} + +func (*UnimplementedAcctzStreamServer) RecordSubscribe(*RecordRequest, AcctzStream_RecordSubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method RecordSubscribe not implemented") +} + +func RegisterAcctzStreamServer(s *grpc.Server, srv AcctzStreamServer) { + s.RegisterService(&_AcctzStream_serviceDesc, srv) +} + +func _AcctzStream_RecordSubscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(RecordRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AcctzStreamServer).RecordSubscribe(m, &acctzStreamRecordSubscribeServer{stream}) +} + +type AcctzStream_RecordSubscribeServer interface { + Send(*RecordResponse) error + grpc.ServerStream +} + +type acctzStreamRecordSubscribeServer struct { + grpc.ServerStream +} + +func (x *acctzStreamRecordSubscribeServer) Send(m *RecordResponse) error { + return x.ServerStream.SendMsg(m) +} + +var _AcctzStream_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.acctz.v1.AcctzStream", + HandlerType: (*AcctzStreamServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "RecordSubscribe", + Handler: _AcctzStream_RecordSubscribe_Handler, + ServerStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/acctz/acctz.proto", +} diff --git a/authz/BUILD.bazel b/authz/BUILD.bazel index 5615a73..d3b449e 100644 --- a/authz/BUILD.bazel +++ b/authz/BUILD.bazel @@ -4,20 +4,15 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") load("//:common.bzl", "use_new_compilers") -use_new_compilers() - package(default_visibility = ["//visibility:public"]) -filegroup( - name = "yang", - srcs = glob(["*.yang"]), -) +use_new_compilers() proto_library( name = "authz_proto", srcs = ["authz.proto"], - import_prefix = "github.com/openconfig/gnsi", deps = ["//version:version_proto"], + import_prefix = "github.com/openconfig/gnsi", ) ############################################################################## @@ -36,10 +31,7 @@ cpp_grpc_library( ############################################################################## go_proto_library( name = "authz_go_proto", - compilers = [ - "go_protoc_gen_go", - "go_protoc_gen_go_grpc", - ], + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnsi/authz", proto = ":authz_proto", deps = ["//version:version_go_proto"], diff --git a/authz/authz.pb.go b/authz/authz.pb.go index 68563d7..90f7763 100755 --- a/authz/authz.pb.go +++ b/authz/authz.pb.go @@ -7,7 +7,11 @@ package authz import ( + context "context" _ "github.com/openconfig/gnsi/version" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -841,3 +845,188 @@ func file_github_com_openconfig_gnsi_authz_authz_proto_init() { file_github_com_openconfig_gnsi_authz_authz_proto_goTypes = nil file_github_com_openconfig_gnsi_authz_authz_proto_depIdxs = nil } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AuthzClient is the client API for Authz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AuthzClient interface { + Rotate(ctx context.Context, opts ...grpc.CallOption) (Authz_RotateClient, error) + Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) +} + +type authzClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthzClient(cc grpc.ClientConnInterface) AuthzClient { + return &authzClient{cc} +} + +func (c *authzClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (Authz_RotateClient, error) { + stream, err := c.cc.NewStream(ctx, &_Authz_serviceDesc.Streams[0], "/gnsi.authz.v1.Authz/Rotate", opts...) + if err != nil { + return nil, err + } + x := &authzRotateClient{stream} + return x, nil +} + +type Authz_RotateClient interface { + Send(*RotateAuthzRequest) error + Recv() (*RotateAuthzResponse, error) + grpc.ClientStream +} + +type authzRotateClient struct { + grpc.ClientStream +} + +func (x *authzRotateClient) Send(m *RotateAuthzRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *authzRotateClient) Recv() (*RotateAuthzResponse, error) { + m := new(RotateAuthzResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *authzClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { + out := new(ProbeResponse) + err := c.cc.Invoke(ctx, "/gnsi.authz.v1.Authz/Probe", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authzClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/gnsi.authz.v1.Authz/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthzServer is the server API for Authz service. +type AuthzServer interface { + Rotate(Authz_RotateServer) error + Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) + Get(context.Context, *GetRequest) (*GetResponse, error) +} + +// UnimplementedAuthzServer can be embedded to have forward compatible implementations. +type UnimplementedAuthzServer struct { +} + +func (*UnimplementedAuthzServer) Rotate(Authz_RotateServer) error { + return status.Errorf(codes.Unimplemented, "method Rotate not implemented") +} +func (*UnimplementedAuthzServer) Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Probe not implemented") +} +func (*UnimplementedAuthzServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} + +func RegisterAuthzServer(s *grpc.Server, srv AuthzServer) { + s.RegisterService(&_Authz_serviceDesc, srv) +} + +func _Authz_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AuthzServer).Rotate(&authzRotateServer{stream}) +} + +type Authz_RotateServer interface { + Send(*RotateAuthzResponse) error + Recv() (*RotateAuthzRequest, error) + grpc.ServerStream +} + +type authzRotateServer struct { + grpc.ServerStream +} + +func (x *authzRotateServer) Send(m *RotateAuthzResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *authzRotateServer) Recv() (*RotateAuthzRequest, error) { + m := new(RotateAuthzRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Authz_Probe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProbeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthzServer).Probe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.authz.v1.Authz/Probe", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthzServer).Probe(ctx, req.(*ProbeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Authz_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthzServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.authz.v1.Authz/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthzServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Authz_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.authz.v1.Authz", + HandlerType: (*AuthzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Probe", + Handler: _Authz_Probe_Handler, + }, + { + MethodName: "Get", + Handler: _Authz_Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Rotate", + Handler: _Authz_Rotate_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/authz/authz.proto", +} diff --git a/certz/BUILD.bazel b/certz/BUILD.bazel index ae1dca9..84b327a 100644 --- a/certz/BUILD.bazel +++ b/certz/BUILD.bazel @@ -4,23 +4,18 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") load("//:common.bzl", "use_new_compilers") -use_new_compilers() - package(default_visibility = ["//visibility:public"]) -filegroup( - name = "yang", - srcs = glob(["*.yang"]), -) +use_new_compilers() proto_library( name = "certz_proto", srcs = ["certz.proto"], - import_prefix = "github.com/openconfig/gnsi", deps = [ "//version:version_proto", "@com_google_protobuf//:any_proto", ], + import_prefix = "github.com/openconfig/gnsi", ) ############################################################################## diff --git a/credentialz/BUILD.bazel b/credentialz/BUILD.bazel index 92cff71..8a98a7d 100644 --- a/credentialz/BUILD.bazel +++ b/credentialz/BUILD.bazel @@ -16,8 +16,8 @@ filegroup( proto_library( name = "credentialz_proto", srcs = ["credentialz.proto"], - import_prefix = "github.com/openconfig/gnsi", deps = ["//version:version_proto"], + import_prefix = "github.com/openconfig/gnsi", ) ############################################################################## @@ -41,10 +41,7 @@ cpp_grpc_library( go_proto_library( name = "credentialz_go_proto", - compilers = [ - "go_protoc_gen_go", - "go_protoc_gen_go_grpc", - ], + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnsi/credentialz", proto = ":credentialz_proto", deps = ["//version:version_go_proto"], diff --git a/credentialz/credentialz.pb.go b/credentialz/credentialz.pb.go index 9bc9d28..e5712c7 100755 --- a/credentialz/credentialz.pb.go +++ b/credentialz/credentialz.pb.go @@ -7,7 +7,11 @@ package credentialz import ( + context "context" _ "github.com/openconfig/gnsi/version" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -3592,3 +3596,256 @@ func file_github_com_openconfig_gnsi_credentialz_credentialz_proto_init() { file_github_com_openconfig_gnsi_credentialz_credentialz_proto_goTypes = nil file_github_com_openconfig_gnsi_credentialz_credentialz_proto_depIdxs = nil } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// CredentialzClient is the client API for Credentialz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CredentialzClient interface { + RotateAccountCredentials(ctx context.Context, opts ...grpc.CallOption) (Credentialz_RotateAccountCredentialsClient, error) + RotateHostParameters(ctx context.Context, opts ...grpc.CallOption) (Credentialz_RotateHostParametersClient, error) + CanGenerateKey(ctx context.Context, in *CanGenerateKeyRequest, opts ...grpc.CallOption) (*CanGenerateKeyResponse, error) + GetPublicKeys(ctx context.Context, in *GetPublicKeysRequest, opts ...grpc.CallOption) (*GetPublicKeysResponse, error) +} + +type credentialzClient struct { + cc grpc.ClientConnInterface +} + +func NewCredentialzClient(cc grpc.ClientConnInterface) CredentialzClient { + return &credentialzClient{cc} +} + +func (c *credentialzClient) RotateAccountCredentials(ctx context.Context, opts ...grpc.CallOption) (Credentialz_RotateAccountCredentialsClient, error) { + stream, err := c.cc.NewStream(ctx, &_Credentialz_serviceDesc.Streams[0], "/gnsi.credentialz.v1.Credentialz/RotateAccountCredentials", opts...) + if err != nil { + return nil, err + } + x := &credentialzRotateAccountCredentialsClient{stream} + return x, nil +} + +type Credentialz_RotateAccountCredentialsClient interface { + Send(*RotateAccountCredentialsRequest) error + Recv() (*RotateAccountCredentialsResponse, error) + grpc.ClientStream +} + +type credentialzRotateAccountCredentialsClient struct { + grpc.ClientStream +} + +func (x *credentialzRotateAccountCredentialsClient) Send(m *RotateAccountCredentialsRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *credentialzRotateAccountCredentialsClient) Recv() (*RotateAccountCredentialsResponse, error) { + m := new(RotateAccountCredentialsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *credentialzClient) RotateHostParameters(ctx context.Context, opts ...grpc.CallOption) (Credentialz_RotateHostParametersClient, error) { + stream, err := c.cc.NewStream(ctx, &_Credentialz_serviceDesc.Streams[1], "/gnsi.credentialz.v1.Credentialz/RotateHostParameters", opts...) + if err != nil { + return nil, err + } + x := &credentialzRotateHostParametersClient{stream} + return x, nil +} + +type Credentialz_RotateHostParametersClient interface { + Send(*RotateHostParametersRequest) error + Recv() (*RotateHostParametersResponse, error) + grpc.ClientStream +} + +type credentialzRotateHostParametersClient struct { + grpc.ClientStream +} + +func (x *credentialzRotateHostParametersClient) Send(m *RotateHostParametersRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *credentialzRotateHostParametersClient) Recv() (*RotateHostParametersResponse, error) { + m := new(RotateHostParametersResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *credentialzClient) CanGenerateKey(ctx context.Context, in *CanGenerateKeyRequest, opts ...grpc.CallOption) (*CanGenerateKeyResponse, error) { + out := new(CanGenerateKeyResponse) + err := c.cc.Invoke(ctx, "/gnsi.credentialz.v1.Credentialz/CanGenerateKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *credentialzClient) GetPublicKeys(ctx context.Context, in *GetPublicKeysRequest, opts ...grpc.CallOption) (*GetPublicKeysResponse, error) { + out := new(GetPublicKeysResponse) + err := c.cc.Invoke(ctx, "/gnsi.credentialz.v1.Credentialz/GetPublicKeys", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CredentialzServer is the server API for Credentialz service. +type CredentialzServer interface { + RotateAccountCredentials(Credentialz_RotateAccountCredentialsServer) error + RotateHostParameters(Credentialz_RotateHostParametersServer) error + CanGenerateKey(context.Context, *CanGenerateKeyRequest) (*CanGenerateKeyResponse, error) + GetPublicKeys(context.Context, *GetPublicKeysRequest) (*GetPublicKeysResponse, error) +} + +// UnimplementedCredentialzServer can be embedded to have forward compatible implementations. +type UnimplementedCredentialzServer struct { +} + +func (*UnimplementedCredentialzServer) RotateAccountCredentials(Credentialz_RotateAccountCredentialsServer) error { + return status.Errorf(codes.Unimplemented, "method RotateAccountCredentials not implemented") +} +func (*UnimplementedCredentialzServer) RotateHostParameters(Credentialz_RotateHostParametersServer) error { + return status.Errorf(codes.Unimplemented, "method RotateHostParameters not implemented") +} +func (*UnimplementedCredentialzServer) CanGenerateKey(context.Context, *CanGenerateKeyRequest) (*CanGenerateKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CanGenerateKey not implemented") +} +func (*UnimplementedCredentialzServer) GetPublicKeys(context.Context, *GetPublicKeysRequest) (*GetPublicKeysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPublicKeys not implemented") +} + +func RegisterCredentialzServer(s *grpc.Server, srv CredentialzServer) { + s.RegisterService(&_Credentialz_serviceDesc, srv) +} + +func _Credentialz_RotateAccountCredentials_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CredentialzServer).RotateAccountCredentials(&credentialzRotateAccountCredentialsServer{stream}) +} + +type Credentialz_RotateAccountCredentialsServer interface { + Send(*RotateAccountCredentialsResponse) error + Recv() (*RotateAccountCredentialsRequest, error) + grpc.ServerStream +} + +type credentialzRotateAccountCredentialsServer struct { + grpc.ServerStream +} + +func (x *credentialzRotateAccountCredentialsServer) Send(m *RotateAccountCredentialsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *credentialzRotateAccountCredentialsServer) Recv() (*RotateAccountCredentialsRequest, error) { + m := new(RotateAccountCredentialsRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Credentialz_RotateHostParameters_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CredentialzServer).RotateHostParameters(&credentialzRotateHostParametersServer{stream}) +} + +type Credentialz_RotateHostParametersServer interface { + Send(*RotateHostParametersResponse) error + Recv() (*RotateHostParametersRequest, error) + grpc.ServerStream +} + +type credentialzRotateHostParametersServer struct { + grpc.ServerStream +} + +func (x *credentialzRotateHostParametersServer) Send(m *RotateHostParametersResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *credentialzRotateHostParametersServer) Recv() (*RotateHostParametersRequest, error) { + m := new(RotateHostParametersRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Credentialz_CanGenerateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CanGenerateKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CredentialzServer).CanGenerateKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.credentialz.v1.Credentialz/CanGenerateKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CredentialzServer).CanGenerateKey(ctx, req.(*CanGenerateKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Credentialz_GetPublicKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPublicKeysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CredentialzServer).GetPublicKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.credentialz.v1.Credentialz/GetPublicKeys", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CredentialzServer).GetPublicKeys(ctx, req.(*GetPublicKeysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Credentialz_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.credentialz.v1.Credentialz", + HandlerType: (*CredentialzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CanGenerateKey", + Handler: _Credentialz_CanGenerateKey_Handler, + }, + { + MethodName: "GetPublicKeys", + Handler: _Credentialz_GetPublicKeys_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "RotateAccountCredentials", + Handler: _Credentialz_RotateAccountCredentials_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "RotateHostParameters", + Handler: _Credentialz_RotateHostParameters_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/credentialz/credentialz.proto", +} diff --git a/deps.bzl b/deps.bzl index d58bf8d..2556e3e 100644 --- a/deps.bzl +++ b/deps.bzl @@ -25,8 +25,8 @@ def gnsi_deps(): ], build_file_generation = "on", importpath = "github.com/openconfig/gnoi", - sum = "h1:ieThHVx5rRwAt6lqKOKzoA3pcr5FE5Xs40GJ7wNqshs=", - version = "v0.3.0", + sum = "h1:jbYXRMNmmvA8ZFv2FBLrYoxA1MFSui4tEui+8LAWyVc=", + version = "v0.4.0", ) if not native.existing_rule("com_github_openconfig_gnmi"): go_repository( diff --git a/pathz/BUILD.bazel b/pathz/BUILD.bazel index a363d5b..f915805 100644 --- a/pathz/BUILD.bazel +++ b/pathz/BUILD.bazel @@ -4,25 +4,16 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") load("//:common.bzl", "use_new_compilers") -use_new_compilers() - package(default_visibility = ["//visibility:public"]) -filegroup( - name = "yang", - srcs = glob(["*.yang"]), -) +use_new_compilers() proto_library( name = "pathz_proto", - srcs = [ - "authorization.proto", - "pathz.proto", - ], - import_prefix = "github.com/openconfig/gnsi", + srcs = ["authorization.proto"], deps = [ - "//version:version_proto", "@com_github_openconfig_gnmi//proto/gnmi:gnmi_proto", + "//version:version_proto", ], ) @@ -45,15 +36,11 @@ cpp_grpc_library( ############################################################################## go_proto_library( name = "pathz_go_proto", - compilers = [ - "go_protoc_gen_go", - "go_protoc_gen_go_grpc", - ], importpath = "github.com/openconfig/gnsi/pathz", proto = ":pathz_proto", deps = [ - "//version:version_go_proto", "@com_github_openconfig_gnmi//proto/gnmi:gnmi_go_proto", + "//version:version_go_proto", ], ) @@ -61,4 +48,13 @@ go_library( name = "pathz", embed = [":pathz_go_proto"], importpath = "github.com/openconfig/gnsi/pathz", + deps = [ + "//version:version", + "@com_github_openconfig_gnmi//proto/gnmi:go_default_library", + "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//status:go_default_library", + "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", + "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", + ], ) diff --git a/pathz/authorization.pb.go b/pathz/authorization.pb.go index 2599d54..ce0e3cd 100644 --- a/pathz/authorization.pb.go +++ b/pathz/authorization.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.30.0 // protoc v3.21.10 -// source: github.com/openconfig/gnsi/pathz/authorization.proto +// source: pathz/authorization.proto package pathz @@ -55,11 +55,11 @@ func (x Action) String() string { } func (Action) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes[0].Descriptor() + return file_pathz_authorization_proto_enumTypes[0].Descriptor() } func (Action) Type() protoreflect.EnumType { - return &file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes[0] + return &file_pathz_authorization_proto_enumTypes[0] } func (x Action) Number() protoreflect.EnumNumber { @@ -68,7 +68,7 @@ func (x Action) Number() protoreflect.EnumNumber { // Deprecated: Use Action.Descriptor instead. func (Action) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{0} + return file_pathz_authorization_proto_rawDescGZIP(), []int{0} } type Mode int32 @@ -104,11 +104,11 @@ func (x Mode) String() string { } func (Mode) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes[1].Descriptor() + return file_pathz_authorization_proto_enumTypes[1].Descriptor() } func (Mode) Type() protoreflect.EnumType { - return &file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes[1] + return &file_pathz_authorization_proto_enumTypes[1] } func (x Mode) Number() protoreflect.EnumNumber { @@ -117,7 +117,7 @@ func (x Mode) Number() protoreflect.EnumNumber { // Deprecated: Use Mode.Descriptor instead. func (Mode) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{1} + return file_pathz_authorization_proto_rawDescGZIP(), []int{1} } type User struct { @@ -131,7 +131,7 @@ type User struct { func (x *User) Reset() { *x = User{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[0] + mi := &file_pathz_authorization_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -144,7 +144,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[0] + mi := &file_pathz_authorization_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -157,7 +157,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{0} + return file_pathz_authorization_proto_rawDescGZIP(), []int{0} } func (x *User) GetName() string { @@ -179,7 +179,7 @@ type Group struct { func (x *Group) Reset() { *x = Group{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[1] + mi := &file_pathz_authorization_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -192,7 +192,7 @@ func (x *Group) String() string { func (*Group) ProtoMessage() {} func (x *Group) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[1] + mi := &file_pathz_authorization_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -205,7 +205,7 @@ func (x *Group) ProtoReflect() protoreflect.Message { // Deprecated: Use Group.ProtoReflect.Descriptor instead. func (*Group) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{1} + return file_pathz_authorization_proto_rawDescGZIP(), []int{1} } func (x *Group) GetName() string { @@ -240,7 +240,7 @@ type AuthorizationRule struct { func (x *AuthorizationRule) Reset() { *x = AuthorizationRule{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[2] + mi := &file_pathz_authorization_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -253,7 +253,7 @@ func (x *AuthorizationRule) String() string { func (*AuthorizationRule) ProtoMessage() {} func (x *AuthorizationRule) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[2] + mi := &file_pathz_authorization_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -266,7 +266,7 @@ func (x *AuthorizationRule) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthorizationRule.ProtoReflect.Descriptor instead. func (*AuthorizationRule) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{2} + return file_pathz_authorization_proto_rawDescGZIP(), []int{2} } func (x *AuthorizationRule) GetId() string { @@ -346,7 +346,7 @@ type AuthorizationPolicy struct { func (x *AuthorizationPolicy) Reset() { *x = AuthorizationPolicy{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[3] + mi := &file_pathz_authorization_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -359,7 +359,7 @@ func (x *AuthorizationPolicy) String() string { func (*AuthorizationPolicy) ProtoMessage() {} func (x *AuthorizationPolicy) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[3] + mi := &file_pathz_authorization_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -372,7 +372,7 @@ func (x *AuthorizationPolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthorizationPolicy.ProtoReflect.Descriptor instead. func (*AuthorizationPolicy) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP(), []int{3} + return file_pathz_authorization_proto_rawDescGZIP(), []int{3} } func (x *AuthorizationPolicy) GetRules() []*AuthorizationRule { @@ -389,74 +389,73 @@ func (x *AuthorizationPolicy) GetGroups() []*Group { return nil } -var File_github_com_openconfig_gnsi_pathz_authorization_proto protoreflect.FileDescriptor - -var file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDesc = []byte{ - 0x0a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, - 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x73, 0x69, 0x2f, 0x70, 0x61, 0x74, - 0x68, 0x7a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, - 0x68, 0x7a, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x73, 0x69, - 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1a, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x26, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0xd0, 0x01, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x6e, 0x6d, 0x69, - 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2a, 0x0a, 0x06, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6e, - 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, - 0x68, 0x7a, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x42, 0x0b, 0x0a, - 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x22, 0x75, 0x0a, 0x13, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x12, 0x33, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, - 0x74, 0x68, 0x7a, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x2a, 0x44, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, - 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, - 0x4e, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, - 0x45, 0x52, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x2a, 0x3b, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, - 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x52, 0x45, - 0x41, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x57, 0x52, 0x49, - 0x54, 0x45, 0x10, 0x02, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, - 0x73, 0x69, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_pathz_authorization_proto protoreflect.FileDescriptor + +var file_pathz_authorization_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6e, 0x73, + 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x6e, 0x6d, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x67, + 0x6e, 0x6d, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x73, 0x69, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1a, 0x0a, 0x04, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0xd0, 0x01, 0x0a, + 0x11, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x1e, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x2a, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x73, + 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, + 0x64, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x22, + 0x75, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, + 0x68, 0x7a, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6e, + 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2a, 0x44, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x2a, 0x3b, 0x0a, 0x04, + 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x4f, + 0x44, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, + 0x45, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x02, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x73, 0x69, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescOnce sync.Once - file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescData = file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDesc + file_pathz_authorization_proto_rawDescOnce sync.Once + file_pathz_authorization_proto_rawDescData = file_pathz_authorization_proto_rawDesc ) -func file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescGZIP() []byte { - file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescOnce.Do(func() { - file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescData) +func file_pathz_authorization_proto_rawDescGZIP() []byte { + file_pathz_authorization_proto_rawDescOnce.Do(func() { + file_pathz_authorization_proto_rawDescData = protoimpl.X.CompressGZIP(file_pathz_authorization_proto_rawDescData) }) - return file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDescData + return file_pathz_authorization_proto_rawDescData } -var file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_openconfig_gnsi_pathz_authorization_proto_goTypes = []interface{}{ +var file_pathz_authorization_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_pathz_authorization_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_pathz_authorization_proto_goTypes = []interface{}{ (Action)(0), // 0: gnsi.pathz.Action (Mode)(0), // 1: gnsi.pathz.Mode (*User)(nil), // 2: gnsi.pathz.User @@ -465,7 +464,7 @@ var file_github_com_openconfig_gnsi_pathz_authorization_proto_goTypes = []interf (*AuthorizationPolicy)(nil), // 5: gnsi.pathz.AuthorizationPolicy (*gnmi.Path)(nil), // 6: gnmi.Path } -var file_github_com_openconfig_gnsi_pathz_authorization_proto_depIdxs = []int32{ +var file_pathz_authorization_proto_depIdxs = []int32{ 2, // 0: gnsi.pathz.Group.users:type_name -> gnsi.pathz.User 6, // 1: gnsi.pathz.AuthorizationRule.path:type_name -> gnmi.Path 0, // 2: gnsi.pathz.AuthorizationRule.action:type_name -> gnsi.pathz.Action @@ -479,13 +478,13 @@ var file_github_com_openconfig_gnsi_pathz_authorization_proto_depIdxs = []int32{ 0, // [0:6] is the sub-list for field type_name } -func init() { file_github_com_openconfig_gnsi_pathz_authorization_proto_init() } -func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { - if File_github_com_openconfig_gnsi_pathz_authorization_proto != nil { +func init() { file_pathz_authorization_proto_init() } +func file_pathz_authorization_proto_init() { + if File_pathz_authorization_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pathz_authorization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -497,7 +496,7 @@ func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pathz_authorization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Group); i { case 0: return &v.state @@ -509,7 +508,7 @@ func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pathz_authorization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthorizationRule); i { case 0: return &v.state @@ -521,7 +520,7 @@ func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pathz_authorization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthorizationPolicy); i { case 0: return &v.state @@ -534,7 +533,7 @@ func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { } } } - file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_pathz_authorization_proto_msgTypes[2].OneofWrappers = []interface{}{ (*AuthorizationRule_User)(nil), (*AuthorizationRule_Group)(nil), } @@ -542,19 +541,19 @@ func file_github_com_openconfig_gnsi_pathz_authorization_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDesc, + RawDescriptor: file_pathz_authorization_proto_rawDesc, NumEnums: 2, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_github_com_openconfig_gnsi_pathz_authorization_proto_goTypes, - DependencyIndexes: file_github_com_openconfig_gnsi_pathz_authorization_proto_depIdxs, - EnumInfos: file_github_com_openconfig_gnsi_pathz_authorization_proto_enumTypes, - MessageInfos: file_github_com_openconfig_gnsi_pathz_authorization_proto_msgTypes, + GoTypes: file_pathz_authorization_proto_goTypes, + DependencyIndexes: file_pathz_authorization_proto_depIdxs, + EnumInfos: file_pathz_authorization_proto_enumTypes, + MessageInfos: file_pathz_authorization_proto_msgTypes, }.Build() - File_github_com_openconfig_gnsi_pathz_authorization_proto = out.File - file_github_com_openconfig_gnsi_pathz_authorization_proto_rawDesc = nil - file_github_com_openconfig_gnsi_pathz_authorization_proto_goTypes = nil - file_github_com_openconfig_gnsi_pathz_authorization_proto_depIdxs = nil + File_pathz_authorization_proto = out.File + file_pathz_authorization_proto_rawDesc = nil + file_pathz_authorization_proto_goTypes = nil + file_pathz_authorization_proto_depIdxs = nil } diff --git a/version/BUILD.bazel b/version/BUILD.bazel index e047013..35f8775 100644 --- a/version/BUILD.bazel +++ b/version/BUILD.bazel @@ -1,19 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto_grpc//cpp:defs.bzl", "cpp_proto_library") load("//:common.bzl", "use_new_compilers") -use_new_compilers() package(default_visibility = ["//visibility:public"]) +use_new_compilers() + proto_library( name = "version_proto", srcs = [ "version.proto", ], - deps = ["@com_github_openconfig_gnoi//types:types_proto"], import_prefix = "github.com/openconfig/gnsi", - visibility = ["//visibility:public"], + deps = ["@com_github_openconfig_gnoi//types:types_proto"], ) cpp_proto_library( @@ -26,11 +27,15 @@ cpp_proto_library( go_proto_library( name = "version_go_proto", - compilers = ["go_protoc_gen_go"], importpath = "github.com/openconfig/gnsi/version", proto = ":version_proto", deps = [ "@com_github_openconfig_gnoi//types:types_go_proto", ], - visibility = ["//visibility:public"], -) \ No newline at end of file +) + +go_library( + name = "version", + embed = [":version_go_proto"], + importpath = "github.com/openconfig/gnsi/version", +)