forked from tw-bc-group/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msp_principal.pb.go
230 lines (203 loc) · 10 KB
/
msp_principal.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: msp/msp_principal.proto
package msp
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type MSPPrincipal_Classification int32
const (
MSPPrincipal_ROLE MSPPrincipal_Classification = 0
// one of a member of MSP network, and the one of an
// administrator of an MSP network
MSPPrincipal_ORGANIZATION_UNIT MSPPrincipal_Classification = 1
// groupping of entities, per MSP affiliation
// E.g., this can well be represented by an MSP's
// Organization unit
MSPPrincipal_IDENTITY MSPPrincipal_Classification = 2
)
var MSPPrincipal_Classification_name = map[int32]string{
0: "ROLE",
1: "ORGANIZATION_UNIT",
2: "IDENTITY",
}
var MSPPrincipal_Classification_value = map[string]int32{
"ROLE": 0,
"ORGANIZATION_UNIT": 1,
"IDENTITY": 2,
}
func (x MSPPrincipal_Classification) String() string {
return proto.EnumName(MSPPrincipal_Classification_name, int32(x))
}
func (MSPPrincipal_Classification) EnumDescriptor() ([]byte, []int) {
return fileDescriptor2, []int{0, 0}
}
type MSPRole_MSPRoleType int32
const (
MSPRole_MEMBER MSPRole_MSPRoleType = 0
MSPRole_ADMIN MSPRole_MSPRoleType = 1
)
var MSPRole_MSPRoleType_name = map[int32]string{
0: "MEMBER",
1: "ADMIN",
}
var MSPRole_MSPRoleType_value = map[string]int32{
"MEMBER": 0,
"ADMIN": 1,
}
func (x MSPRole_MSPRoleType) String() string {
return proto.EnumName(MSPRole_MSPRoleType_name, int32(x))
}
func (MSPRole_MSPRoleType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{2, 0} }
// MSPPrincipal aims to represent an MSP-centric set of identities.
// In particular, this structure allows for definition of
// - a group of identities that are member of the same MSP
// - a group of identities that are member of the same organization unit
// in the same MSP
// - a group of identities that are administering a specific MSP
// - a specific identity
// Expressing these groups is done given two fields of the fields below
// - Classification, that defines the type of classification of identities
// in an MSP this principal would be defined on; Classification can take
// three values:
// (i) ByMSPRole: that represents a classification of identities within
// MSP based on one of the two pre-defined MSP rules, "member" and "admin"
// (ii) ByOrganizationUnit: that represents a classification of identities
// within MSP based on the organization unit an identity belongs to
// (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single
// identity/certificate; this would mean that the Principal bytes
// message
type MSPPrincipal struct {
// Classification describes the way that one should process
// Principal. An Classification value of "ByOrganizationUnit" reflects
// that "Principal" contains the name of an organization this MSP
// handles. A Classification value "ByIdentity" means that
// "Principal" contains a specific identity. Default value
// denotes that Principal contains one of the groups by
// default supported by all MSPs ("admin" or "member").
PrincipalClassification MSPPrincipal_Classification `protobuf:"varint,1,opt,name=principal_classification,json=principalClassification,enum=common.MSPPrincipal_Classification" json:"principal_classification,omitempty"`
// Principal completes the policy principal definition. For the default
// principal types, Principal can be either "Admin" or "Member".
// For the ByOrganizationUnit/ByIdentity values of Classification,
// PolicyPrincipal acquires its value from an organization unit or
// identity, respectively.
Principal []byte `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"`
}
func (m *MSPPrincipal) Reset() { *m = MSPPrincipal{} }
func (m *MSPPrincipal) String() string { return proto.CompactTextString(m) }
func (*MSPPrincipal) ProtoMessage() {}
func (*MSPPrincipal) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *MSPPrincipal) GetPrincipalClassification() MSPPrincipal_Classification {
if m != nil {
return m.PrincipalClassification
}
return MSPPrincipal_ROLE
}
func (m *MSPPrincipal) GetPrincipal() []byte {
if m != nil {
return m.Principal
}
return nil
}
// OrganizationUnit governs the organization of the Principal
// field of a policy principal when a specific organization unity members
// are to be defined within a policy principal.
type OrganizationUnit struct {
// MSPIdentifier represents the identifier of the MSP this organization unit
// refers to
MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier" json:"msp_identifier,omitempty"`
// OrganizationUnitIdentifier defines the organizational unit under the
// MSP identified with MSPIdentifier
OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier" json:"organizational_unit_identifier,omitempty"`
// CertifiersIdentifier is the hash of certificates chain of trust
// related to this organizational unit
CertifiersIdentifier []byte `protobuf:"bytes,3,opt,name=certifiers_identifier,json=certifiersIdentifier,proto3" json:"certifiers_identifier,omitempty"`
}
func (m *OrganizationUnit) Reset() { *m = OrganizationUnit{} }
func (m *OrganizationUnit) String() string { return proto.CompactTextString(m) }
func (*OrganizationUnit) ProtoMessage() {}
func (*OrganizationUnit) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *OrganizationUnit) GetMspIdentifier() string {
if m != nil {
return m.MspIdentifier
}
return ""
}
func (m *OrganizationUnit) GetOrganizationalUnitIdentifier() string {
if m != nil {
return m.OrganizationalUnitIdentifier
}
return ""
}
func (m *OrganizationUnit) GetCertifiersIdentifier() []byte {
if m != nil {
return m.CertifiersIdentifier
}
return nil
}
// MSPRole governs the organization of the Principal
// field of an MSPPrincipal when it aims to define one of the
// two dedicated roles within an MSP: Admin and Members.
type MSPRole struct {
// MSPIdentifier represents the identifier of the MSP this principal
// refers to
MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier" json:"msp_identifier,omitempty"`
// MSPRoleType defines which of the available, pre-defined MSP-roles
// an identiy should posess inside the MSP with identifier MSPidentifier
Role MSPRole_MSPRoleType `protobuf:"varint,2,opt,name=role,enum=common.MSPRole_MSPRoleType" json:"role,omitempty"`
}
func (m *MSPRole) Reset() { *m = MSPRole{} }
func (m *MSPRole) String() string { return proto.CompactTextString(m) }
func (*MSPRole) ProtoMessage() {}
func (*MSPRole) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (m *MSPRole) GetMspIdentifier() string {
if m != nil {
return m.MspIdentifier
}
return ""
}
func (m *MSPRole) GetRole() MSPRole_MSPRoleType {
if m != nil {
return m.Role
}
return MSPRole_MEMBER
}
func init() {
proto.RegisterType((*MSPPrincipal)(nil), "common.MSPPrincipal")
proto.RegisterType((*OrganizationUnit)(nil), "common.OrganizationUnit")
proto.RegisterType((*MSPRole)(nil), "common.MSPRole")
proto.RegisterEnum("common.MSPPrincipal_Classification", MSPPrincipal_Classification_name, MSPPrincipal_Classification_value)
proto.RegisterEnum("common.MSPRole_MSPRoleType", MSPRole_MSPRoleType_name, MSPRole_MSPRoleType_value)
}
func init() { proto.RegisterFile("msp/msp_principal.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 386 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x92, 0xdf, 0x8e, 0x93, 0x40,
0x14, 0x87, 0x77, 0xea, 0x5a, 0xb7, 0xc7, 0x4a, 0x70, 0xe2, 0x66, 0x9b, 0xb8, 0x31, 0x1b, 0xac,
0x49, 0xaf, 0x20, 0x69, 0x1f, 0xc0, 0xb4, 0x96, 0x18, 0x12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