From fc8ff61eb9e153d9e3f67549b8454cdea89bab30 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Thu, 22 Feb 2018 19:36:03 -0800 Subject: [PATCH] kms: rename KMSService to KeyManagmentService KMSService is redundent. --- .../value/encrypt/envelope/grpc_service.go | 6 +- .../envelope/grpc_service_unix_test.go | 2 +- .../encrypt/envelope/v1beta1/service.pb.go | 102 +++++++++--------- .../encrypt/envelope/v1beta1/service.proto | 2 +- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go index 4d5bda72dd7..ce910f856b0 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go @@ -46,7 +46,7 @@ const ( // The gRPC implementation for envelope.Service. type gRPCService struct { // gRPC client instance - kmsClient kmsapi.KMSServiceClient + kmsClient kmsapi.KeyManagementServiceClient connection *grpc.ClientConn } @@ -64,7 +64,7 @@ func NewGRPCService(endpoint string) (Service, error) { return nil, fmt.Errorf("connect remote KMS provider %q failed, error: %v", addr, err) } - kmsClient := kmsapi.NewKMSServiceClient(connection) + kmsClient := kmsapi.NewKeyManagementServiceClient(connection) err = checkAPIVersion(kmsClient) if err != nil { @@ -99,7 +99,7 @@ func parseEndpoint(endpoint string) (string, error) { // Check the KMS provider API version. // Only matching kmsapiVersion is supported now. -func checkAPIVersion(kmsClient kmsapi.KMSServiceClient) error { +func checkAPIVersion(kmsClient kmsapi.KeyManagementServiceClient) error { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go index 500078cb252..814da3b4bfd 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go @@ -124,7 +124,7 @@ func startTestKMSProvider() (*grpc.Server, error) { } server := grpc.NewServer() - kmsapi.RegisterKMSServiceServer(server, &base64Server{}) + kmsapi.RegisterKeyManagementServiceServer(server, &base64Server{}) go server.Serve(listener) return server, nil } diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go index 9e61bef00ac..52525fffc68 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go @@ -209,9 +209,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for KMSService service +// Client API for KeyManagementService service -type KMSServiceClient interface { +type KeyManagementServiceClient interface { // Version returns the runtime name and runtime version of the KMS provider. Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) // Execute decryption operation in KMS provider. @@ -220,44 +220,44 @@ type KMSServiceClient interface { Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) } -type kMSServiceClient struct { +type keyManagementServiceClient struct { cc *grpc.ClientConn } -func NewKMSServiceClient(cc *grpc.ClientConn) KMSServiceClient { - return &kMSServiceClient{cc} +func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient { + return &keyManagementServiceClient{cc} } -func (c *kMSServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { +func (c *keyManagementServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) - err := grpc.Invoke(ctx, "/v1beta1.KMSService/Version", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Version", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -func (c *kMSServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { +func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { out := new(DecryptResponse) - err := grpc.Invoke(ctx, "/v1beta1.KMSService/Decrypt", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Decrypt", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -func (c *kMSServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { +func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { out := new(EncryptResponse) - err := grpc.Invoke(ctx, "/v1beta1.KMSService/Encrypt", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Encrypt", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// Server API for KMSService service +// Server API for KeyManagementService service -type KMSServiceServer interface { +type KeyManagementServiceServer interface { // Version returns the runtime name and runtime version of the KMS provider. Version(context.Context, *VersionRequest) (*VersionResponse, error) // Execute decryption operation in KMS provider. @@ -266,79 +266,79 @@ type KMSServiceServer interface { Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) } -func RegisterKMSServiceServer(s *grpc.Server, srv KMSServiceServer) { - s.RegisterService(&_KMSService_serviceDesc, srv) +func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) { + s.RegisterService(&_KeyManagementService_serviceDesc, srv) } -func _KMSService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _KeyManagementService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(VersionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(KMSServiceServer).Version(ctx, in) + return srv.(KeyManagementServiceServer).Version(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta1.KMSService/Version", + FullMethod: "/v1beta1.KeyManagementService/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KMSServiceServer).Version(ctx, req.(*VersionRequest)) + return srv.(KeyManagementServiceServer).Version(ctx, req.(*VersionRequest)) } return interceptor(ctx, in, info, handler) } -func _KMSService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DecryptRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(KMSServiceServer).Decrypt(ctx, in) + return srv.(KeyManagementServiceServer).Decrypt(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta1.KMSService/Decrypt", + FullMethod: "/v1beta1.KeyManagementService/Decrypt", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KMSServiceServer).Decrypt(ctx, req.(*DecryptRequest)) + return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) } return interceptor(ctx, in, info, handler) } -func _KMSService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EncryptRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(KMSServiceServer).Encrypt(ctx, in) + return srv.(KeyManagementServiceServer).Encrypt(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta1.KMSService/Encrypt", + FullMethod: "/v1beta1.KeyManagementService/Encrypt", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KMSServiceServer).Encrypt(ctx, req.(*EncryptRequest)) + return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) } return interceptor(ctx, in, info, handler) } -var _KMSService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1beta1.KMSService", - HandlerType: (*KMSServiceServer)(nil), +var _KeyManagementService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v1beta1.KeyManagementService", + HandlerType: (*KeyManagementServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Version", - Handler: _KMSService_Version_Handler, + Handler: _KeyManagementService_Version_Handler, }, { MethodName: "Decrypt", - Handler: _KMSService_Decrypt_Handler, + Handler: _KeyManagementService_Decrypt_Handler, }, { MethodName: "Encrypt", - Handler: _KMSService_Encrypt_Handler, + Handler: _KeyManagementService_Encrypt_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -348,23 +348,23 @@ var _KMSService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("service.proto", fileDescriptorService) } var fileDescriptorService = []byte{ - // 279 bytes of a gzipped FileDescriptorProto + // 287 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xc4, 0x30, - 0x10, 0xde, 0xae, 0xb8, 0xc5, 0xb1, 0xb6, 0x10, 0x44, 0x8b, 0x27, 0xcd, 0x65, 0xd5, 0x43, 0x61, - 0xf5, 0x2e, 0x22, 0x7a, 0x12, 0x3d, 0x74, 0xc1, 0xab, 0x74, 0xcb, 0x80, 0x01, 0x9b, 0xc6, 0x24, - 0x5b, 0xf1, 0x1d, 0x7d, 0x28, 0xb1, 0x99, 0xd6, 0xb4, 0x22, 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 0x49, + 0xb6, 0x0f, 0x93, 0xa2, 0x54, 0xaf, 0xa8, 0x5b, 0xc5, 0x28, 0xa7, 0x8a, 0xcf, 0x20, 0xe9, 0x39, + 0xc8, 0xfc, 0x14, 0xb6, 0xd5, 0x9b, 0x28, 0x1d, 0x45, 0x94, 0xbb, 0x82, 0x5f, 0x41, 0x7c, 0x2b, + 0x37, 0x14, 0xeb, 0x19, 0xc6, 0x3e, 0xc3, 0x29, 0x24, 0x3d, 0x03, 0x49, 0xfd, 0xb8, 0x0a, 0x7c, + 0x57, 0xe7, 0x9f, 0x01, 0x4c, 0xef, 0x70, 0x75, 0x2f, 0xa4, 0x78, 0xc1, 0x0a, 0xa5, 0x7d, 0x74, + 0x67, 0x62, 0x97, 0x10, 0x52, 0x7a, 0x76, 0x90, 0xd1, 0xb1, 0xb2, 0xe1, 0xa5, 0x0e, 0xd3, 0xdf, + 0x0f, 0x4e, 0x8e, 0x8f, 0xbe, 0xf1, 0x14, 0xd7, 0xc3, 0x0f, 0x97, 0xe8, 0xe1, 0xd7, 0x36, 0xe3, + 0xf0, 0x94, 0xc1, 0xc3, 0x0f, 0xf7, 0xe2, 0xe1, 0xd7, 0xe2, 0xf2, 0xd1, 0x62, 0xd2, 0xfe, 0xb3, + 0x8b, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x8d, 0x09, 0xe1, 0x78, 0x02, 0x00, 0x00, } diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto index 90e62acaefd..dbde9080e70 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto +++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto @@ -4,7 +4,7 @@ syntax = "proto3"; package v1beta1; // This service defines the public APIs for remote KMS provider. -service KMSService { +service KeyManagementService { // Version returns the runtime name and runtime version of the KMS provider. rpc Version(VersionRequest) returns (VersionResponse) {}