From d1b671840b77d157c8d9a12f303c50b3ac6d15f5 Mon Sep 17 00:00:00 2001 From: Marcus Hines Date: Mon, 22 Apr 2024 14:58:00 +0000 Subject: [PATCH] Standardize grpc compiler setup in repo Unify authorization and pathz proto --- acctz/acctz_grpc.pb.go | 250 -------- authz/authz_grpc.pb.go | 210 ------ certz/BUILD.bazel | 5 +- certz/certz.pb.go | 261 ++++++++ certz/certz_grpc.pb.go | 282 -------- credentialz/credentialz_grpc.pb.go | 278 -------- pathz/BUILD.bazel | 6 +- pathz/authorization.pb.go | 559 ---------------- pathz/authorization.proto | 103 --- pathz/pathz.pb.go | 996 ++++++++++++++++++++++++----- pathz/pathz.proto | 81 ++- pathz/pathz_grpc.pb.go | 210 ------ version/BUILD.bazel | 1 + 13 files changed, 1170 insertions(+), 2072 deletions(-) delete mode 100755 acctz/acctz_grpc.pb.go delete mode 100644 authz/authz_grpc.pb.go delete mode 100644 certz/certz_grpc.pb.go delete mode 100644 credentialz/credentialz_grpc.pb.go delete mode 100644 pathz/authorization.pb.go delete mode 100644 pathz/authorization.proto delete mode 100644 pathz/pathz_grpc.pb.go diff --git a/acctz/acctz_grpc.pb.go b/acctz/acctz_grpc.pb.go deleted file mode 100755 index 704109e..0000000 --- a/acctz/acctz_grpc.pb.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.10 -// source: github.com/openconfig/gnsi/acctz/acctz.proto - -package acctz - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AcctzClient is the client API for Acctz service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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. -// All implementations must embed UnimplementedAcctzServer -// for forward compatibility -type AcctzServer interface { - RecordSubscribe(Acctz_RecordSubscribeServer) error - mustEmbedUnimplementedAcctzServer() -} - -// UnimplementedAcctzServer must 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 (UnimplementedAcctzServer) mustEmbedUnimplementedAcctzServer() {} - -// UnsafeAcctzServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AcctzServer will -// result in compilation errors. -type UnsafeAcctzServer interface { - mustEmbedUnimplementedAcctzServer() -} - -func RegisterAcctzServer(s grpc.ServiceRegistrar, 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 -} - -// Acctz_ServiceDesc is the grpc.ServiceDesc for Acctz service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -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://pkg.go.dev/google.golang.org/grpc/?tab=doc#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. -// All implementations must embed UnimplementedAcctzStreamServer -// for forward compatibility -type AcctzStreamServer interface { - RecordSubscribe(*RecordRequest, AcctzStream_RecordSubscribeServer) error - mustEmbedUnimplementedAcctzStreamServer() -} - -// UnimplementedAcctzStreamServer must 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 (UnimplementedAcctzStreamServer) mustEmbedUnimplementedAcctzStreamServer() {} - -// UnsafeAcctzStreamServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AcctzStreamServer will -// result in compilation errors. -type UnsafeAcctzStreamServer interface { - mustEmbedUnimplementedAcctzStreamServer() -} - -func RegisterAcctzStreamServer(s grpc.ServiceRegistrar, 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) -} - -// AcctzStream_ServiceDesc is the grpc.ServiceDesc for AcctzStream service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -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/authz_grpc.pb.go b/authz/authz_grpc.pb.go deleted file mode 100644 index ffa6749..0000000 --- a/authz/authz_grpc.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.10 -// source: github.com/openconfig/gnsi/authz/authz.proto - -package authz - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AuthzClient is the client API for Authz service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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. -// All implementations must embed UnimplementedAuthzServer -// for forward compatibility -type AuthzServer interface { - Rotate(Authz_RotateServer) error - Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) - Get(context.Context, *GetRequest) (*GetResponse, error) - mustEmbedUnimplementedAuthzServer() -} - -// UnimplementedAuthzServer must 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 (UnimplementedAuthzServer) mustEmbedUnimplementedAuthzServer() {} - -// UnsafeAuthzServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthzServer will -// result in compilation errors. -type UnsafeAuthzServer interface { - mustEmbedUnimplementedAuthzServer() -} - -func RegisterAuthzServer(s grpc.ServiceRegistrar, 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) -} - -// Authz_ServiceDesc is the grpc.ServiceDesc for Authz service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -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 84b327a..e6b15a0 100644 --- a/certz/BUILD.bazel +++ b/certz/BUILD.bazel @@ -38,10 +38,7 @@ cpp_grpc_library( go_proto_library( name = "certz_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/certz", proto = ":certz_proto", deps = ["//version:version_go_proto"], diff --git a/certz/certz.pb.go b/certz/certz.pb.go index d62215e..f9d393d 100644 --- a/certz/certz.pb.go +++ b/certz/certz.pb.go @@ -7,7 +7,11 @@ package cert 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" @@ -2899,3 +2903,260 @@ func file_github_com_openconfig_gnsi_certz_certz_proto_init() { file_github_com_openconfig_gnsi_certz_certz_proto_goTypes = nil file_github_com_openconfig_gnsi_certz_certz_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 + +// CertzClient is the client API for Certz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CertzClient interface { + Rotate(ctx context.Context, opts ...grpc.CallOption) (Certz_RotateClient, error) + AddProfile(ctx context.Context, in *AddProfileRequest, opts ...grpc.CallOption) (*AddProfileResponse, error) + DeleteProfile(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*DeleteProfileResponse, error) + GetProfileList(ctx context.Context, in *GetProfileListRequest, opts ...grpc.CallOption) (*GetProfileListResponse, error) + CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) +} + +type certzClient struct { + cc grpc.ClientConnInterface +} + +func NewCertzClient(cc grpc.ClientConnInterface) CertzClient { + return &certzClient{cc} +} + +func (c *certzClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (Certz_RotateClient, error) { + stream, err := c.cc.NewStream(ctx, &_Certz_serviceDesc.Streams[0], "/gnsi.certz.v1.Certz/Rotate", opts...) + if err != nil { + return nil, err + } + x := &certzRotateClient{stream} + return x, nil +} + +type Certz_RotateClient interface { + Send(*RotateCertificateRequest) error + Recv() (*RotateCertificateResponse, error) + grpc.ClientStream +} + +type certzRotateClient struct { + grpc.ClientStream +} + +func (x *certzRotateClient) Send(m *RotateCertificateRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *certzRotateClient) Recv() (*RotateCertificateResponse, error) { + m := new(RotateCertificateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *certzClient) AddProfile(ctx context.Context, in *AddProfileRequest, opts ...grpc.CallOption) (*AddProfileResponse, error) { + out := new(AddProfileResponse) + err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/AddProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *certzClient) DeleteProfile(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*DeleteProfileResponse, error) { + out := new(DeleteProfileResponse) + err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/DeleteProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *certzClient) GetProfileList(ctx context.Context, in *GetProfileListRequest, opts ...grpc.CallOption) (*GetProfileListResponse, error) { + out := new(GetProfileListResponse) + err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/GetProfileList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *certzClient) CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) { + out := new(CanGenerateCSRResponse) + err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/CanGenerateCSR", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CertzServer is the server API for Certz service. +type CertzServer interface { + Rotate(Certz_RotateServer) error + AddProfile(context.Context, *AddProfileRequest) (*AddProfileResponse, error) + DeleteProfile(context.Context, *DeleteProfileRequest) (*DeleteProfileResponse, error) + GetProfileList(context.Context, *GetProfileListRequest) (*GetProfileListResponse, error) + CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) +} + +// UnimplementedCertzServer can be embedded to have forward compatible implementations. +type UnimplementedCertzServer struct { +} + +func (*UnimplementedCertzServer) Rotate(Certz_RotateServer) error { + return status.Errorf(codes.Unimplemented, "method Rotate not implemented") +} +func (*UnimplementedCertzServer) AddProfile(context.Context, *AddProfileRequest) (*AddProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddProfile not implemented") +} +func (*UnimplementedCertzServer) DeleteProfile(context.Context, *DeleteProfileRequest) (*DeleteProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteProfile not implemented") +} +func (*UnimplementedCertzServer) GetProfileList(context.Context, *GetProfileListRequest) (*GetProfileListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProfileList not implemented") +} +func (*UnimplementedCertzServer) CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CanGenerateCSR not implemented") +} + +func RegisterCertzServer(s *grpc.Server, srv CertzServer) { + s.RegisterService(&_Certz_serviceDesc, srv) +} + +func _Certz_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CertzServer).Rotate(&certzRotateServer{stream}) +} + +type Certz_RotateServer interface { + Send(*RotateCertificateResponse) error + Recv() (*RotateCertificateRequest, error) + grpc.ServerStream +} + +type certzRotateServer struct { + grpc.ServerStream +} + +func (x *certzRotateServer) Send(m *RotateCertificateResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *certzRotateServer) Recv() (*RotateCertificateRequest, error) { + m := new(RotateCertificateRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Certz_AddProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertzServer).AddProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.certz.v1.Certz/AddProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertzServer).AddProfile(ctx, req.(*AddProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Certz_DeleteProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertzServer).DeleteProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.certz.v1.Certz/DeleteProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertzServer).DeleteProfile(ctx, req.(*DeleteProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Certz_GetProfileList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertzServer).GetProfileList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.certz.v1.Certz/GetProfileList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertzServer).GetProfileList(ctx, req.(*GetProfileListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Certz_CanGenerateCSR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CanGenerateCSRRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertzServer).CanGenerateCSR(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.certz.v1.Certz/CanGenerateCSR", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertzServer).CanGenerateCSR(ctx, req.(*CanGenerateCSRRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Certz_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.certz.v1.Certz", + HandlerType: (*CertzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddProfile", + Handler: _Certz_AddProfile_Handler, + }, + { + MethodName: "DeleteProfile", + Handler: _Certz_DeleteProfile_Handler, + }, + { + MethodName: "GetProfileList", + Handler: _Certz_GetProfileList_Handler, + }, + { + MethodName: "CanGenerateCSR", + Handler: _Certz_CanGenerateCSR_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Rotate", + Handler: _Certz_Rotate_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/certz/certz.proto", +} diff --git a/certz/certz_grpc.pb.go b/certz/certz_grpc.pb.go deleted file mode 100644 index a1b44ac..0000000 --- a/certz/certz_grpc.pb.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.10 -// source: github.com/openconfig/gnsi/certz/certz.proto - -package cert - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// CertzClient is the client API for Certz service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type CertzClient interface { - Rotate(ctx context.Context, opts ...grpc.CallOption) (Certz_RotateClient, error) - AddProfile(ctx context.Context, in *AddProfileRequest, opts ...grpc.CallOption) (*AddProfileResponse, error) - DeleteProfile(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*DeleteProfileResponse, error) - GetProfileList(ctx context.Context, in *GetProfileListRequest, opts ...grpc.CallOption) (*GetProfileListResponse, error) - CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) -} - -type certzClient struct { - cc grpc.ClientConnInterface -} - -func NewCertzClient(cc grpc.ClientConnInterface) CertzClient { - return &certzClient{cc} -} - -func (c *certzClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (Certz_RotateClient, error) { - stream, err := c.cc.NewStream(ctx, &Certz_ServiceDesc.Streams[0], "/gnsi.certz.v1.Certz/Rotate", opts...) - if err != nil { - return nil, err - } - x := &certzRotateClient{stream} - return x, nil -} - -type Certz_RotateClient interface { - Send(*RotateCertificateRequest) error - Recv() (*RotateCertificateResponse, error) - grpc.ClientStream -} - -type certzRotateClient struct { - grpc.ClientStream -} - -func (x *certzRotateClient) Send(m *RotateCertificateRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *certzRotateClient) Recv() (*RotateCertificateResponse, error) { - m := new(RotateCertificateResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *certzClient) AddProfile(ctx context.Context, in *AddProfileRequest, opts ...grpc.CallOption) (*AddProfileResponse, error) { - out := new(AddProfileResponse) - err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/AddProfile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *certzClient) DeleteProfile(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*DeleteProfileResponse, error) { - out := new(DeleteProfileResponse) - err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/DeleteProfile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *certzClient) GetProfileList(ctx context.Context, in *GetProfileListRequest, opts ...grpc.CallOption) (*GetProfileListResponse, error) { - out := new(GetProfileListResponse) - err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/GetProfileList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *certzClient) CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) { - out := new(CanGenerateCSRResponse) - err := c.cc.Invoke(ctx, "/gnsi.certz.v1.Certz/CanGenerateCSR", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CertzServer is the server API for Certz service. -// All implementations must embed UnimplementedCertzServer -// for forward compatibility -type CertzServer interface { - Rotate(Certz_RotateServer) error - AddProfile(context.Context, *AddProfileRequest) (*AddProfileResponse, error) - DeleteProfile(context.Context, *DeleteProfileRequest) (*DeleteProfileResponse, error) - GetProfileList(context.Context, *GetProfileListRequest) (*GetProfileListResponse, error) - CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) - mustEmbedUnimplementedCertzServer() -} - -// UnimplementedCertzServer must be embedded to have forward compatible implementations. -type UnimplementedCertzServer struct { -} - -func (UnimplementedCertzServer) Rotate(Certz_RotateServer) error { - return status.Errorf(codes.Unimplemented, "method Rotate not implemented") -} -func (UnimplementedCertzServer) AddProfile(context.Context, *AddProfileRequest) (*AddProfileResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddProfile not implemented") -} -func (UnimplementedCertzServer) DeleteProfile(context.Context, *DeleteProfileRequest) (*DeleteProfileResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteProfile not implemented") -} -func (UnimplementedCertzServer) GetProfileList(context.Context, *GetProfileListRequest) (*GetProfileListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProfileList not implemented") -} -func (UnimplementedCertzServer) CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CanGenerateCSR not implemented") -} -func (UnimplementedCertzServer) mustEmbedUnimplementedCertzServer() {} - -// UnsafeCertzServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CertzServer will -// result in compilation errors. -type UnsafeCertzServer interface { - mustEmbedUnimplementedCertzServer() -} - -func RegisterCertzServer(s grpc.ServiceRegistrar, srv CertzServer) { - s.RegisterService(&Certz_ServiceDesc, srv) -} - -func _Certz_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CertzServer).Rotate(&certzRotateServer{stream}) -} - -type Certz_RotateServer interface { - Send(*RotateCertificateResponse) error - Recv() (*RotateCertificateRequest, error) - grpc.ServerStream -} - -type certzRotateServer struct { - grpc.ServerStream -} - -func (x *certzRotateServer) Send(m *RotateCertificateResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *certzRotateServer) Recv() (*RotateCertificateRequest, error) { - m := new(RotateCertificateRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Certz_AddProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddProfileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CertzServer).AddProfile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.certz.v1.Certz/AddProfile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CertzServer).AddProfile(ctx, req.(*AddProfileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Certz_DeleteProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteProfileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CertzServer).DeleteProfile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.certz.v1.Certz/DeleteProfile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CertzServer).DeleteProfile(ctx, req.(*DeleteProfileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Certz_GetProfileList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProfileListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CertzServer).GetProfileList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.certz.v1.Certz/GetProfileList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CertzServer).GetProfileList(ctx, req.(*GetProfileListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Certz_CanGenerateCSR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CanGenerateCSRRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CertzServer).CanGenerateCSR(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.certz.v1.Certz/CanGenerateCSR", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CertzServer).CanGenerateCSR(ctx, req.(*CanGenerateCSRRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Certz_ServiceDesc is the grpc.ServiceDesc for Certz service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Certz_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gnsi.certz.v1.Certz", - HandlerType: (*CertzServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddProfile", - Handler: _Certz_AddProfile_Handler, - }, - { - MethodName: "DeleteProfile", - Handler: _Certz_DeleteProfile_Handler, - }, - { - MethodName: "GetProfileList", - Handler: _Certz_GetProfileList_Handler, - }, - { - MethodName: "CanGenerateCSR", - Handler: _Certz_CanGenerateCSR_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Rotate", - Handler: _Certz_Rotate_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/openconfig/gnsi/certz/certz.proto", -} diff --git a/credentialz/credentialz_grpc.pb.go b/credentialz/credentialz_grpc.pb.go deleted file mode 100644 index 6b013d0..0000000 --- a/credentialz/credentialz_grpc.pb.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.10 -// source: github.com/openconfig/gnsi/credentialz/credentialz.proto - -package credentialz - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// CredentialzClient is the client API for Credentialz service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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. -// All implementations must embed UnimplementedCredentialzServer -// for forward compatibility -type CredentialzServer interface { - RotateAccountCredentials(Credentialz_RotateAccountCredentialsServer) error - RotateHostParameters(Credentialz_RotateHostParametersServer) error - CanGenerateKey(context.Context, *CanGenerateKeyRequest) (*CanGenerateKeyResponse, error) - GetPublicKeys(context.Context, *GetPublicKeysRequest) (*GetPublicKeysResponse, error) - mustEmbedUnimplementedCredentialzServer() -} - -// UnimplementedCredentialzServer must 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 (UnimplementedCredentialzServer) mustEmbedUnimplementedCredentialzServer() {} - -// UnsafeCredentialzServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CredentialzServer will -// result in compilation errors. -type UnsafeCredentialzServer interface { - mustEmbedUnimplementedCredentialzServer() -} - -func RegisterCredentialzServer(s grpc.ServiceRegistrar, 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) -} - -// Credentialz_ServiceDesc is the grpc.ServiceDesc for Credentialz service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -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/pathz/BUILD.bazel b/pathz/BUILD.bazel index f915805..bbf1c9b 100644 --- a/pathz/BUILD.bazel +++ b/pathz/BUILD.bazel @@ -10,7 +10,10 @@ use_new_compilers() proto_library( name = "pathz_proto", - srcs = ["authorization.proto"], + srcs = [ + "pathz.proto", + ], + import_prefix = "github.com/openconfig/gnsi/pathz", deps = [ "@com_github_openconfig_gnmi//proto/gnmi:gnmi_proto", "//version:version_proto", @@ -36,6 +39,7 @@ cpp_grpc_library( ############################################################################## go_proto_library( name = "pathz_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnsi/pathz", proto = ":pathz_proto", deps = [ diff --git a/pathz/authorization.pb.go b/pathz/authorization.pb.go deleted file mode 100644 index ce0e3cd..0000000 --- a/pathz/authorization.pb.go +++ /dev/null @@ -1,559 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.10 -// source: pathz/authorization.proto - -package pathz - -import ( - gnmi "github.com/openconfig/gnmi/proto/gnmi" - _ "github.com/openconfig/gnsi/version" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Action int32 - -const ( - Action_ACTION_UNSPECIFIED Action = 0 - Action_ACTION_DENY Action = 1 - Action_ACTION_PERMIT Action = 2 -) - -// Enum value maps for Action. -var ( - Action_name = map[int32]string{ - 0: "ACTION_UNSPECIFIED", - 1: "ACTION_DENY", - 2: "ACTION_PERMIT", - } - Action_value = map[string]int32{ - "ACTION_UNSPECIFIED": 0, - "ACTION_DENY": 1, - "ACTION_PERMIT": 2, - } -) - -func (x Action) Enum() *Action { - p := new(Action) - *p = x - return p -} - -func (x Action) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Action) Descriptor() protoreflect.EnumDescriptor { - return file_pathz_authorization_proto_enumTypes[0].Descriptor() -} - -func (Action) Type() protoreflect.EnumType { - return &file_pathz_authorization_proto_enumTypes[0] -} - -func (x Action) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Action.Descriptor instead. -func (Action) EnumDescriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{0} -} - -type Mode int32 - -const ( - Mode_MODE_UNSPECIFIED Mode = 0 - Mode_MODE_READ Mode = 1 - Mode_MODE_WRITE Mode = 2 -) - -// Enum value maps for Mode. -var ( - Mode_name = map[int32]string{ - 0: "MODE_UNSPECIFIED", - 1: "MODE_READ", - 2: "MODE_WRITE", - } - Mode_value = map[string]int32{ - "MODE_UNSPECIFIED": 0, - "MODE_READ": 1, - "MODE_WRITE": 2, - } -) - -func (x Mode) Enum() *Mode { - p := new(Mode) - *p = x - return p -} - -func (x Mode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Mode) Descriptor() protoreflect.EnumDescriptor { - return file_pathz_authorization_proto_enumTypes[1].Descriptor() -} - -func (Mode) Type() protoreflect.EnumType { - return &file_pathz_authorization_proto_enumTypes[1] -} - -func (x Mode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Mode.Descriptor instead. -func (Mode) EnumDescriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{1} -} - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_pathz_authorization_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_pathz_authorization_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{0} -} - -func (x *User) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type Group struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Users []*User `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` -} - -func (x *Group) Reset() { - *x = Group{} - if protoimpl.UnsafeEnabled { - mi := &file_pathz_authorization_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Group) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group) ProtoMessage() {} - -func (x *Group) ProtoReflect() protoreflect.Message { - mi := &file_pathz_authorization_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Group.ProtoReflect.Descriptor instead. -func (*Group) Descriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{1} -} - -func (x *Group) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Group) GetUsers() []*User { - if x != nil { - return x.Users - } - return nil -} - -type AuthorizationRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Types that are assignable to Principal: - // *AuthorizationRule_User - // *AuthorizationRule_Group - Principal isAuthorizationRule_Principal `protobuf_oneof:"principal"` - Path *gnmi.Path `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` - Action Action `protobuf:"varint,5,opt,name=action,proto3,enum=gnsi.pathz.Action" json:"action,omitempty"` - Mode Mode `protobuf:"varint,6,opt,name=mode,proto3,enum=gnsi.pathz.Mode" json:"mode,omitempty"` -} - -func (x *AuthorizationRule) Reset() { - *x = AuthorizationRule{} - if protoimpl.UnsafeEnabled { - mi := &file_pathz_authorization_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthorizationRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthorizationRule) ProtoMessage() {} - -func (x *AuthorizationRule) ProtoReflect() protoreflect.Message { - mi := &file_pathz_authorization_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthorizationRule.ProtoReflect.Descriptor instead. -func (*AuthorizationRule) Descriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{2} -} - -func (x *AuthorizationRule) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (m *AuthorizationRule) GetPrincipal() isAuthorizationRule_Principal { - if m != nil { - return m.Principal - } - return nil -} - -func (x *AuthorizationRule) GetUser() string { - if x, ok := x.GetPrincipal().(*AuthorizationRule_User); ok { - return x.User - } - return "" -} - -func (x *AuthorizationRule) GetGroup() string { - if x, ok := x.GetPrincipal().(*AuthorizationRule_Group); ok { - return x.Group - } - return "" -} - -func (x *AuthorizationRule) GetPath() *gnmi.Path { - if x != nil { - return x.Path - } - return nil -} - -func (x *AuthorizationRule) GetAction() Action { - if x != nil { - return x.Action - } - return Action_ACTION_UNSPECIFIED -} - -func (x *AuthorizationRule) GetMode() Mode { - if x != nil { - return x.Mode - } - return Mode_MODE_UNSPECIFIED -} - -type isAuthorizationRule_Principal interface { - isAuthorizationRule_Principal() -} - -type AuthorizationRule_User struct { - User string `protobuf:"bytes,2,opt,name=user,proto3,oneof"` -} - -type AuthorizationRule_Group struct { - Group string `protobuf:"bytes,3,opt,name=group,proto3,oneof"` -} - -func (*AuthorizationRule_User) isAuthorizationRule_Principal() {} - -func (*AuthorizationRule_Group) isAuthorizationRule_Principal() {} - -type AuthorizationPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Rules []*AuthorizationRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - Groups []*Group `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` -} - -func (x *AuthorizationPolicy) Reset() { - *x = AuthorizationPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_pathz_authorization_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthorizationPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthorizationPolicy) ProtoMessage() {} - -func (x *AuthorizationPolicy) ProtoReflect() protoreflect.Message { - mi := &file_pathz_authorization_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthorizationPolicy.ProtoReflect.Descriptor instead. -func (*AuthorizationPolicy) Descriptor() ([]byte, []int) { - return file_pathz_authorization_proto_rawDescGZIP(), []int{3} -} - -func (x *AuthorizationPolicy) GetRules() []*AuthorizationRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *AuthorizationPolicy) GetGroups() []*Group { - if x != nil { - return x.Groups - } - return nil -} - -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_pathz_authorization_proto_rawDescOnce sync.Once - file_pathz_authorization_proto_rawDescData = file_pathz_authorization_proto_rawDesc -) - -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_pathz_authorization_proto_rawDescData -} - -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 - (*Group)(nil), // 3: gnsi.pathz.Group - (*AuthorizationRule)(nil), // 4: gnsi.pathz.AuthorizationRule - (*AuthorizationPolicy)(nil), // 5: gnsi.pathz.AuthorizationPolicy - (*gnmi.Path)(nil), // 6: gnmi.Path -} -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 - 1, // 3: gnsi.pathz.AuthorizationRule.mode:type_name -> gnsi.pathz.Mode - 4, // 4: gnsi.pathz.AuthorizationPolicy.rules:type_name -> gnsi.pathz.AuthorizationRule - 3, // 5: gnsi.pathz.AuthorizationPolicy.groups:type_name -> gnsi.pathz.Group - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_pathz_authorization_proto_init() } -func file_pathz_authorization_proto_init() { - if File_pathz_authorization_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pathz_authorization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pathz_authorization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pathz_authorization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthorizationRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pathz_authorization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthorizationPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_pathz_authorization_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*AuthorizationRule_User)(nil), - (*AuthorizationRule_Group)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pathz_authorization_proto_rawDesc, - NumEnums: 2, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - 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_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/pathz/authorization.proto b/pathz/authorization.proto deleted file mode 100644 index 4362ad3..0000000 --- a/pathz/authorization.proto +++ /dev/null @@ -1,103 +0,0 @@ -// Authorization for gnXi operations. -// -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Define a list of policies, where the most specific policy is applied -// on the device authorizing the action. -// -// Users may be referenced by user name, or as a group with a group name. -// Groups are defined and managed in the authorization policy itself. -// -// Paths may be referenced in whole or in complete parts, ie: -// /interfaces/interface[name=Ethernet1/2/3]/state/counters -// /interfaces/interface[name=*]/state/oper-status -// /network-instances/network-instance/tables/table[proto=BGP][family=*] -// -// Paths are gnmi.Path protobufs. -// -// The most specific match is returned for a request, this means the longest -// path and the most specific user match (user preferred over group). -// -// Additionally, the policy maintains a timestamp of creation -// and version number from the underlying version control system. -// The version/timestamp are available to requestors to verify which version -// of policy is being applied at the time of the request. -// -syntax = "proto3"; - -package gnsi.pathz; - -import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; -import "github.com/openconfig/gnsi/version/version.proto"; - -option go_package = "github.com/openconfig/gnsi/pathz"; - -// User is a singular username used only in the matching criteria. -message User { - string name = 1; -} - -// Group is a group of users, groups are a construct of the policy configuration -// as a method to collect many users with the same authorizations together. -message Group { - string name = 1; - repeated User users = 2; -} - -// Action is the defined action for an AuthorizationPolicy. -enum Action { - ACTION_UNSPECIFIED = 0; - ACTION_DENY = 1; - ACTION_PERMIT = 2; -} - -// Mode is: -// READ: Ability to read/subscribe to data from the model. -// WRITE: Ability to mutate/write updates to data in the model. -enum Mode { - MODE_UNSPECIFIED = 0; - MODE_READ = 1; - MODE_WRITE = 2; -} - -message AuthorizationRule { - // Policy Identifier, a unique string per policy/rule, eg: uuid. - string id = 1; - - oneof principal { - string user = 2; - string group = 3; - } - - // Path is the request path, longest prefix (by path elements from left - // to right). - gnmi.Path path = 4; - - // Permit or deny the user/group access to the path specified. - Action action = 5; - - // Permit Read or Write access to the path specified. - Mode mode = 6; -} - -// AuthorizationPolicy includes rules and user/group information. -// The service which updates the policies will provide both a -// created_on - int64 - seconds since Jan 01 1970 00:00:00 -// version - string - unique among the implementation's policies deployed. -message AuthorizationPolicy { - repeated AuthorizationRule rules = 1; - // Groups of usernames collected for simplicity of policy expression. - repeated Group groups = 2; -} diff --git a/pathz/pathz.pb.go b/pathz/pathz.pb.go index 28bc51d..6c65003 100755 --- a/pathz/pathz.pb.go +++ b/pathz/pathz.pb.go @@ -2,13 +2,17 @@ // versions: // protoc-gen-go v1.30.0 // protoc v3.21.10 -// source: github.com/openconfig/gnsi/pathz/pathz.proto +// source: github.com/openconfig/gnsi/pathz/pathz/pathz.proto package pathz import ( + context "context" gnmi "github.com/openconfig/gnmi/proto/gnmi" _ "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" @@ -55,11 +59,11 @@ func (x PolicyInstance) String() string { } func (PolicyInstance) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_enumTypes[0].Descriptor() + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[0].Descriptor() } func (PolicyInstance) Type() protoreflect.EnumType { - return &file_github_com_openconfig_gnsi_pathz_pathz_proto_enumTypes[0] + return &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[0] } func (x PolicyInstance) Number() protoreflect.EnumNumber { @@ -68,7 +72,105 @@ func (x PolicyInstance) Number() protoreflect.EnumNumber { // Deprecated: Use PolicyInstance.Descriptor instead. func (PolicyInstance) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{0} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{0} +} + +type Action int32 + +const ( + Action_ACTION_UNSPECIFIED Action = 0 + Action_ACTION_DENY Action = 1 + Action_ACTION_PERMIT Action = 2 +) + +// Enum value maps for Action. +var ( + Action_name = map[int32]string{ + 0: "ACTION_UNSPECIFIED", + 1: "ACTION_DENY", + 2: "ACTION_PERMIT", + } + Action_value = map[string]int32{ + "ACTION_UNSPECIFIED": 0, + "ACTION_DENY": 1, + "ACTION_PERMIT": 2, + } +) + +func (x Action) Enum() *Action { + p := new(Action) + *p = x + return p +} + +func (x Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Action) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[1].Descriptor() +} + +func (Action) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[1] +} + +func (x Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Action.Descriptor instead. +func (Action) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{1} +} + +type Mode int32 + +const ( + Mode_MODE_UNSPECIFIED Mode = 0 + Mode_MODE_READ Mode = 1 + Mode_MODE_WRITE Mode = 2 +) + +// Enum value maps for Mode. +var ( + Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 1: "MODE_READ", + 2: "MODE_WRITE", + } + Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "MODE_READ": 1, + "MODE_WRITE": 2, + } +) + +func (x Mode) Enum() *Mode { + p := new(Mode) + *p = x + return p +} + +func (x Mode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Mode) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[2].Descriptor() +} + +func (Mode) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes[2] +} + +func (x Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Mode.Descriptor instead. +func (Mode) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{2} } type RotateRequest struct { @@ -86,7 +188,7 @@ type RotateRequest struct { func (x *RotateRequest) Reset() { *x = RotateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[0] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -99,7 +201,7 @@ func (x *RotateRequest) String() string { func (*RotateRequest) ProtoMessage() {} func (x *RotateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[0] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -112,7 +214,7 @@ func (x *RotateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RotateRequest.ProtoReflect.Descriptor instead. func (*RotateRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{0} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{0} } func (m *RotateRequest) GetRotateRequest() isRotateRequest_RotateRequest { @@ -172,7 +274,7 @@ type RotateResponse struct { func (x *RotateResponse) Reset() { *x = RotateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[1] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -185,7 +287,7 @@ func (x *RotateResponse) String() string { func (*RotateResponse) ProtoMessage() {} func (x *RotateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[1] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -198,7 +300,7 @@ func (x *RotateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RotateResponse.ProtoReflect.Descriptor instead. func (*RotateResponse) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{1} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{1} } func (m *RotateResponse) GetResponse() isRotateResponse_Response { @@ -234,7 +336,7 @@ type FinalizeRequest struct { func (x *FinalizeRequest) Reset() { *x = FinalizeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[2] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -247,7 +349,7 @@ func (x *FinalizeRequest) String() string { func (*FinalizeRequest) ProtoMessage() {} func (x *FinalizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[2] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -260,7 +362,7 @@ func (x *FinalizeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeRequest.ProtoReflect.Descriptor instead. func (*FinalizeRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{2} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{2} } type UploadRequest struct { @@ -276,7 +378,7 @@ type UploadRequest struct { func (x *UploadRequest) Reset() { *x = UploadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[3] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -289,7 +391,7 @@ func (x *UploadRequest) String() string { func (*UploadRequest) ProtoMessage() {} func (x *UploadRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[3] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -302,7 +404,7 @@ func (x *UploadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. func (*UploadRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{3} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{3} } func (x *UploadRequest) GetVersion() string { @@ -335,7 +437,7 @@ type UploadResponse struct { func (x *UploadResponse) Reset() { *x = UploadResponse{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[4] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -348,7 +450,7 @@ func (x *UploadResponse) String() string { func (*UploadResponse) ProtoMessage() {} func (x *UploadResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[4] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -361,7 +463,7 @@ func (x *UploadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead. func (*UploadResponse) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{4} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{4} } type ProbeRequest struct { @@ -371,14 +473,14 @@ type ProbeRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Path *gnmi.Path `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Mode Mode `protobuf:"varint,3,opt,name=mode,proto3,enum=gnsi.pathz.Mode" json:"mode,omitempty"` + Mode Mode `protobuf:"varint,3,opt,name=mode,proto3,enum=gnsi.pathz.v1.Mode" json:"mode,omitempty"` PolicyInstance PolicyInstance `protobuf:"varint,4,opt,name=policy_instance,json=policyInstance,proto3,enum=gnsi.pathz.v1.PolicyInstance" json:"policy_instance,omitempty"` } func (x *ProbeRequest) Reset() { *x = ProbeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[5] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -391,7 +493,7 @@ func (x *ProbeRequest) String() string { func (*ProbeRequest) ProtoMessage() {} func (x *ProbeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[5] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -404,7 +506,7 @@ func (x *ProbeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ProbeRequest.ProtoReflect.Descriptor instead. func (*ProbeRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{5} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{5} } func (x *ProbeRequest) GetUser() string { @@ -440,14 +542,14 @@ type ProbeResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Action Action `protobuf:"varint,1,opt,name=action,proto3,enum=gnsi.pathz.Action" json:"action,omitempty"` + Action Action `protobuf:"varint,1,opt,name=action,proto3,enum=gnsi.pathz.v1.Action" json:"action,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` } func (x *ProbeResponse) Reset() { *x = ProbeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[6] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -460,7 +562,7 @@ func (x *ProbeResponse) String() string { func (*ProbeResponse) ProtoMessage() {} func (x *ProbeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[6] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -473,7 +575,7 @@ func (x *ProbeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ProbeResponse.ProtoReflect.Descriptor instead. func (*ProbeResponse) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{6} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{6} } func (x *ProbeResponse) GetAction() Action { @@ -501,7 +603,7 @@ type GetRequest struct { func (x *GetRequest) Reset() { *x = GetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[7] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -514,7 +616,7 @@ func (x *GetRequest) String() string { func (*GetRequest) ProtoMessage() {} func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[7] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -527,7 +629,7 @@ func (x *GetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. func (*GetRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{7} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{7} } func (x *GetRequest) GetPolicyInstance() PolicyInstance { @@ -550,7 +652,7 @@ type GetResponse struct { func (x *GetResponse) Reset() { *x = GetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[8] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -563,7 +665,7 @@ func (x *GetResponse) String() string { func (*GetResponse) ProtoMessage() {} func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[8] + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -576,7 +678,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. func (*GetResponse) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP(), []int{8} + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{8} } func (x *GetResponse) GetVersion() string { @@ -600,19 +702,285 @@ func (x *GetResponse) GetPolicy() *AuthorizationPolicy { return nil } -var File_github_com_openconfig_gnsi_pathz_pathz_proto protoreflect.FileDescriptor +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{9} +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Group struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Users []*User `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *Group) Reset() { + *x = Group{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Group) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Group) ProtoMessage() {} + +func (x *Group) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Group.ProtoReflect.Descriptor instead. +func (*Group) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{10} +} + +func (x *Group) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Group) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +type AuthorizationRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Types that are assignable to Principal: + // *AuthorizationRule_User + // *AuthorizationRule_Group + Principal isAuthorizationRule_Principal `protobuf_oneof:"principal"` + Path *gnmi.Path `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + Action Action `protobuf:"varint,5,opt,name=action,proto3,enum=gnsi.pathz.v1.Action" json:"action,omitempty"` + Mode Mode `protobuf:"varint,6,opt,name=mode,proto3,enum=gnsi.pathz.v1.Mode" json:"mode,omitempty"` +} + +func (x *AuthorizationRule) Reset() { + *x = AuthorizationRule{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthorizationRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthorizationRule) ProtoMessage() {} + +func (x *AuthorizationRule) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthorizationRule.ProtoReflect.Descriptor instead. +func (*AuthorizationRule) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{11} +} + +func (x *AuthorizationRule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (m *AuthorizationRule) GetPrincipal() isAuthorizationRule_Principal { + if m != nil { + return m.Principal + } + return nil +} + +func (x *AuthorizationRule) GetUser() string { + if x, ok := x.GetPrincipal().(*AuthorizationRule_User); ok { + return x.User + } + return "" +} + +func (x *AuthorizationRule) GetGroup() string { + if x, ok := x.GetPrincipal().(*AuthorizationRule_Group); ok { + return x.Group + } + return "" +} + +func (x *AuthorizationRule) GetPath() *gnmi.Path { + if x != nil { + return x.Path + } + return nil +} + +func (x *AuthorizationRule) GetAction() Action { + if x != nil { + return x.Action + } + return Action_ACTION_UNSPECIFIED +} + +func (x *AuthorizationRule) GetMode() Mode { + if x != nil { + return x.Mode + } + return Mode_MODE_UNSPECIFIED +} + +type isAuthorizationRule_Principal interface { + isAuthorizationRule_Principal() +} + +type AuthorizationRule_User struct { + User string `protobuf:"bytes,2,opt,name=user,proto3,oneof"` +} + +type AuthorizationRule_Group struct { + Group string `protobuf:"bytes,3,opt,name=group,proto3,oneof"` +} + +func (*AuthorizationRule_User) isAuthorizationRule_Principal() {} -var file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, +func (*AuthorizationRule_Group) isAuthorizationRule_Principal() {} + +type AuthorizationPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rules []*AuthorizationRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` + Groups []*Group `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` +} + +func (x *AuthorizationPolicy) Reset() { + *x = AuthorizationPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthorizationPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthorizationPolicy) ProtoMessage() {} + +func (x *AuthorizationPolicy) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthorizationPolicy.ProtoReflect.Descriptor instead. +func (*AuthorizationPolicy) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP(), []int{12} +} + +func (x *AuthorizationPolicy) GetRules() []*AuthorizationRule { + if x != nil { + return x.Rules + } + return nil +} + +func (x *AuthorizationPolicy) GetGroups() []*Group { + if x != nil { + return x.Groups + } + return nil +} + +var File_github_com_openconfig_gnsi_pathz_pathz_pathz_proto protoreflect.FileDescriptor + +var file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDesc = []byte{ + 0x0a, 0x32, 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, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, - 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 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, - 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, + 0x68, 0x7a, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, + 0x2e, 0x76, 0x31, 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, @@ -637,133 +1005,178 @@ var file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDesc = []byte{ 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x06, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x12, - 0x37, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 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, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb0, 0x01, 0x0a, 0x0c, 0x50, - 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, - 0x1e, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x24, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 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, 0x12, 0x46, 0x0a, 0x0f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, - 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x55, 0x0a, - 0x0d, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, - 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 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, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x6e, - 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x7f, 0x0a, 0x0b, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x4f, 0x6e, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, + 0x3a, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2a, 0x6a, 0x0a, 0x0e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, - 0x1b, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, - 0x0a, 0x16, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, - 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, - 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, 0x41, - 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x02, 0x32, 0xd4, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, - 0x7a, 0x12, 0x49, 0x0a, 0x06, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6e, - 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, - 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x05, - 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x1b, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, - 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3c, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x19, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, - 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, + 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb3, 0x01, + 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x27, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x22, 0x58, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x12, 0x3a, 0x0a, 0x06, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 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, 0x46, 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, 0x29, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0xd6, 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, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x27, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, + 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 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, 0x7b, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x05, + 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6e, + 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 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, 0x2c, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x2a, 0x6a, 0x0a, 0x0e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x49, + 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, + 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, + 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, + 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x02, 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, 0x32, 0xd4, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, 0x7a, 0x12, 0x49, 0x0a, 0x06, 0x52, + 0x6f, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, + 0x1b, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, + 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x03, 0x47, 0x65, + 0x74, 0x12, 0x19, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, + 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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_pathz_proto_rawDescOnce sync.Once - file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescData = file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDesc + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescOnce sync.Once + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescData = file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDesc ) -func file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescGZIP() []byte { - file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescOnce.Do(func() { - file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescData) +func file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescGZIP() []byte { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescOnce.Do(func() { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescData) }) - return file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDescData + return file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDescData } -var file_github_com_openconfig_gnsi_pathz_pathz_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_github_com_openconfig_gnsi_pathz_pathz_proto_goTypes = []interface{}{ +var file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_goTypes = []interface{}{ (PolicyInstance)(0), // 0: gnsi.pathz.v1.PolicyInstance - (*RotateRequest)(nil), // 1: gnsi.pathz.v1.RotateRequest - (*RotateResponse)(nil), // 2: gnsi.pathz.v1.RotateResponse - (*FinalizeRequest)(nil), // 3: gnsi.pathz.v1.FinalizeRequest - (*UploadRequest)(nil), // 4: gnsi.pathz.v1.UploadRequest - (*UploadResponse)(nil), // 5: gnsi.pathz.v1.UploadResponse - (*ProbeRequest)(nil), // 6: gnsi.pathz.v1.ProbeRequest - (*ProbeResponse)(nil), // 7: gnsi.pathz.v1.ProbeResponse - (*GetRequest)(nil), // 8: gnsi.pathz.v1.GetRequest - (*GetResponse)(nil), // 9: gnsi.pathz.v1.GetResponse - (*AuthorizationPolicy)(nil), // 10: gnsi.pathz.AuthorizationPolicy - (*gnmi.Path)(nil), // 11: gnmi.Path - (Mode)(0), // 12: gnsi.pathz.Mode - (Action)(0), // 13: gnsi.pathz.Action -} -var file_github_com_openconfig_gnsi_pathz_pathz_proto_depIdxs = []int32{ - 4, // 0: gnsi.pathz.v1.RotateRequest.upload_request:type_name -> gnsi.pathz.v1.UploadRequest - 3, // 1: gnsi.pathz.v1.RotateRequest.finalize_rotation:type_name -> gnsi.pathz.v1.FinalizeRequest - 5, // 2: gnsi.pathz.v1.RotateResponse.upload:type_name -> gnsi.pathz.v1.UploadResponse - 10, // 3: gnsi.pathz.v1.UploadRequest.policy:type_name -> gnsi.pathz.AuthorizationPolicy - 11, // 4: gnsi.pathz.v1.ProbeRequest.path:type_name -> gnmi.Path - 12, // 5: gnsi.pathz.v1.ProbeRequest.mode:type_name -> gnsi.pathz.Mode + (Action)(0), // 1: gnsi.pathz.v1.Action + (Mode)(0), // 2: gnsi.pathz.v1.Mode + (*RotateRequest)(nil), // 3: gnsi.pathz.v1.RotateRequest + (*RotateResponse)(nil), // 4: gnsi.pathz.v1.RotateResponse + (*FinalizeRequest)(nil), // 5: gnsi.pathz.v1.FinalizeRequest + (*UploadRequest)(nil), // 6: gnsi.pathz.v1.UploadRequest + (*UploadResponse)(nil), // 7: gnsi.pathz.v1.UploadResponse + (*ProbeRequest)(nil), // 8: gnsi.pathz.v1.ProbeRequest + (*ProbeResponse)(nil), // 9: gnsi.pathz.v1.ProbeResponse + (*GetRequest)(nil), // 10: gnsi.pathz.v1.GetRequest + (*GetResponse)(nil), // 11: gnsi.pathz.v1.GetResponse + (*User)(nil), // 12: gnsi.pathz.v1.User + (*Group)(nil), // 13: gnsi.pathz.v1.Group + (*AuthorizationRule)(nil), // 14: gnsi.pathz.v1.AuthorizationRule + (*AuthorizationPolicy)(nil), // 15: gnsi.pathz.v1.AuthorizationPolicy + (*gnmi.Path)(nil), // 16: gnmi.Path +} +var file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_depIdxs = []int32{ + 6, // 0: gnsi.pathz.v1.RotateRequest.upload_request:type_name -> gnsi.pathz.v1.UploadRequest + 5, // 1: gnsi.pathz.v1.RotateRequest.finalize_rotation:type_name -> gnsi.pathz.v1.FinalizeRequest + 7, // 2: gnsi.pathz.v1.RotateResponse.upload:type_name -> gnsi.pathz.v1.UploadResponse + 15, // 3: gnsi.pathz.v1.UploadRequest.policy:type_name -> gnsi.pathz.v1.AuthorizationPolicy + 16, // 4: gnsi.pathz.v1.ProbeRequest.path:type_name -> gnmi.Path + 2, // 5: gnsi.pathz.v1.ProbeRequest.mode:type_name -> gnsi.pathz.v1.Mode 0, // 6: gnsi.pathz.v1.ProbeRequest.policy_instance:type_name -> gnsi.pathz.v1.PolicyInstance - 13, // 7: gnsi.pathz.v1.ProbeResponse.action:type_name -> gnsi.pathz.Action + 1, // 7: gnsi.pathz.v1.ProbeResponse.action:type_name -> gnsi.pathz.v1.Action 0, // 8: gnsi.pathz.v1.GetRequest.policy_instance:type_name -> gnsi.pathz.v1.PolicyInstance - 10, // 9: gnsi.pathz.v1.GetResponse.policy:type_name -> gnsi.pathz.AuthorizationPolicy - 1, // 10: gnsi.pathz.v1.Pathz.Rotate:input_type -> gnsi.pathz.v1.RotateRequest - 6, // 11: gnsi.pathz.v1.Pathz.Probe:input_type -> gnsi.pathz.v1.ProbeRequest - 8, // 12: gnsi.pathz.v1.Pathz.Get:input_type -> gnsi.pathz.v1.GetRequest - 2, // 13: gnsi.pathz.v1.Pathz.Rotate:output_type -> gnsi.pathz.v1.RotateResponse - 7, // 14: gnsi.pathz.v1.Pathz.Probe:output_type -> gnsi.pathz.v1.ProbeResponse - 9, // 15: gnsi.pathz.v1.Pathz.Get:output_type -> gnsi.pathz.v1.GetResponse - 13, // [13:16] is the sub-list for method output_type - 10, // [10:13] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_github_com_openconfig_gnsi_pathz_pathz_proto_init() } -func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { - if File_github_com_openconfig_gnsi_pathz_pathz_proto != nil { + 15, // 9: gnsi.pathz.v1.GetResponse.policy:type_name -> gnsi.pathz.v1.AuthorizationPolicy + 12, // 10: gnsi.pathz.v1.Group.users:type_name -> gnsi.pathz.v1.User + 16, // 11: gnsi.pathz.v1.AuthorizationRule.path:type_name -> gnmi.Path + 1, // 12: gnsi.pathz.v1.AuthorizationRule.action:type_name -> gnsi.pathz.v1.Action + 2, // 13: gnsi.pathz.v1.AuthorizationRule.mode:type_name -> gnsi.pathz.v1.Mode + 14, // 14: gnsi.pathz.v1.AuthorizationPolicy.rules:type_name -> gnsi.pathz.v1.AuthorizationRule + 13, // 15: gnsi.pathz.v1.AuthorizationPolicy.groups:type_name -> gnsi.pathz.v1.Group + 3, // 16: gnsi.pathz.v1.Pathz.Rotate:input_type -> gnsi.pathz.v1.RotateRequest + 8, // 17: gnsi.pathz.v1.Pathz.Probe:input_type -> gnsi.pathz.v1.ProbeRequest + 10, // 18: gnsi.pathz.v1.Pathz.Get:input_type -> gnsi.pathz.v1.GetRequest + 4, // 19: gnsi.pathz.v1.Pathz.Rotate:output_type -> gnsi.pathz.v1.RotateResponse + 9, // 20: gnsi.pathz.v1.Pathz.Probe:output_type -> gnsi.pathz.v1.ProbeResponse + 11, // 21: gnsi.pathz.v1.Pathz.Get:output_type -> gnsi.pathz.v1.GetResponse + 19, // [19:22] is the sub-list for method output_type + 16, // [16:19] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name +} + +func init() { file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_init() } +func file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_init() { + if File_github_com_openconfig_gnsi_pathz_pathz_pathz_proto != nil { return } - file_github_com_openconfig_gnsi_pathz_authorization_proto_init() if !protoimpl.UnsafeEnabled { - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RotateRequest); i { case 0: return &v.state @@ -775,7 +1188,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RotateResponse); i { case 0: return &v.state @@ -787,7 +1200,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FinalizeRequest); i { case 0: return &v.state @@ -799,7 +1212,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UploadRequest); i { case 0: return &v.state @@ -811,7 +1224,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UploadResponse); i { case 0: return &v.state @@ -823,7 +1236,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProbeRequest); i { case 0: return &v.state @@ -835,7 +1248,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProbeResponse); i { case 0: return &v.state @@ -847,7 +1260,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRequest); i { case 0: return &v.state @@ -859,7 +1272,7 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResponse); i { case 0: return &v.state @@ -871,31 +1284,268 @@ func file_github_com_openconfig_gnsi_pathz_pathz_proto_init() { return nil } } + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Group); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthorizationRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthorizationPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[0].OneofWrappers = []interface{}{ (*RotateRequest_UploadRequest)(nil), (*RotateRequest_FinalizeRotation)(nil), } - file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[1].OneofWrappers = []interface{}{ (*RotateResponse_Upload)(nil), } + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes[11].OneofWrappers = []interface{}{ + (*AuthorizationRule_User)(nil), + (*AuthorizationRule_Group)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, + RawDescriptor: file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDesc, + NumEnums: 3, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_github_com_openconfig_gnsi_pathz_pathz_proto_goTypes, - DependencyIndexes: file_github_com_openconfig_gnsi_pathz_pathz_proto_depIdxs, - EnumInfos: file_github_com_openconfig_gnsi_pathz_pathz_proto_enumTypes, - MessageInfos: file_github_com_openconfig_gnsi_pathz_pathz_proto_msgTypes, + GoTypes: file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_goTypes, + DependencyIndexes: file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_depIdxs, + EnumInfos: file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_enumTypes, + MessageInfos: file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_msgTypes, }.Build() - File_github_com_openconfig_gnsi_pathz_pathz_proto = out.File - file_github_com_openconfig_gnsi_pathz_pathz_proto_rawDesc = nil - file_github_com_openconfig_gnsi_pathz_pathz_proto_goTypes = nil - file_github_com_openconfig_gnsi_pathz_pathz_proto_depIdxs = nil + File_github_com_openconfig_gnsi_pathz_pathz_pathz_proto = out.File + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_rawDesc = nil + file_github_com_openconfig_gnsi_pathz_pathz_pathz_proto_goTypes = nil + file_github_com_openconfig_gnsi_pathz_pathz_pathz_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 + +// PathzClient is the client API for Pathz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type PathzClient interface { + Rotate(ctx context.Context, opts ...grpc.CallOption) (Pathz_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 pathzClient struct { + cc grpc.ClientConnInterface +} + +func NewPathzClient(cc grpc.ClientConnInterface) PathzClient { + return &pathzClient{cc} +} + +func (c *pathzClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (Pathz_RotateClient, error) { + stream, err := c.cc.NewStream(ctx, &_Pathz_serviceDesc.Streams[0], "/gnsi.pathz.v1.Pathz/Rotate", opts...) + if err != nil { + return nil, err + } + x := &pathzRotateClient{stream} + return x, nil +} + +type Pathz_RotateClient interface { + Send(*RotateRequest) error + Recv() (*RotateResponse, error) + grpc.ClientStream +} + +type pathzRotateClient struct { + grpc.ClientStream +} + +func (x *pathzRotateClient) Send(m *RotateRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *pathzRotateClient) Recv() (*RotateResponse, error) { + m := new(RotateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *pathzClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { + out := new(ProbeResponse) + err := c.cc.Invoke(ctx, "/gnsi.pathz.v1.Pathz/Probe", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pathzClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/gnsi.pathz.v1.Pathz/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PathzServer is the server API for Pathz service. +type PathzServer interface { + Rotate(Pathz_RotateServer) error + Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) + Get(context.Context, *GetRequest) (*GetResponse, error) +} + +// UnimplementedPathzServer can be embedded to have forward compatible implementations. +type UnimplementedPathzServer struct { +} + +func (*UnimplementedPathzServer) Rotate(Pathz_RotateServer) error { + return status.Errorf(codes.Unimplemented, "method Rotate not implemented") +} +func (*UnimplementedPathzServer) Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Probe not implemented") +} +func (*UnimplementedPathzServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} + +func RegisterPathzServer(s *grpc.Server, srv PathzServer) { + s.RegisterService(&_Pathz_serviceDesc, srv) +} + +func _Pathz_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PathzServer).Rotate(&pathzRotateServer{stream}) +} + +type Pathz_RotateServer interface { + Send(*RotateResponse) error + Recv() (*RotateRequest, error) + grpc.ServerStream +} + +type pathzRotateServer struct { + grpc.ServerStream +} + +func (x *pathzRotateServer) Send(m *RotateResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *pathzRotateServer) Recv() (*RotateRequest, error) { + m := new(RotateRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Pathz_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.(PathzServer).Probe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.pathz.v1.Pathz/Probe", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PathzServer).Probe(ctx, req.(*ProbeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pathz_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.(PathzServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnsi.pathz.v1.Pathz/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PathzServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Pathz_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gnsi.pathz.v1.Pathz", + HandlerType: (*PathzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Probe", + Handler: _Pathz_Probe_Handler, + }, + { + MethodName: "Get", + Handler: _Pathz_Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Rotate", + Handler: _Pathz_Rotate_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnsi/pathz/pathz/pathz.proto", } diff --git a/pathz/pathz.proto b/pathz/pathz.proto index 8c1c5eb..2ee642b 100644 --- a/pathz/pathz.proto +++ b/pathz/pathz.proto @@ -13,7 +13,27 @@ // See the License for the specific language governing permissions and // limitations under the License. // - +// Define a list of policies, where the most specific policy is applied +// on the device authorizing the action. +// +// Users may be referenced by user name, or as a group with a group name. +// Groups are defined and managed in the authorization policy itself. +// +// Paths may be referenced in whole or in complete parts, ie: +// /interfaces/interface[name=Ethernet1/2/3]/state/counters +// /interfaces/interface[name=*]/state/oper-status +// /network-instances/network-instance/tables/table[proto=BGP][family=*] +// +// Paths are gnmi.Path protobufs. +// +// The most specific match is returned for a request, this means the longest +// path and the most specific user match (user preferred over group). +// +// Additionally, the policy maintains a timestamp of creation +// and version number from the underlying version control system. +// The version/timestamp are available to requestors to verify which version +// of policy is being applied at the time of the request. +// // This file defines the gNSI API to be used for the OpenConfig Path-based // Authorization policy rotation. syntax = "proto3"; @@ -21,7 +41,6 @@ syntax = "proto3"; package gnsi.pathz.v1; import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; -import "github.com/openconfig/gnsi/pathz/authorization.proto"; import "github.com/openconfig/gnsi/version/version.proto"; option go_package = "github.com/openconfig/gnsi/pathz"; @@ -234,3 +253,61 @@ message GetResponse { // The actual OpenConfig gNMI Path-based Authorization Policy. AuthorizationPolicy policy = 3; } + +// User is a singular username used only in the matching criteria. +message User { + string name = 1; +} + +// Group is a group of users, groups are a construct of the policy configuration +// as a method to collect many users with the same authorizations together. +message Group { + string name = 1; + repeated User users = 2; +} + +// Action is the defined action for an AuthorizationPolicy. +enum Action { + ACTION_UNSPECIFIED = 0; + ACTION_DENY = 1; + ACTION_PERMIT = 2; +} + +// Mode is: +// READ: Ability to read/subscribe to data from the model. +// WRITE: Ability to mutate/write updates to data in the model. +enum Mode { + MODE_UNSPECIFIED = 0; + MODE_READ = 1; + MODE_WRITE = 2; +} + +message AuthorizationRule { + // Policy Identifier, a unique string per policy/rule, eg: uuid. + string id = 1; + + oneof principal { + string user = 2; + string group = 3; + } + + // Path is the request path, longest prefix (by path elements from left + // to right). + gnmi.Path path = 4; + + // Permit or deny the user/group access to the path specified. + Action action = 5; + + // Permit Read or Write access to the path specified. + Mode mode = 6; +} + +// AuthorizationPolicy includes rules and user/group information. +// The service which updates the policies will provide both a +// created_on - int64 - seconds since Jan 01 1970 00:00:00 +// version - string - unique among the implementation's policies deployed. +message AuthorizationPolicy { + repeated AuthorizationRule rules = 1; + // Groups of usernames collected for simplicity of policy expression. + repeated Group groups = 2; +} diff --git a/pathz/pathz_grpc.pb.go b/pathz/pathz_grpc.pb.go deleted file mode 100644 index c0facc8..0000000 --- a/pathz/pathz_grpc.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.10 -// source: github.com/openconfig/gnsi/pathz/pathz.proto - -package pathz - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// PathzClient is the client API for Pathz service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type PathzClient interface { - Rotate(ctx context.Context, opts ...grpc.CallOption) (Pathz_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 pathzClient struct { - cc grpc.ClientConnInterface -} - -func NewPathzClient(cc grpc.ClientConnInterface) PathzClient { - return &pathzClient{cc} -} - -func (c *pathzClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (Pathz_RotateClient, error) { - stream, err := c.cc.NewStream(ctx, &Pathz_ServiceDesc.Streams[0], "/gnsi.pathz.v1.Pathz/Rotate", opts...) - if err != nil { - return nil, err - } - x := &pathzRotateClient{stream} - return x, nil -} - -type Pathz_RotateClient interface { - Send(*RotateRequest) error - Recv() (*RotateResponse, error) - grpc.ClientStream -} - -type pathzRotateClient struct { - grpc.ClientStream -} - -func (x *pathzRotateClient) Send(m *RotateRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *pathzRotateClient) Recv() (*RotateResponse, error) { - m := new(RotateResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *pathzClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { - out := new(ProbeResponse) - err := c.cc.Invoke(ctx, "/gnsi.pathz.v1.Pathz/Probe", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pathzClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := c.cc.Invoke(ctx, "/gnsi.pathz.v1.Pathz/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PathzServer is the server API for Pathz service. -// All implementations must embed UnimplementedPathzServer -// for forward compatibility -type PathzServer interface { - Rotate(Pathz_RotateServer) error - Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) - Get(context.Context, *GetRequest) (*GetResponse, error) - mustEmbedUnimplementedPathzServer() -} - -// UnimplementedPathzServer must be embedded to have forward compatible implementations. -type UnimplementedPathzServer struct { -} - -func (UnimplementedPathzServer) Rotate(Pathz_RotateServer) error { - return status.Errorf(codes.Unimplemented, "method Rotate not implemented") -} -func (UnimplementedPathzServer) Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Probe not implemented") -} -func (UnimplementedPathzServer) Get(context.Context, *GetRequest) (*GetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedPathzServer) mustEmbedUnimplementedPathzServer() {} - -// UnsafePathzServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PathzServer will -// result in compilation errors. -type UnsafePathzServer interface { - mustEmbedUnimplementedPathzServer() -} - -func RegisterPathzServer(s grpc.ServiceRegistrar, srv PathzServer) { - s.RegisterService(&Pathz_ServiceDesc, srv) -} - -func _Pathz_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(PathzServer).Rotate(&pathzRotateServer{stream}) -} - -type Pathz_RotateServer interface { - Send(*RotateResponse) error - Recv() (*RotateRequest, error) - grpc.ServerStream -} - -type pathzRotateServer struct { - grpc.ServerStream -} - -func (x *pathzRotateServer) Send(m *RotateResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *pathzRotateServer) Recv() (*RotateRequest, error) { - m := new(RotateRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Pathz_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.(PathzServer).Probe(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.pathz.v1.Pathz/Probe", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PathzServer).Probe(ctx, req.(*ProbeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Pathz_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.(PathzServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnsi.pathz.v1.Pathz/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PathzServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Pathz_ServiceDesc is the grpc.ServiceDesc for Pathz service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Pathz_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gnsi.pathz.v1.Pathz", - HandlerType: (*PathzServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Probe", - Handler: _Pathz_Probe_Handler, - }, - { - MethodName: "Get", - Handler: _Pathz_Get_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Rotate", - Handler: _Pathz_Rotate_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/openconfig/gnsi/pathz/pathz.proto", -} diff --git a/version/BUILD.bazel b/version/BUILD.bazel index 35f8775..5f3fff4 100644 --- a/version/BUILD.bazel +++ b/version/BUILD.bazel @@ -27,6 +27,7 @@ cpp_proto_library( go_proto_library( name = "version_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnsi/version", proto = ":version_proto", deps = [