github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/common/policies.pb.go (about)

     1  // Code generated by protoc-gen-go.
     2  // source: common/policies.proto
     3  // DO NOT EDIT!
     4  
     5  package common
     6  
     7  import proto "github.com/golang/protobuf/proto"
     8  import fmt "fmt"
     9  import math "math"
    10  
    11  // Reference imports to suppress errors if they are not otherwise used.
    12  var _ = proto.Marshal
    13  var _ = fmt.Errorf
    14  var _ = math.Inf
    15  
    16  type Policy_PolicyType int32
    17  
    18  const (
    19  	Policy_UNKNOWN       Policy_PolicyType = 0
    20  	Policy_SIGNATURE     Policy_PolicyType = 1
    21  	Policy_MSP           Policy_PolicyType = 2
    22  	Policy_IMPLICIT_META Policy_PolicyType = 3
    23  )
    24  
    25  var Policy_PolicyType_name = map[int32]string{
    26  	0: "UNKNOWN",
    27  	1: "SIGNATURE",
    28  	2: "MSP",
    29  	3: "IMPLICIT_META",
    30  }
    31  var Policy_PolicyType_value = map[string]int32{
    32  	"UNKNOWN":       0,
    33  	"SIGNATURE":     1,
    34  	"MSP":           2,
    35  	"IMPLICIT_META": 3,
    36  }
    37  
    38  func (x Policy_PolicyType) String() string {
    39  	return proto.EnumName(Policy_PolicyType_name, int32(x))
    40  }
    41  func (Policy_PolicyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 0} }
    42  
    43  type ImplicitMetaPolicy_Rule int32
    44  
    45  const (
    46  	ImplicitMetaPolicy_ANY      ImplicitMetaPolicy_Rule = 0
    47  	ImplicitMetaPolicy_ALL      ImplicitMetaPolicy_Rule = 1
    48  	ImplicitMetaPolicy_MAJORITY ImplicitMetaPolicy_Rule = 2
    49  )
    50  
    51  var ImplicitMetaPolicy_Rule_name = map[int32]string{
    52  	0: "ANY",
    53  	1: "ALL",
    54  	2: "MAJORITY",
    55  }
    56  var ImplicitMetaPolicy_Rule_value = map[string]int32{
    57  	"ANY":      0,
    58  	"ALL":      1,
    59  	"MAJORITY": 2,
    60  }
    61  
    62  func (x ImplicitMetaPolicy_Rule) String() string {
    63  	return proto.EnumName(ImplicitMetaPolicy_Rule_name, int32(x))
    64  }
    65  func (ImplicitMetaPolicy_Rule) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{3, 0} }
    66  
    67  // Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support
    68  // multiple policy engines, this is typed as a oneof for now
    69  type Policy struct {
    70  	Type   int32  `protobuf:"varint,1,opt,name=type" json:"type,omitempty"`
    71  	Policy []byte `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
    72  }
    73  
    74  func (m *Policy) Reset()                    { *m = Policy{} }
    75  func (m *Policy) String() string            { return proto.CompactTextString(m) }
    76  func (*Policy) ProtoMessage()               {}
    77  func (*Policy) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
    78  
    79  // SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements
    80  type SignaturePolicyEnvelope struct {
    81  	Version    int32            `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
    82  	Policy     *SignaturePolicy `protobuf:"bytes,2,opt,name=policy" json:"policy,omitempty"`
    83  	Identities []*MSPPrincipal  `protobuf:"bytes,3,rep,name=identities" json:"identities,omitempty"`
    84  }
    85  
    86  func (m *SignaturePolicyEnvelope) Reset()                    { *m = SignaturePolicyEnvelope{} }
    87  func (m *SignaturePolicyEnvelope) String() string            { return proto.CompactTextString(m) }
    88  func (*SignaturePolicyEnvelope) ProtoMessage()               {}
    89  func (*SignaturePolicyEnvelope) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
    90  
    91  func (m *SignaturePolicyEnvelope) GetPolicy() *SignaturePolicy {
    92  	if m != nil {
    93  		return m.Policy
    94  	}
    95  	return nil
    96  }
    97  
    98  func (m *SignaturePolicyEnvelope) GetIdentities() []*MSPPrincipal {
    99  	if m != nil {
   100  		return m.Identities
   101  	}
   102  	return nil
   103  }
   104  
   105  // SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing
   106  // policies which are more complicated than 'exactly this signature'.  The NOutOf operator is sufficent
   107  // to express AND as well as OR, as well as of course N out of the following M policies
   108  // SignedBy implies that the signature is from a valid certificate which is signed by the trusted
   109  // authority specified in the bytes.  This will be the certificate itself for a self-signed certificate
   110  // and will be the CA for more traditional certificates
   111  type SignaturePolicy struct {
   112  	// Types that are valid to be assigned to Type:
   113  	//	*SignaturePolicy_SignedBy
   114  	//	*SignaturePolicy_NOutOf_
   115  	Type isSignaturePolicy_Type `protobuf_oneof:"Type"`
   116  }
   117  
   118  func (m *SignaturePolicy) Reset()                    { *m = SignaturePolicy{} }
   119  func (m *SignaturePolicy) String() string            { return proto.CompactTextString(m) }
   120  func (*SignaturePolicy) ProtoMessage()               {}
   121  func (*SignaturePolicy) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
   122  
   123  type isSignaturePolicy_Type interface {
   124  	isSignaturePolicy_Type()
   125  }
   126  
   127  type SignaturePolicy_SignedBy struct {
   128  	SignedBy int32 `protobuf:"varint,1,opt,name=signed_by,json=signedBy,oneof"`
   129  }
   130  type SignaturePolicy_NOutOf_ struct {
   131  	NOutOf *SignaturePolicy_NOutOf `protobuf:"bytes,2,opt,name=n_out_of,json=nOutOf,oneof"`
   132  }
   133  
   134  func (*SignaturePolicy_SignedBy) isSignaturePolicy_Type() {}
   135  func (*SignaturePolicy_NOutOf_) isSignaturePolicy_Type()  {}
   136  
   137  func (m *SignaturePolicy) GetType() isSignaturePolicy_Type {
   138  	if m != nil {
   139  		return m.Type
   140  	}
   141  	return nil
   142  }
   143  
   144  func (m *SignaturePolicy) GetSignedBy() int32 {
   145  	if x, ok := m.GetType().(*SignaturePolicy_SignedBy); ok {
   146  		return x.SignedBy
   147  	}
   148  	return 0
   149  }
   150  
   151  func (m *SignaturePolicy) GetNOutOf() *SignaturePolicy_NOutOf {
   152  	if x, ok := m.GetType().(*SignaturePolicy_NOutOf_); ok {
   153  		return x.NOutOf
   154  	}
   155  	return nil
   156  }
   157  
   158  // XXX_OneofFuncs is for the internal use of the proto package.
   159  func (*SignaturePolicy) 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{}) {
   160  	return _SignaturePolicy_OneofMarshaler, _SignaturePolicy_OneofUnmarshaler, _SignaturePolicy_OneofSizer, []interface{}{
   161  		(*SignaturePolicy_SignedBy)(nil),
   162  		(*SignaturePolicy_NOutOf_)(nil),
   163  	}
   164  }
   165  
   166  func _SignaturePolicy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
   167  	m := msg.(*SignaturePolicy)
   168  	// Type
   169  	switch x := m.Type.(type) {
   170  	case *SignaturePolicy_SignedBy:
   171  		b.EncodeVarint(1<<3 | proto.WireVarint)
   172  		b.EncodeVarint(uint64(x.SignedBy))
   173  	case *SignaturePolicy_NOutOf_:
   174  		b.EncodeVarint(2<<3 | proto.WireBytes)
   175  		if err := b.EncodeMessage(x.NOutOf); err != nil {
   176  			return err
   177  		}
   178  	case nil:
   179  	default:
   180  		return fmt.Errorf("SignaturePolicy.Type has unexpected type %T", x)
   181  	}
   182  	return nil
   183  }
   184  
   185  func _SignaturePolicy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
   186  	m := msg.(*SignaturePolicy)
   187  	switch tag {
   188  	case 1: // Type.signed_by
   189  		if wire != proto.WireVarint {
   190  			return true, proto.ErrInternalBadWireType
   191  		}
   192  		x, err := b.DecodeVarint()
   193  		m.Type = &SignaturePolicy_SignedBy{int32(x)}
   194  		return true, err
   195  	case 2: // Type.n_out_of
   196  		if wire != proto.WireBytes {
   197  			return true, proto.ErrInternalBadWireType
   198  		}
   199  		msg := new(SignaturePolicy_NOutOf)
   200  		err := b.DecodeMessage(msg)
   201  		m.Type = &SignaturePolicy_NOutOf_{msg}
   202  		return true, err
   203  	default:
   204  		return false, nil
   205  	}
   206  }
   207  
   208  func _SignaturePolicy_OneofSizer(msg proto.Message) (n int) {
   209  	m := msg.(*SignaturePolicy)
   210  	// Type
   211  	switch x := m.Type.(type) {
   212  	case *SignaturePolicy_SignedBy:
   213  		n += proto.SizeVarint(1<<3 | proto.WireVarint)
   214  		n += proto.SizeVarint(uint64(x.SignedBy))
   215  	case *SignaturePolicy_NOutOf_:
   216  		s := proto.Size(x.NOutOf)
   217  		n += proto.SizeVarint(2<<3 | proto.WireBytes)
   218  		n += proto.SizeVarint(uint64(s))
   219  		n += s
   220  	case nil:
   221  	default:
   222  		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
   223  	}
   224  	return n
   225  }
   226  
   227  type SignaturePolicy_NOutOf struct {
   228  	N        int32              `protobuf:"varint,1,opt,name=N" json:"N,omitempty"`
   229  	Policies []*SignaturePolicy `protobuf:"bytes,2,rep,name=policies" json:"policies,omitempty"`
   230  }
   231  
   232  func (m *SignaturePolicy_NOutOf) Reset()                    { *m = SignaturePolicy_NOutOf{} }
   233  func (m *SignaturePolicy_NOutOf) String() string            { return proto.CompactTextString(m) }
   234  func (*SignaturePolicy_NOutOf) ProtoMessage()               {}
   235  func (*SignaturePolicy_NOutOf) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2, 0} }
   236  
   237  func (m *SignaturePolicy_NOutOf) GetPolicies() []*SignaturePolicy {
   238  	if m != nil {
   239  		return m.Policies
   240  	}
   241  	return nil
   242  }
   243  
   244  // ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration
   245  // It is implicit because the rule is generate implicitly based on the number of sub policies
   246  // It is meta because it depends only on the result of other policies
   247  // When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy
   248  // of name sub_policy, evaluates the collection and applies the rule.
   249  // For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves
   250  // each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY
   251  // 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures.
   252  type ImplicitMetaPolicy struct {
   253  	SubPolicy string                  `protobuf:"bytes,1,opt,name=sub_policy,json=subPolicy" json:"sub_policy,omitempty"`
   254  	Rule      ImplicitMetaPolicy_Rule `protobuf:"varint,2,opt,name=rule,enum=common.ImplicitMetaPolicy_Rule" json:"rule,omitempty"`
   255  }
   256  
   257  func (m *ImplicitMetaPolicy) Reset()                    { *m = ImplicitMetaPolicy{} }
   258  func (m *ImplicitMetaPolicy) String() string            { return proto.CompactTextString(m) }
   259  func (*ImplicitMetaPolicy) ProtoMessage()               {}
   260  func (*ImplicitMetaPolicy) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} }
   261  
   262  func init() {
   263  	proto.RegisterType((*Policy)(nil), "common.Policy")
   264  	proto.RegisterType((*SignaturePolicyEnvelope)(nil), "common.SignaturePolicyEnvelope")
   265  	proto.RegisterType((*SignaturePolicy)(nil), "common.SignaturePolicy")
   266  	proto.RegisterType((*SignaturePolicy_NOutOf)(nil), "common.SignaturePolicy.NOutOf")
   267  	proto.RegisterType((*ImplicitMetaPolicy)(nil), "common.ImplicitMetaPolicy")
   268  	proto.RegisterEnum("common.Policy_PolicyType", Policy_PolicyType_name, Policy_PolicyType_value)
   269  	proto.RegisterEnum("common.ImplicitMetaPolicy_Rule", ImplicitMetaPolicy_Rule_name, ImplicitMetaPolicy_Rule_value)
   270  }
   271  
   272  func init() { proto.RegisterFile("common/policies.proto", fileDescriptor5) }
   273  
   274  var fileDescriptor5 = []byte{
   275  	// 466 bytes of a gzipped FileDescriptorProto
   276  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x52, 0x51, 0x8f, 0xd2, 0x40,
   277  	0x10, 0x66, 0x01, 0x0b, 0x0c, 0x9c, 0xd6, 0x8d, 0x7a, 0x84, 0x44, 0x25, 0x7d, 0x30, 0x24, 0xc6,
   278  	0x36, 0x01, 0x9f, 0x7c, 0x03, 0x25, 0x5e, 0x3d, 0x5a, 0x9a, 0xa5, 0x17, 0x73, 0xbe, 0x34, 0x14,
   279  	0x16, 0x6e, 0x93, 0xd2, 0x6e, 0xda, 0xed, 0x25, 0xf5, 0x57, 0xf8, 0xec, 0xbf, 0xf1, 0x9f, 0x99,
   280  	0xee, 0xb6, 0x17, 0xbd, 0xcb, 0xbd, 0xcd, 0xcc, 0x7e, 0xf3, 0xcd, 0xf7, 0xcd, 0x2c, 0xbc, 0xdc,
   281  	0x25, 0xa7, 0x53, 0x12, 0x5b, 0x3c, 0x89, 0xd8, 0x8e, 0xd1, 0xcc, 0xe4, 0x69, 0x22, 0x12, 0xac,
   282  	0xa9, 0xf2, 0x68, 0x54, 0x3d, 0x9f, 0x32, 0x1e, 0xf0, 0x94, 0xc5, 0x3b, 0xc6, 0xb7, 0x91, 0xc2,
   283  	0x18, 0x3f, 0x41, 0xf3, 0xca, 0xae, 0x02, 0x63, 0x68, 0x8b, 0x82, 0xd3, 0x21, 0x1a, 0xa3, 0xc9,
   284  	0x13, 0x22, 0x63, 0xfc, 0x0a, 0x34, 0xc9, 0x59, 0x0c, 0x9b, 0x63, 0x34, 0x19, 0x90, 0x2a, 0x33,
   285  	0xbe, 0x00, 0xa8, 0x2e, 0xbf, 0x44, 0xf5, 0xa1, 0x73, 0xe5, 0x5e, 0xba, 0xeb, 0xef, 0xae, 0xde,
   286  	0xc0, 0x67, 0xd0, 0xdb, 0xd8, 0x5f, 0xdd, 0xb9, 0x7f, 0x45, 0x96, 0x3a, 0xc2, 0x1d, 0x68, 0x39,
   287  	0x1b, 0x4f, 0x6f, 0xe2, 0xe7, 0x70, 0x66, 0x3b, 0xde, 0xca, 0xfe, 0x6c, 0xfb, 0x81, 0xb3, 0xf4,
   288  	0xe7, 0x7a, 0xcb, 0xf8, 0x8d, 0xe0, 0x7c, 0xc3, 0x8e, 0xf1, 0x56, 0xe4, 0x29, 0x55, 0x7c, 0xcb,
   289  	0xf8, 0x96, 0x46, 0x09, 0xa7, 0x78, 0x08, 0x9d, 0x5b, 0x9a, 0x66, 0x2c, 0x89, 0x2b, 0x41, 0x75,
   290  	0x8a, 0xad, 0xff, 0x34, 0xf5, 0xa7, 0xe7, 0xa6, 0xb2, 0x67, 0xde, 0xa3, 0xaa, 0xc5, 0xe2, 0x8f,
   291  	0x00, 0x6c, 0x4f, 0x63, 0xc1, 0x04, 0xa3, 0xd9, 0xb0, 0x35, 0x6e, 0x4d, 0xfa, 0xd3, 0x17, 0x75,
   292  	0x93, 0xb3, 0xf1, 0xbc, 0x7a, 0x25, 0xe4, 0x1f, 0x9c, 0xf1, 0x07, 0xc1, 0xb3, 0x7b, 0x8c, 0xf8,
   293  	0x35, 0xf4, 0x32, 0x76, 0x8c, 0xe9, 0x3e, 0x08, 0x0b, 0x25, 0xeb, 0xa2, 0x41, 0xba, 0xaa, 0xb4,
   294  	0x28, 0xf0, 0x27, 0xe8, 0xc6, 0x41, 0x92, 0x8b, 0x20, 0x39, 0x54, 0xda, 0xde, 0x3c, 0xa2, 0xcd,
   295  	0x74, 0xd7, 0xb9, 0x58, 0x1f, 0x2e, 0x1a, 0x44, 0x8b, 0x65, 0x34, 0xba, 0x04, 0x4d, 0xd5, 0xf0,
   296  	0x00, 0x90, 0x5b, 0x79, 0x46, 0x2e, 0x9e, 0x41, 0xb7, 0xbe, 0xea, 0xb0, 0x29, 0xa5, 0x3f, 0xea,
   297  	0xf7, 0x0e, 0xb8, 0xd0, 0xa0, 0x5d, 0x1e, 0xc6, 0xf8, 0x85, 0x00, 0xdb, 0x27, 0x5e, 0x56, 0x85,
   298  	0x43, 0xc5, 0xf6, 0xce, 0x06, 0x64, 0x79, 0x18, 0x54, 0x5b, 0x2c, 0x47, 0xf5, 0x48, 0x2f, 0xcb,
   299  	0xc3, 0xea, 0x79, 0x06, 0xed, 0x34, 0x8f, 0xa8, 0xb4, 0xf0, 0x74, 0xfa, 0xb6, 0x1e, 0xf7, 0x90,
   300  	0xc8, 0x24, 0x79, 0x44, 0x89, 0x04, 0x1b, 0xef, 0xa0, 0x5d, 0x66, 0xe5, 0xbd, 0xe7, 0xee, 0xb5,
   301  	0xde, 0x90, 0xc1, 0x6a, 0xa5, 0x23, 0x3c, 0x80, 0xae, 0x33, 0xff, 0xb6, 0x26, 0xb6, 0x7f, 0xad,
   302  	0x37, 0x17, 0x1f, 0x7e, 0xbc, 0x3f, 0x32, 0x71, 0x93, 0x87, 0x25, 0xad, 0x75, 0x53, 0x70, 0x9a,
   303  	0x46, 0x74, 0x7f, 0xa4, 0xa9, 0x75, 0xd8, 0x86, 0x29, 0xdb, 0x59, 0xf2, 0x5b, 0x66, 0x96, 0x1a,
   304  	0x1a, 0x6a, 0x32, 0x9d, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x29, 0x52, 0xc3, 0xda, 0xe2, 0x02,
   305  	0x00, 0x00,
   306  }