Debian Codegraph @

apis/v2/api.pb.go

raw
1 /*
2 Copyright The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 // Code generated by protoc-gen-gogo. DO NOT EDIT.
18 // source: api.proto
19
20 package v2
21
22 import (
23 context "context"
24 fmt "fmt"
25 proto "github.com/gogo/protobuf/proto"
26 grpc "google.golang.org/grpc"
27 codes "google.golang.org/grpc/codes"
28 status "google.golang.org/grpc/status"
29 math "math"
30 )
31
32 // Reference imports to suppress errors if they are not otherwise used.
33 var _ = proto.Marshal
34 var _ = fmt.Errorf
35 var _ = math.Inf
36
37 // This is a compile-time assertion to ensure that this generated file
38 // is compatible with the proto package it is being compiled against.
39 // A compilation error at this line likely means your copy of the
40 // proto package needs to be updated.
41 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
42
43 type StatusRequest struct {
44 XXX_NoUnkeyedLiteral struct{} `json:"-"`
45 XXX_unrecognized []byte `json:"-"`
46 XXX_sizecache int32 `json:"-"`
47 }
48
49 func (m *StatusRequest) Reset() { *m = StatusRequest{} }
50 func (m *StatusRequest) String() string { return proto.CompactTextString(m) }
51 func (*StatusRequest) ProtoMessage() {}
52 func (*StatusRequest) Descriptor() ([]byte, []int) {
53 return fileDescriptor_00212fb1f9d3bf1c, []int{0}
54 }
55 func (m *StatusRequest) XXX_Unmarshal(b []byte) error {
56 return xxx_messageInfo_StatusRequest.Unmarshal(m, b)
57 }
58 func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
59 return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic)
60 }
61 func (m *StatusRequest) XXX_Merge(src proto.Message) {
62 xxx_messageInfo_StatusRequest.Merge(m, src)
63 }
64 func (m *StatusRequest) XXX_Size() int {
65 return xxx_messageInfo_StatusRequest.Size(m)
66 }
67 func (m *StatusRequest) XXX_DiscardUnknown() {
68 xxx_messageInfo_StatusRequest.DiscardUnknown(m)
69 }
70
71 var xxx_messageInfo_StatusRequest proto.InternalMessageInfo
72
73 type StatusResponse struct {
74 // Version of the KMS gRPC plugin API. Must equal v2 to v2beta1 (v2 is recommended, but both are equivalent).
75 Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
76 // Any value other than "ok" is failing healthz. On failure, the associated API server healthz endpoint will contain this value as part of the error message.
77 Healthz string `protobuf:"bytes,2,opt,name=healthz,proto3" json:"healthz,omitempty"`
78 // the current write key, used to determine staleness of data updated via value.Transformer.TransformFromStorage.
79 // keyID must satisfy the following constraints:
80 // 1. The keyID is not empty.
81 // 2. The size of keyID is less than 1 kB.
82 KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
83 XXX_NoUnkeyedLiteral struct{} `json:"-"`
84 XXX_unrecognized []byte `json:"-"`
85 XXX_sizecache int32 `json:"-"`
86 }
87
88 func (m *StatusResponse) Reset() { *m = StatusResponse{} }
89 func (m *StatusResponse) String() string { return proto.CompactTextString(m) }
90 func (*StatusResponse) ProtoMessage() {}
91 func (*StatusResponse) Descriptor() ([]byte, []int) {
92 return fileDescriptor_00212fb1f9d3bf1c, []int{1}
93 }
94 func (m *StatusResponse) XXX_Unmarshal(b []byte) error {
95 return xxx_messageInfo_StatusResponse.Unmarshal(m, b)
96 }
97 func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
98 return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic)
99 }
100 func (m *StatusResponse) XXX_Merge(src proto.Message) {
101 xxx_messageInfo_StatusResponse.Merge(m, src)
102 }
103 func (m *StatusResponse) XXX_Size() int {
104 return xxx_messageInfo_StatusResponse.Size(m)
105 }
106 func (m *StatusResponse) XXX_DiscardUnknown() {
107 xxx_messageInfo_StatusResponse.DiscardUnknown(m)
108 }
109
110 var xxx_messageInfo_StatusResponse proto.InternalMessageInfo
111
112 func (m *StatusResponse) GetVersion() string {
113 if m != nil {
114 return m.Version
115 }
116 return ""
117 }
118
119 func (m *StatusResponse) GetHealthz() string {
120 if m != nil {
121 return m.Healthz
122 }
123 return ""
124 }
125
126 func (m *StatusResponse) GetKeyId() string {
127 if m != nil {
128 return m.KeyId
129 }
130 return ""
131 }
132
133 type DecryptRequest struct {
134 // The data to be decrypted.
135 Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
136 // UID is a unique identifier for the request.
137 Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
138 // The keyID that was provided to the apiserver during encryption.
139 // This represents the KMS KEK that was used to encrypt the data.
140 KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
141 // Additional metadata that was sent by the KMS plugin during encryption.
142 Annotations map[string][]byte `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
143 XXX_NoUnkeyedLiteral struct{} `json:"-"`
144 XXX_unrecognized []byte `json:"-"`
145 XXX_sizecache int32 `json:"-"`
146 }
147
148 func (m *DecryptRequest) Reset() { *m = DecryptRequest{} }
149 func (m *DecryptRequest) String() string { return proto.CompactTextString(m) }
150 func (*DecryptRequest) ProtoMessage() {}
151 func (*DecryptRequest) Descriptor() ([]byte, []int) {
152 return fileDescriptor_00212fb1f9d3bf1c, []int{2}
153 }
154 func (m *DecryptRequest) XXX_Unmarshal(b []byte) error {
155 return xxx_messageInfo_DecryptRequest.Unmarshal(m, b)
156 }
157 func (m *DecryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
158 return xxx_messageInfo_DecryptRequest.Marshal(b, m, deterministic)
159 }
160 func (m *DecryptRequest) XXX_Merge(src proto.Message) {
161 xxx_messageInfo_DecryptRequest.Merge(m, src)
162 }
163 func (m *DecryptRequest) XXX_Size() int {
164 return xxx_messageInfo_DecryptRequest.Size(m)
165 }
166 func (m *DecryptRequest) XXX_DiscardUnknown() {
167 xxx_messageInfo_DecryptRequest.DiscardUnknown(m)
168 }
169
170 var xxx_messageInfo_DecryptRequest proto.InternalMessageInfo
171
172 func (m *DecryptRequest) GetCiphertext() []byte {
173 if m != nil {
174 return m.Ciphertext
175 }
176 return nil
177 }
178
179 func (m *DecryptRequest) GetUid() string {
180 if m != nil {
181 return m.Uid
182 }
183 return ""
184 }
185
186 func (m *DecryptRequest) GetKeyId() string {
187 if m != nil {
188 return m.KeyId
189 }
190 return ""
191 }
192
193 func (m *DecryptRequest) GetAnnotations() map[string][]byte {
194 if m != nil {
195 return m.Annotations
196 }
197 return nil
198 }
199
200 type DecryptResponse struct {
201 // The decrypted data.
202 Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
203 XXX_NoUnkeyedLiteral struct{} `json:"-"`
204 XXX_unrecognized []byte `json:"-"`
205 XXX_sizecache int32 `json:"-"`
206 }
207
208 func (m *DecryptResponse) Reset() { *m = DecryptResponse{} }
209 func (m *DecryptResponse) String() string { return proto.CompactTextString(m) }
210 func (*DecryptResponse) ProtoMessage() {}
211 func (*DecryptResponse) Descriptor() ([]byte, []int) {
212 return fileDescriptor_00212fb1f9d3bf1c, []int{3}
213 }
214 func (m *DecryptResponse) XXX_Unmarshal(b []byte) error {
215 return xxx_messageInfo_DecryptResponse.Unmarshal(m, b)
216 }
217 func (m *DecryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
218 return xxx_messageInfo_DecryptResponse.Marshal(b, m, deterministic)
219 }
220 func (m *DecryptResponse) XXX_Merge(src proto.Message) {
221 xxx_messageInfo_DecryptResponse.Merge(m, src)
222 }
223 func (m *DecryptResponse) XXX_Size() int {
224 return xxx_messageInfo_DecryptResponse.Size(m)
225 }
226 func (m *DecryptResponse) XXX_DiscardUnknown() {
227 xxx_messageInfo_DecryptResponse.DiscardUnknown(m)
228 }
229
230 var xxx_messageInfo_DecryptResponse proto.InternalMessageInfo
231
232 func (m *DecryptResponse) GetPlaintext() []byte {
233 if m != nil {
234 return m.Plaintext
235 }
236 return nil
237 }
238
239 type EncryptRequest struct {
240 // The data to be encrypted.
241 Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
242 // UID is a unique identifier for the request.
243 Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
244 XXX_NoUnkeyedLiteral struct{} `json:"-"`
245 XXX_unrecognized []byte `json:"-"`
246 XXX_sizecache int32 `json:"-"`
247 }
248
249 func (m *EncryptRequest) Reset() { *m = EncryptRequest{} }
250 func (m *EncryptRequest) String() string { return proto.CompactTextString(m) }
251 func (*EncryptRequest) ProtoMessage() {}
252 func (*EncryptRequest) Descriptor() ([]byte, []int) {
253 return fileDescriptor_00212fb1f9d3bf1c, []int{4}
254 }
255 func (m *EncryptRequest) XXX_Unmarshal(b []byte) error {
256 return xxx_messageInfo_EncryptRequest.Unmarshal(m, b)
257 }
258 func (m *EncryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
259 return xxx_messageInfo_EncryptRequest.Marshal(b, m, deterministic)
260 }
261 func (m *EncryptRequest) XXX_Merge(src proto.Message) {
262 xxx_messageInfo_EncryptRequest.Merge(m, src)
263 }
264 func (m *EncryptRequest) XXX_Size() int {
265 return xxx_messageInfo_EncryptRequest.Size(m)
266 }
267 func (m *EncryptRequest) XXX_DiscardUnknown() {
268 xxx_messageInfo_EncryptRequest.DiscardUnknown(m)
269 }
270
271 var xxx_messageInfo_EncryptRequest proto.InternalMessageInfo
272
273 func (m *EncryptRequest) GetPlaintext() []byte {
274 if m != nil {
275 return m.Plaintext
276 }
277 return nil
278 }
279
280 func (m *EncryptRequest) GetUid() string {
281 if m != nil {
282 return m.Uid
283 }
284 return ""
285 }
286
287 type EncryptResponse struct {
288 // The encrypted data.
289 // ciphertext must satisfy the following constraints:
290 // 1. The ciphertext is not empty.
291 // 2. The ciphertext is less than 1 kB.
292 Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
293 // The KMS key ID used to encrypt the data. This must always refer to the KMS KEK and not any local KEKs that may be in use.
294 // This can be used to inform staleness of data updated via value.Transformer.TransformFromStorage.
295 // keyID must satisfy the following constraints:
296 // 1. The keyID is not empty.
297 // 2. The size of keyID is less than 1 kB.
298 KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
299 // Additional metadata to be stored with the encrypted data.
300 // This data is stored in plaintext in etcd. KMS plugin implementations are responsible for pre-encrypting any sensitive data.
301 // Annotations must satisfy the following constraints:
302 // 1. Annotation key must be a fully qualified domain name that conforms to the definition in DNS (RFC 1123).
303 // 2. The size of annotations keys + values is less than 32 kB.
304 Annotations map[string][]byte `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
305 XXX_NoUnkeyedLiteral struct{} `json:"-"`
306 XXX_unrecognized []byte `json:"-"`
307 XXX_sizecache int32 `json:"-"`
308 }
309
310 func (m *EncryptResponse) Reset() { *m = EncryptResponse{} }
311 func (m *EncryptResponse) String() string { return proto.CompactTextString(m) }
312 func (*EncryptResponse) ProtoMessage() {}
313 func (*EncryptResponse) Descriptor() ([]byte, []int) {
314 return fileDescriptor_00212fb1f9d3bf1c, []int{5}
315 }
316 func (m *EncryptResponse) XXX_Unmarshal(b []byte) error {
317 return xxx_messageInfo_EncryptResponse.Unmarshal(m, b)
318 }
319 func (m *EncryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
320 return xxx_messageInfo_EncryptResponse.Marshal(b, m, deterministic)
321 }
322 func (m *EncryptResponse) XXX_Merge(src proto.Message) {
323 xxx_messageInfo_EncryptResponse.Merge(m, src)
324 }
325 func (m *EncryptResponse) XXX_Size() int {
326 return xxx_messageInfo_EncryptResponse.Size(m)
327 }
328 func (m *EncryptResponse) XXX_DiscardUnknown() {
329 xxx_messageInfo_EncryptResponse.DiscardUnknown(m)
330 }
331
332 var xxx_messageInfo_EncryptResponse proto.InternalMessageInfo
333
334 func (m *EncryptResponse) GetCiphertext() []byte {
335 if m != nil {
336 return m.Ciphertext
337 }
338 return nil
339 }
340
341 func (m *EncryptResponse) GetKeyId() string {
342 if m != nil {
343 return m.KeyId
344 }
345 return ""
346 }
347
348 func (m *EncryptResponse) GetAnnotations() map[string][]byte {
349 if m != nil {
350 return m.Annotations
351 }
352 return nil
353 }
354
355 func init() {
356 proto.RegisterType((*StatusRequest)(nil), "v2.StatusRequest")
357 proto.RegisterType((*StatusResponse)(nil), "v2.StatusResponse")
358 proto.RegisterType((*DecryptRequest)(nil), "v2.DecryptRequest")
359 proto.RegisterMapType((map[string][]byte)(nil), "v2.DecryptRequest.AnnotationsEntry")
360 proto.RegisterType((*DecryptResponse)(nil), "v2.DecryptResponse")
361 proto.RegisterType((*EncryptRequest)(nil), "v2.EncryptRequest")
362 proto.RegisterType((*EncryptResponse)(nil), "v2.EncryptResponse")
363 proto.RegisterMapType((map[string][]byte)(nil), "v2.EncryptResponse.AnnotationsEntry")
364 }
365
366 func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
367
368 var fileDescriptor_00212fb1f9d3bf1c = []byte{
369 // 403 bytes of a gzipped FileDescriptorProto
370 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xcd, 0x6e, 0xda, 0x40,
371 0x10, 0xc7, 0xb1, 0x5d, 0x40, 0x0c, 0x14, 0xe8, 0x96, 0x4a, 0x16, 0xaa, 0x2a, 0xb4, 0xed, 0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 0x00, 0x00, 0xff, 0xff, 0x5f, 0xf8, 0x49, 0x17, 0x7c,
395 0x03, 0x00, 0x00,
396 }
397
398 // Reference imports to suppress errors if they are not otherwise used.
399 var _ context.Context
400 var _ grpc.ClientConn
401
402 // This is a compile-time assertion to ensure that this generated file
403 // is compatible with the grpc package it is being compiled against.
404 const _ = grpc.SupportPackageIsVersion4
405
406 // KeyManagementServiceClient is the client API for KeyManagementService service.
407 //
408 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
409 type KeyManagementServiceClient interface {
410 // this API is meant to be polled
411 Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
412 // Execute decryption operation in KMS provider.
413 Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error)
414 // Execute encryption operation in KMS provider.
415 Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error)
416 }
417
418 type keyManagementServiceClient struct {
419 cc *grpc.ClientConn
420 }
421
422 func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient {
423 return &keyManagementServiceClient{cc}
424 }
425
426 func (c *keyManagementServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
427 out := new(StatusResponse)
428 err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Status", in, out, opts...)
429 if err != nil {
430 return nil, err
431 }
432 return out, nil
433 }
434
435 func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) {
436 out := new(DecryptResponse)
437 err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Decrypt", in, out, opts...)
438 if err != nil {
439 return nil, err
440 }
441 return out, nil
442 }
443
444 func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) {
445 out := new(EncryptResponse)
446 err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Encrypt", in, out, opts...)
447 if err != nil {
448 return nil, err
449 }
450 return out, nil
451 }
452
453 // KeyManagementServiceServer is the server API for KeyManagementService service.
454 type KeyManagementServiceServer interface {
455 // this API is meant to be polled
456 Status(context.Context, *StatusRequest) (*StatusResponse, error)
457 // Execute decryption operation in KMS provider.
458 Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error)
459 // Execute encryption operation in KMS provider.
460 Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error)
461 }
462
463 // UnimplementedKeyManagementServiceServer can be embedded to have forward compatible implementations.
464 type UnimplementedKeyManagementServiceServer struct {
465 }
466
467 func (*UnimplementedKeyManagementServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) {
468 return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
469 }
470 func (*UnimplementedKeyManagementServiceServer) Decrypt(ctx context.Context, req *DecryptRequest) (*DecryptResponse, error) {
471 return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented")
472 }
473 func (*UnimplementedKeyManagementServiceServer) Encrypt(ctx context.Context, req *EncryptRequest) (*EncryptResponse, error) {
474 return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented")
475 }
476
477 func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) {
478 s.RegisterService(&_KeyManagementService_serviceDesc, srv)
479 }
480
481 func _KeyManagementService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
482 in := new(StatusRequest)
483 if err := dec(in); err != nil {
484 return nil, err
485 }
486 if interceptor == nil {
487 return srv.(KeyManagementServiceServer).Status(ctx, in)
488 }
489 info := &grpc.UnaryServerInfo{
490 Server: srv,
491 FullMethod: "/v2.KeyManagementService/Status",
492 }
493 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
494 return srv.(KeyManagementServiceServer).Status(ctx, req.(*StatusRequest))
495 }
496 return interceptor(ctx, in, info, handler)
497 }
498
499 func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
500 in := new(DecryptRequest)
501 if err := dec(in); err != nil {
502 return nil, err
503 }
504 if interceptor == nil {
505 return srv.(KeyManagementServiceServer).Decrypt(ctx, in)
506 }
507 info := &grpc.UnaryServerInfo{
508 Server: srv,
509 FullMethod: "/v2.KeyManagementService/Decrypt",
510 }
511 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
512 return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest))
513 }
514 return interceptor(ctx, in, info, handler)
515 }
516
517 func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
518 in := new(EncryptRequest)
519 if err := dec(in); err != nil {
520 return nil, err
521 }
522 if interceptor == nil {
523 return srv.(KeyManagementServiceServer).Encrypt(ctx, in)
524 }
525 info := &grpc.UnaryServerInfo{
526 Server: srv,
527 FullMethod: "/v2.KeyManagementService/Encrypt",
528 }
529 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
530 return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest))
531 }
532 return interceptor(ctx, in, info, handler)
533 }
534
535 var _KeyManagementService_serviceDesc = grpc.ServiceDesc{
536 ServiceName: "v2.KeyManagementService",
537 HandlerType: (*KeyManagementServiceServer)(nil),
538 Methods: []grpc.MethodDesc{
539 {
540 MethodName: "Status",
541 Handler: _KeyManagementService_Status_Handler,
542 },
543 {
544 MethodName: "Decrypt",
545 Handler: _KeyManagementService_Decrypt_Handler,
546 },
547 {
548 MethodName: "Encrypt",
549 Handler: _KeyManagementService_Encrypt_Handler,
550 },
551 },
552 Streams: []grpc.StreamDesc{},
553 Metadata: "api.proto",
554 }