1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00
Files
sops/keyservice/keyservice.pb.go
2019-01-25 12:42:41 +00:00

556 lines
18 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: keyservice/keyservice.proto
/*
Package keyservice is a generated protocol buffer package.
It is generated from these files:
keyservice/keyservice.proto
It has these top-level messages:
Key
PgpKey
KmsKey
GcpKmsKey
AzureKeyVaultKey
EncryptRequest
EncryptResponse
DecryptRequest
DecryptResponse
*/
package keyservice
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Key struct {
// Types that are valid to be assigned to KeyType:
// *Key_KmsKey
// *Key_PgpKey
// *Key_GcpKmsKey
// *Key_AzureKeyvaultKey
KeyType isKey_KeyType `protobuf_oneof:"key_type"`
}
func (m *Key) Reset() { *m = Key{} }
func (m *Key) String() string { return proto.CompactTextString(m) }
func (*Key) ProtoMessage() {}
func (*Key) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type isKey_KeyType interface {
isKey_KeyType()
}
type Key_KmsKey struct {
KmsKey *KmsKey `protobuf:"bytes,1,opt,name=kms_key,json=kmsKey,oneof"`
}
type Key_PgpKey struct {
PgpKey *PgpKey `protobuf:"bytes,2,opt,name=pgp_key,json=pgpKey,oneof"`
}
type Key_GcpKmsKey struct {
GcpKmsKey *GcpKmsKey `protobuf:"bytes,3,opt,name=gcp_kms_key,json=gcpKmsKey,oneof"`
}
type Key_AzureKeyvaultKey struct {
AzureKeyvaultKey *AzureKeyVaultKey `protobuf:"bytes,4,opt,name=azure_keyvault_key,json=azureKeyvaultKey,oneof"`
}
func (*Key_KmsKey) isKey_KeyType() {}
func (*Key_PgpKey) isKey_KeyType() {}
func (*Key_GcpKmsKey) isKey_KeyType() {}
func (*Key_AzureKeyvaultKey) isKey_KeyType() {}
func (m *Key) GetKeyType() isKey_KeyType {
if m != nil {
return m.KeyType
}
return nil
}
func (m *Key) GetKmsKey() *KmsKey {
if x, ok := m.GetKeyType().(*Key_KmsKey); ok {
return x.KmsKey
}
return nil
}
func (m *Key) GetPgpKey() *PgpKey {
if x, ok := m.GetKeyType().(*Key_PgpKey); ok {
return x.PgpKey
}
return nil
}
func (m *Key) GetGcpKmsKey() *GcpKmsKey {
if x, ok := m.GetKeyType().(*Key_GcpKmsKey); ok {
return x.GcpKmsKey
}
return nil
}
func (m *Key) GetAzureKeyvaultKey() *AzureKeyVaultKey {
if x, ok := m.GetKeyType().(*Key_AzureKeyvaultKey); ok {
return x.AzureKeyvaultKey
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Key) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Key_OneofMarshaler, _Key_OneofUnmarshaler, _Key_OneofSizer, []interface{}{
(*Key_KmsKey)(nil),
(*Key_PgpKey)(nil),
(*Key_GcpKmsKey)(nil),
(*Key_AzureKeyvaultKey)(nil),
}
}
func _Key_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Key)
// key_type
switch x := m.KeyType.(type) {
case *Key_KmsKey:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.KmsKey); err != nil {
return err
}
case *Key_PgpKey:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.PgpKey); err != nil {
return err
}
case *Key_GcpKmsKey:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.GcpKmsKey); err != nil {
return err
}
case *Key_AzureKeyvaultKey:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.AzureKeyvaultKey); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Key.KeyType has unexpected type %T", x)
}
return nil
}
func _Key_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Key)
switch tag {
case 1: // key_type.kms_key
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(KmsKey)
err := b.DecodeMessage(msg)
m.KeyType = &Key_KmsKey{msg}
return true, err
case 2: // key_type.pgp_key
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PgpKey)
err := b.DecodeMessage(msg)
m.KeyType = &Key_PgpKey{msg}
return true, err
case 3: // key_type.gcp_kms_key
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(GcpKmsKey)
err := b.DecodeMessage(msg)
m.KeyType = &Key_GcpKmsKey{msg}
return true, err
case 4: // key_type.azure_keyvault_key
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(AzureKeyVaultKey)
err := b.DecodeMessage(msg)
m.KeyType = &Key_AzureKeyvaultKey{msg}
return true, err
default:
return false, nil
}
}
func _Key_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Key)
// key_type
switch x := m.KeyType.(type) {
case *Key_KmsKey:
s := proto.Size(x.KmsKey)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Key_PgpKey:
s := proto.Size(x.PgpKey)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Key_GcpKmsKey:
s := proto.Size(x.GcpKmsKey)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Key_AzureKeyvaultKey:
s := proto.Size(x.AzureKeyvaultKey)
n += proto.SizeVarint(4<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type PgpKey struct {
Fingerprint string `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"`
}
func (m *PgpKey) Reset() { *m = PgpKey{} }
func (m *PgpKey) String() string { return proto.CompactTextString(m) }
func (*PgpKey) ProtoMessage() {}
func (*PgpKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *PgpKey) GetFingerprint() string {
if m != nil {
return m.Fingerprint
}
return ""
}
type KmsKey struct {
Arn string `protobuf:"bytes,1,opt,name=arn" json:"arn,omitempty"`
Role string `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"`
Context map[string]string `protobuf:"bytes,3,rep,name=context" json:"context,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
AwsProfile string `protobuf:"bytes,4,opt,name=aws_profile" json:"aws_profile,omitempty"`
}
func (m *KmsKey) Reset() { *m = KmsKey{} }
func (m *KmsKey) String() string { return proto.CompactTextString(m) }
func (*KmsKey) ProtoMessage() {}
func (*KmsKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *KmsKey) GetArn() string {
if m != nil {
return m.Arn
}
return ""
}
func (m *KmsKey) GetRole() string {
if m != nil {
return m.Role
}
return ""
}
func (m *KmsKey) GetContext() map[string]string {
if m != nil {
return m.Context
}
return nil
}
type GcpKmsKey struct {
ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId" json:"resource_id,omitempty"`
}
func (m *GcpKmsKey) Reset() { *m = GcpKmsKey{} }
func (m *GcpKmsKey) String() string { return proto.CompactTextString(m) }
func (*GcpKmsKey) ProtoMessage() {}
func (*GcpKmsKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *GcpKmsKey) GetResourceId() string {
if m != nil {
return m.ResourceId
}
return ""
}
type AzureKeyVaultKey struct {
VaultUrl string `protobuf:"bytes,1,opt,name=vault_url,json=vaultUrl" json:"vault_url,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"`
}
func (m *AzureKeyVaultKey) Reset() { *m = AzureKeyVaultKey{} }
func (m *AzureKeyVaultKey) String() string { return proto.CompactTextString(m) }
func (*AzureKeyVaultKey) ProtoMessage() {}
func (*AzureKeyVaultKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *AzureKeyVaultKey) GetVaultUrl() string {
if m != nil {
return m.VaultUrl
}
return ""
}
func (m *AzureKeyVaultKey) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *AzureKeyVaultKey) GetVersion() string {
if m != nil {
return m.Version
}
return ""
}
type EncryptRequest struct {
Key *Key `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
Plaintext []byte `protobuf:"bytes,2,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
}
func (m *EncryptRequest) Reset() { *m = EncryptRequest{} }
func (m *EncryptRequest) String() string { return proto.CompactTextString(m) }
func (*EncryptRequest) ProtoMessage() {}
func (*EncryptRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *EncryptRequest) GetKey() *Key {
if m != nil {
return m.Key
}
return nil
}
func (m *EncryptRequest) GetPlaintext() []byte {
if m != nil {
return m.Plaintext
}
return nil
}
type EncryptResponse struct {
Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
}
func (m *EncryptResponse) Reset() { *m = EncryptResponse{} }
func (m *EncryptResponse) String() string { return proto.CompactTextString(m) }
func (*EncryptResponse) ProtoMessage() {}
func (*EncryptResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *EncryptResponse) GetCiphertext() []byte {
if m != nil {
return m.Ciphertext
}
return nil
}
type DecryptRequest struct {
Key *Key `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
Ciphertext []byte `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
}
func (m *DecryptRequest) Reset() { *m = DecryptRequest{} }
func (m *DecryptRequest) String() string { return proto.CompactTextString(m) }
func (*DecryptRequest) ProtoMessage() {}
func (*DecryptRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *DecryptRequest) GetKey() *Key {
if m != nil {
return m.Key
}
return nil
}
func (m *DecryptRequest) GetCiphertext() []byte {
if m != nil {
return m.Ciphertext
}
return nil
}
type DecryptResponse struct {
Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
}
func (m *DecryptResponse) Reset() { *m = DecryptResponse{} }
func (m *DecryptResponse) String() string { return proto.CompactTextString(m) }
func (*DecryptResponse) ProtoMessage() {}
func (*DecryptResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func (m *DecryptResponse) GetPlaintext() []byte {
if m != nil {
return m.Plaintext
}
return nil
}
func init() {
proto.RegisterType((*Key)(nil), "Key")
proto.RegisterType((*PgpKey)(nil), "PgpKey")
proto.RegisterType((*KmsKey)(nil), "KmsKey")
proto.RegisterType((*GcpKmsKey)(nil), "GcpKmsKey")
proto.RegisterType((*AzureKeyVaultKey)(nil), "AzureKeyVaultKey")
proto.RegisterType((*EncryptRequest)(nil), "EncryptRequest")
proto.RegisterType((*EncryptResponse)(nil), "EncryptResponse")
proto.RegisterType((*DecryptRequest)(nil), "DecryptRequest")
proto.RegisterType((*DecryptResponse)(nil), "DecryptResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// 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.SupportPackageIsVersion4
// Client API for KeyService service
type KeyServiceClient interface {
Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error)
Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error)
}
type keyServiceClient struct {
cc *grpc.ClientConn
}
func NewKeyServiceClient(cc *grpc.ClientConn) KeyServiceClient {
return &keyServiceClient{cc}
}
func (c *keyServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) {
out := new(EncryptResponse)
err := grpc.Invoke(ctx, "/KeyService/Encrypt", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *keyServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) {
out := new(DecryptResponse)
err := grpc.Invoke(ctx, "/KeyService/Decrypt", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for KeyService service
type KeyServiceServer interface {
Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error)
Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error)
}
func RegisterKeyServiceServer(s *grpc.Server, srv KeyServiceServer) {
s.RegisterService(&_KeyService_serviceDesc, srv)
}
func _KeyService_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.(KeyServiceServer).Encrypt(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/KeyService/Encrypt",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KeyServiceServer).Encrypt(ctx, req.(*EncryptRequest))
}
return interceptor(ctx, in, info, handler)
}
func _KeyService_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.(KeyServiceServer).Decrypt(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/KeyService/Decrypt",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KeyServiceServer).Decrypt(ctx, req.(*DecryptRequest))
}
return interceptor(ctx, in, info, handler)
}
var _KeyService_serviceDesc = grpc.ServiceDesc{
ServiceName: "KeyService",
HandlerType: (*KeyServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Encrypt",
Handler: _KeyService_Encrypt_Handler,
},
{
MethodName: "Decrypt",
Handler: _KeyService_Decrypt_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "keyservice/keyservice.proto",
}
func init() { proto.RegisterFile("keyservice/keyservice.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 485 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xd4, 0x30,
0x10, 0x6d, 0x36, 0xcb, 0x6e, 0x33, 0xa9, 0xba, 0xc1, 0xaa, 0xd0, 0x6a, 0x8b, 0x60, 0xe5, 0x53,
0x85, 0x2a, 0x57, 0x2c, 0x17, 0xd4, 0x5b, 0x81, 0x42, 0x51, 0x2e, 0x28, 0x08, 0x6e, 0x68, 0x15,
0xd2, 0x21, 0x44, 0xc9, 0x26, 0xc6, 0x71, 0x22, 0xcc, 0x4f, 0xe1, 0x27, 0xf1, 0xab, 0x90, 0x1d,
0x27, 0xfb, 0xc1, 0x85, 0xdb, 0xf8, 0xf9, 0xcd, 0x9b, 0x79, 0xcf, 0x32, 0x9c, 0xe7, 0xa8, 0x6a,
0x14, 0x6d, 0x96, 0xe0, 0xd5, 0xb6, 0x64, 0x5c, 0x54, 0xb2, 0xa2, 0x7f, 0x1c, 0x70, 0x43, 0x54,
0x84, 0xc2, 0x34, 0xdf, 0xd4, 0xeb, 0x1c, 0xd5, 0xdc, 0x59, 0x3a, 0x17, 0xfe, 0x6a, 0xca, 0xc2,
0x4d, 0x1d, 0xa2, 0xba, 0x3b, 0x8a, 0x26, 0xb9, 0xa9, 0x34, 0x87, 0xa7, 0xdc, 0x70, 0x46, 0x96,
0xf3, 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