diff --git a/core/common/privdata/collection.go b/core/common/privdata/collection.go index 4a21fad0f66..6dca1299bdc 100644 --- a/core/common/privdata/collection.go +++ b/core/common/privdata/collection.go @@ -16,29 +16,29 @@ type Collection interface { // as txid, nonce, creator -- for future use // SetTxContext(parameters ...interface{}) - // GetCollectionID returns this collection's ID - GetCollectionID() string + // CollectionID returns this collection's ID + CollectionID() string // GetEndorsementPolicy returns the endorsement policy for validation -- for // future use // GetEndorsementPolicy() string - // GetMemberOrgs returns the collection's members as MSP IDs. This serves as + // MemberOrgs returns the collection's members as MSP IDs. This serves as // a human-readable way of quickly identifying who is part of a collection. - GetMemberOrgs() []string + MemberOrgs() []string } -// CollectionAccess encapsulates functions for the access policy of a collection +// CollectionAccessPolicy encapsulates functions for the access policy of a collection type CollectionAccessPolicy interface { - // GetAccessFilter returns a member filter function for a collection - GetAccessFilter() Filter + // AccessFilter returns a member filter function for a collection + AccessFilter() Filter // RequiredExternalPeerCount returns the minimum number of external peers - // required to hold private data + // required to send private data to RequiredExternalPeerCount() int // RequiredExternalPeerCount returns the minimum number of internal peers - // required to hold private data + // required to send private data to RequiredInternalPeerCount() int } @@ -59,8 +59,8 @@ type CollectionStore interface { // latest configuration that was committed into the ledger before this txID // was committed. // Else - it's the latest configuration for the collection. - GetCollection(common.CollectionCriteria) Collection + RetrieveCollection(common.CollectionCriteria) Collection // GetCollectionAccessPolicy retrieves a collection's access policy - GetCollectionAccessPolicy(common.CollectionCriteria) CollectionAccessPolicy + RetrieveCollectionAccessPolicy(common.CollectionCriteria) CollectionAccessPolicy } diff --git a/core/common/privdata/nopcollection.go b/core/common/privdata/nopcollection.go index 705fd95ce98..107e1e2737e 100644 --- a/core/common/privdata/nopcollection.go +++ b/core/common/privdata/nopcollection.go @@ -15,15 +15,11 @@ import ( type NopCollection struct { } -func (nc *NopCollection) GetCollectionID() string { +func (nc *NopCollection) CollectionID() string { return "" } -func (nc *NopCollection) GetEndorsementPolicy() string { - return "" -} - -func (nc *NopCollection) GetMemberOrgs() []string { +func (nc *NopCollection) MemberOrgs() []string { return nil } @@ -35,7 +31,7 @@ func (nc *NopCollection) RequiredInternalPeerCount() int { return viper.GetInt("peer.gossip.pvtData.minInternalPeers") } -func (nc *NopCollection) GetAccessFilter() Filter { +func (nc *NopCollection) AccessFilter() Filter { // return true for all return func(common.SignedData) bool { return true @@ -45,10 +41,10 @@ func (nc *NopCollection) GetAccessFilter() Filter { type NopCollectionStore struct { } -func (*NopCollectionStore) GetCollection(common.CollectionCriteria) Collection { +func (*NopCollectionStore) RetrieveCollection(common.CollectionCriteria) Collection { return &NopCollection{} } -func (*NopCollectionStore) GetCollectionAccessPolicy(common.CollectionCriteria) CollectionAccessPolicy { +func (*NopCollectionStore) RetrieveCollectionAccessPolicy(common.CollectionCriteria) CollectionAccessPolicy { return &NopCollection{} } diff --git a/core/common/privdata/simplecollection.go b/core/common/privdata/simplecollection.go new file mode 100644 index 00000000000..c14e23f59c4 --- /dev/null +++ b/core/common/privdata/simplecollection.go @@ -0,0 +1,127 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package privdata + +import ( + "fmt" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric/common/cauthdsl" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/msp" + "github.com/hyperledger/fabric/protos/common" + m "github.com/hyperledger/fabric/protos/msp" + "github.com/pkg/errors" +) + +// SimpleCollection implements a collection with static properties +// and a public member set +type SimpleCollection struct { + name string + accessPolicy policies.Policy + memberOrgs []string + requiredExternalPeerCount int + requiredInternalPeerCount int +} + +// CollectionID returns the collection's ID +func (sc *SimpleCollection) CollectionID() string { + return sc.name +} + +// MemberOrgs returns the MSP IDs that are part of this collection +func (sc *SimpleCollection) MemberOrgs() []string { + return sc.memberOrgs +} + +// RequiredExternalPeerCount returns the minimum number of external peers +// required to send private data to +func (sc *SimpleCollection) RequiredExternalPeerCount() int { + return sc.requiredExternalPeerCount +} + +// RequiredInternalPeerCount returns the minimum number of internal peers +// required to send private data to +func (sc *SimpleCollection) RequiredInternalPeerCount() int { + return sc.requiredInternalPeerCount +} + +// AccessFilter returns the member filter function that evaluates signed data +// against the member access policy of this collection +func (sc *SimpleCollection) AccessFilter() Filter { + return func(sd common.SignedData) bool { + if err := sc.accessPolicy.Evaluate([]*common.SignedData{&sd}); err != nil { + return false + } + return true + } +} + +// Setup configures a simple collection object based on a given +// StaticCollectionConfig proto that has all the necessary information +func (sc *SimpleCollection) Setup(collectionConfig *common.StaticCollectionConfig, deserializer msp.IdentityDeserializer) error { + if collectionConfig == nil { + return errors.New("Nil config passed to collection setup") + } + sc.name = collectionConfig.GetName() + + // get the access signature policy envelope + collectionPolicyConfig := collectionConfig.GetMemberOrgsPolicy() + if collectionPolicyConfig == nil { + return errors.New("Collection config policy is nil") + } + accessPolicyEnvelope := collectionPolicyConfig.GetSignaturePolicy() + if accessPolicyEnvelope == nil { + return errors.New("Collection config access policy is nil") + } + + // create access policy from the envelope + npp := cauthdsl.NewPolicyProvider(deserializer) + polBytes, err := proto.Marshal(accessPolicyEnvelope) + if err != nil { + return err + } + sc.accessPolicy, _, err = npp.NewPolicy(polBytes) + if err != nil { + return err + } + + // get member org MSP IDs from the envelope + for _, principal := range accessPolicyEnvelope.Identities { + switch principal.PrincipalClassification { + case m.MSPPrincipal_ROLE: + // Principal contains the msp role + mspRole := &m.MSPRole{} + err := proto.Unmarshal(principal.Principal, mspRole) + if err != nil { + return errors.Wrap(err, "Could not unmarshal MSPRole from principal") + } + sc.memberOrgs = append(sc.memberOrgs, mspRole.MspIdentifier) + case m.MSPPrincipal_IDENTITY: + principalId, err := deserializer.DeserializeIdentity(principal.Principal) + if err != nil { + return errors.Wrap(err, "Invalid identity principal, not a certificate") + } + sc.memberOrgs = append(sc.memberOrgs, principalId.GetMSPIdentifier()) + case m.MSPPrincipal_ORGANIZATION_UNIT: + OU := &m.OrganizationUnit{} + err := proto.Unmarshal(principal.Principal, OU) + if err != nil { + return errors.Wrap(err, "Could not unmarshal OrganizationUnit from principal") + } + sc.memberOrgs = append(sc.memberOrgs, OU.MspIdentifier) + default: + return errors.New(fmt.Sprintf("Invalid principal type %d", int32(principal.PrincipalClassification))) + } + } + + // set required peer counts + sc.requiredInternalPeerCount = int(collectionConfig.GetRequiredInternalPeerCount()) + sc.requiredExternalPeerCount = int(collectionConfig.GetRequiredExternalPeerCount()) + + return nil +} diff --git a/core/common/privdata/simplecollection_test.go b/core/common/privdata/simplecollection_test.go new file mode 100644 index 00000000000..d8ded769cce --- /dev/null +++ b/core/common/privdata/simplecollection_test.go @@ -0,0 +1,163 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package privdata + +import ( + "bytes" + "errors" + "testing" + "time" + + "github.com/hyperledger/fabric/common/cauthdsl" + "github.com/hyperledger/fabric/msp" + pb "github.com/hyperledger/fabric/protos/common" + mb "github.com/hyperledger/fabric/protos/msp" + "github.com/stretchr/testify/assert" +) + +func createCollectionPolicyConfig(accessPolicy *pb.SignaturePolicyEnvelope) *pb.CollectionPolicyConfig { + cpcSp := &pb.CollectionPolicyConfig_SignaturePolicy{ + SignaturePolicy: accessPolicy, + } + cpc := &pb.CollectionPolicyConfig{ + Payload: cpcSp, + } + return cpc +} + +type mockIdentity struct { + idBytes []byte +} + +func (id *mockIdentity) ExpiresAt() time.Time { + return time.Time{} +} + +func (id *mockIdentity) SatisfiesPrincipal(p *mb.MSPPrincipal) error { + if bytes.Compare(id.idBytes, p.Principal) == 0 { + return nil + } + return errors.New("Principals do not match") +} + +func (id *mockIdentity) GetIdentifier() *msp.IdentityIdentifier { + return &msp.IdentityIdentifier{Mspid: "Mock", Id: string(id.idBytes)} +} + +func (id *mockIdentity) GetMSPIdentifier() string { + return string(id.idBytes) +} + +func (id *mockIdentity) Validate() error { + return nil +} + +func (id *mockIdentity) GetOrganizationalUnits() []*msp.OUIdentifier { + return nil +} + +func (id *mockIdentity) Verify(msg []byte, sig []byte) error { + if bytes.Compare(sig, []byte("badsigned")) == 0 { + return errors.New("Invalid signature") + } + return nil +} + +func (id *mockIdentity) Serialize() ([]byte, error) { + return id.idBytes, nil +} + +type mockDeserializer struct { + fail error +} + +func (md *mockDeserializer) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error) { + if md.fail != nil { + return nil, md.fail + } + return &mockIdentity{idBytes: serializedIdentity}, nil +} + +func TestSetupBadConfig(t *testing.T) { + // set up simple collection with invalid data + var sc SimpleCollection + err := sc.Setup(&pb.StaticCollectionConfig{}, &mockDeserializer{}) + assert.Error(t, err) +} + +func TestSetupGoodConfigCollection(t *testing.T) { + // create member access policy + var signers = [][]byte{[]byte("signer0"), []byte("signer1")} + policyEnvelope := cauthdsl.Envelope(cauthdsl.Or(cauthdsl.SignedBy(0), cauthdsl.SignedBy(1)), signers) + accessPolicy := createCollectionPolicyConfig(policyEnvelope) + + // create static collection config + collectionConfig := &pb.StaticCollectionConfig{ + Name: "test collection", + RequiredInternalPeerCount: 1, + RequiredExternalPeerCount: 1, + MemberOrgsPolicy: accessPolicy, + } + + // set up simple collection with valid data + var sc SimpleCollection + err := sc.Setup(collectionConfig, &mockDeserializer{}) + assert.NoError(t, err) + + // check name + assert.True(t, sc.CollectionID() == "test collection") + + // check members + members := sc.MemberOrgs() + assert.True(t, members[0] == "signer0") + assert.True(t, members[1] == "signer1") + + // check required peer count + assert.True(t, sc.RequiredInternalPeerCount() == 1) + assert.True(t, sc.RequiredExternalPeerCount() == 1) +} + +func TestSimpleCollectionFilter(t *testing.T) { + // create member access policy + var signers = [][]byte{[]byte("signer0"), []byte("signer1")} + policyEnvelope := cauthdsl.Envelope(cauthdsl.Or(cauthdsl.SignedBy(0), cauthdsl.SignedBy(1)), signers) + accessPolicy := createCollectionPolicyConfig(policyEnvelope) + + // create static collection config + collectionConfig := &pb.StaticCollectionConfig{ + Name: "test collection", + RequiredInternalPeerCount: 1, + RequiredExternalPeerCount: 1, + MemberOrgsPolicy: accessPolicy, + } + + // set up simple collection + var sc SimpleCollection + err := sc.Setup(collectionConfig, &mockDeserializer{}) + assert.NoError(t, err) + + // get the collection access filter + var cap CollectionAccessPolicy + cap = &sc + accessFilter := cap.AccessFilter() + + // check filter: not a member of the collection + notMember := pb.SignedData{ + Identity: []byte{1, 2, 3}, + Signature: []byte{}, + Data: []byte{}, + } + assert.False(t, accessFilter(notMember)) + + // check filter: member of the collection + member := pb.SignedData{ + Identity: signers[0], + Signature: []byte{}, + Data: []byte{}, + } + assert.True(t, accessFilter(member)) +} diff --git a/gossip/privdata/coordinator.go b/gossip/privdata/coordinator.go index 596aa2cc8a1..e0744e3d577 100644 --- a/gossip/privdata/coordinator.go +++ b/gossip/privdata/coordinator.go @@ -504,12 +504,12 @@ func (c *coordinator) isEligible(chdr *common.ChannelHeader, namespace string, c Collection: col, TxId: chdr.TxId, } - sp := c.CollectionStore.GetCollectionAccessPolicy(cp) + sp := c.CollectionStore.RetrieveCollectionAccessPolicy(cp) if sp == nil { logger.Warning("Failed obtaining policy for", cp, "skipping collection") return false } - filt := sp.GetAccessFilter() + filt := sp.AccessFilter() if filt == nil { logger.Warning("Failed parsing policy for", cp, "skipping collection") return false @@ -587,12 +587,12 @@ func (c *coordinator) GetPvtDataAndBlockByNum(seqNum uint64, peerAuthInfo common Namespace: ns.Namespace, Collection: col.CollectionName, } - sp := c.CollectionStore.GetCollectionAccessPolicy(cc) + sp := c.CollectionStore.RetrieveCollectionAccessPolicy(cc) if sp == nil { logger.Warning("Failed obtaining policy for", cc) continue } - isAuthorized := sp.GetAccessFilter() + isAuthorized := sp.AccessFilter() if isAuthorized == nil { logger.Warning("Failed obtaining filter for", cc) continue diff --git a/gossip/privdata/coordinator_test.go b/gossip/privdata/coordinator_test.go index 98f65933f58..55e16657dc7 100644 --- a/gossip/privdata/coordinator_test.go +++ b/gossip/privdata/coordinator_test.go @@ -258,7 +258,7 @@ func (cs *collectionStore) thatAccepts(cc common.CollectionCriteria) *collection return cs } -func (cs *collectionStore) GetCollectionAccessPolicy(cc common.CollectionCriteria) privdata.CollectionAccessPolicy { +func (cs *collectionStore) RetrieveCollectionAccessPolicy(cc common.CollectionCriteria) privdata.CollectionAccessPolicy { if sp, exists := cs.store[cc]; exists { return &sp } @@ -268,7 +268,7 @@ func (cs *collectionStore) GetCollectionAccessPolicy(cc common.CollectionCriteri } } -func (cs *collectionStore) GetCollection(cc common.CollectionCriteria) privdata.Collection { +func (cs *collectionStore) RetrieveCollection(cc common.CollectionCriteria) privdata.Collection { panic("implement me") } @@ -285,7 +285,7 @@ func (cap *collectionAccessPolicy) RequiredExternalPeerCount() int { return viper.GetInt("peer.gossip.pvtData.minExternalPeers") } -func (cap *collectionAccessPolicy) GetAccessFilter() privdata.Filter { +func (cap *collectionAccessPolicy) AccessFilter() privdata.Filter { return func(sd common.SignedData) bool { that, _ := asn1.Marshal(sd) this, _ := asn1.Marshal(cap.cs.expectedSignedData) diff --git a/gossip/privdata/distributor.go b/gossip/privdata/distributor.go index e26d15aa00a..48e81b346c2 100644 --- a/gossip/privdata/distributor.go +++ b/gossip/privdata/distributor.go @@ -82,13 +82,13 @@ func (d *distributorImpl) computeDisseminationPlan(txID string, privData *rwset. TxId: txID, Channel: d.chainID, } - colAP := cs.GetCollectionAccessPolicy(cc) + colAP := cs.RetrieveCollectionAccessPolicy(cc) if colAP == nil { logger.Error("Could not find collection access policy for", cc) return nil, errors.Errorf("Collection access policy for %v not found", cc) } - colFilter := colAP.GetAccessFilter() + colFilter := colAP.AccessFilter() if colFilter == nil { logger.Error("Collection access policy for", cc, "has no filter") return nil, errors.Errorf("No collection access policy filter computed for %v", cc) diff --git a/gossip/privdata/pull.go b/gossip/privdata/pull.go index d0a34cfd8a9..d6e0f0bffcf 100644 --- a/gossip/privdata/pull.go +++ b/gossip/privdata/pull.go @@ -130,7 +130,7 @@ func (p *puller) createResponse(message proto.ReceivedMessage) []*proto.PvtDataE }() msg := message.GetGossipMessage() for _, dig := range msg.GetPrivateReq().Digests { - colAP := p.cs.GetCollectionAccessPolicy(fcommon.CollectionCriteria{ + colAP := p.cs.RetrieveCollectionAccessPolicy(fcommon.CollectionCriteria{ Channel: p.channel, Collection: dig.Collection, TxId: dig.TxId, @@ -140,7 +140,7 @@ func (p *puller) createResponse(message proto.ReceivedMessage) []*proto.PvtDataE logger.Debug("No policy found for channel", p.channel, ", collection", dig.Collection, "txID", dig.TxId, "skipping...") continue } - colFilter := colAP.GetAccessFilter() + colFilter := colAP.AccessFilter() if colFilter == nil { logger.Debug("Collection ", dig.Collection, " has no access filter, txID", dig.TxId, "skipping...") continue @@ -358,7 +358,7 @@ func (dig2Filter digestToFilterMapping) String() string { func (p *puller) computeFilters(req *proto.RemotePvtDataRequest) (digestToFilterMapping, error) { filters := make(map[proto.PvtDataDigest]filter.RoutingFilter) for _, digest := range req.Digests { - collection := p.cs.GetCollectionAccessPolicy(fcommon.CollectionCriteria{ + collection := p.cs.RetrieveCollectionAccessPolicy(fcommon.CollectionCriteria{ Channel: p.channel, TxId: digest.TxId, Collection: digest.Collection, @@ -367,7 +367,7 @@ func (p *puller) computeFilters(req *proto.RemotePvtDataRequest) (digestToFilter if collection == nil { return nil, errors.Errorf("Failed obtaining collection policy for channel %s, txID %s, collection %s", p.channel, digest.TxId, digest.Collection) } - f := collection.GetAccessFilter() + f := collection.AccessFilter() if f == nil { return nil, errors.Errorf("Failed obtaining collection filter for channel %s, txID %s, collection %s", p.channel, digest.TxId, digest.Collection) } diff --git a/gossip/privdata/pull_test.go b/gossip/privdata/pull_test.go index 7268a78eac6..06413ab4d7b 100644 --- a/gossip/privdata/pull_test.go +++ b/gossip/privdata/pull_test.go @@ -52,11 +52,11 @@ func (cs *mockCollectionStore) withPolicy(collection string) *mockCollectionAcce return coll } -func (cs mockCollectionStore) GetCollectionAccessPolicy(cc fcommon.CollectionCriteria) privdata.CollectionAccessPolicy { +func (cs mockCollectionStore) RetrieveCollectionAccessPolicy(cc fcommon.CollectionCriteria) privdata.CollectionAccessPolicy { return cs.m[cc.Collection] } -func (cs mockCollectionStore) GetCollection(cc fcommon.CollectionCriteria) privdata.Collection { +func (cs mockCollectionStore) RetrieveCollection(cc fcommon.CollectionCriteria) privdata.Collection { panic("implement me") } @@ -78,7 +78,7 @@ func (mc *mockCollectionAccess) thatMapsTo(peers ...string) *mockCollectionStore return mc.cs } -func (mc *mockCollectionAccess) GetAccessFilter() privdata.Filter { +func (mc *mockCollectionAccess) AccessFilter() privdata.Filter { policyLock.Lock() defer policyLock.Unlock() return policy2Filter[mc] diff --git a/protos/common/collection.pb.go b/protos/common/collection.pb.go index cf9422ceeb3..957268f1d68 100644 --- a/protos/common/collection.pb.go +++ b/protos/common/collection.pb.go @@ -172,6 +172,10 @@ type StaticCollectionConfig struct { // a reference to a policy residing / managed in the config block // to define which orgs have access to this collection’s private data MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy" json:"member_orgs_policy,omitempty"` + // the minimum number of internal/external peers required to be sent + // private data to + RequiredInternalPeerCount int32 `protobuf:"varint,3,opt,name=required_internal_peer_count,json=requiredInternalPeerCount" json:"required_internal_peer_count,omitempty"` + RequiredExternalPeerCount int32 `protobuf:"varint,4,opt,name=required_external_peer_count,json=requiredExternalPeerCount" json:"required_external_peer_count,omitempty"` } func (m *StaticCollectionConfig) Reset() { *m = StaticCollectionConfig{} } @@ -193,6 +197,20 @@ func (m *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { return nil } +func (m *StaticCollectionConfig) GetRequiredInternalPeerCount() int32 { + if m != nil { + return m.RequiredInternalPeerCount + } + return 0 +} + +func (m *StaticCollectionConfig) GetRequiredExternalPeerCount() int32 { + if m != nil { + return m.RequiredExternalPeerCount + } + return 0 +} + // Collection policy configuration. Initially, the configuration can only // contain a SignaturePolicy. In the future, the SignaturePolicy may be a // more general Policy. Instead of containing the actual policy, the @@ -339,27 +357,31 @@ func init() { func init() { proto.RegisterFile("common/collection.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x51, 0x4b, 0xfb, 0x30, - 0x14, 0xc5, 0xb7, 0xff, 0x7f, 0x6e, 0xf4, 0xfa, 0xe0, 0x88, 0x38, 0x8b, 0xc8, 0x94, 0xe1, 0x83, - 0x20, 0xb4, 0xa0, 0xdf, 0x60, 0x43, 0x98, 0x30, 0x50, 0xba, 0xb7, 0xbd, 0x94, 0x34, 0xbd, 0xeb, - 0x02, 0x6d, 0x52, 0x93, 0x4c, 0x56, 0xdf, 0xfc, 0xe6, 0xb2, 0x64, 0x5b, 0x3b, 0xd9, 0x5b, 0xef, - 0xfd, 0x9d, 0x73, 0xd2, 0xd3, 0x06, 0xae, 0x99, 0x2c, 0x0a, 0x29, 0x42, 0x26, 0xf3, 0x1c, 0x99, - 0xe1, 0x52, 0x04, 0xa5, 0x92, 0x46, 0x92, 0xae, 0x03, 0x37, 0x57, 0x3b, 0x41, 0x29, 0x73, 0xce, - 0x38, 0x6a, 0x87, 0x47, 0x15, 0xf4, 0x27, 0x07, 0xcb, 0x44, 0x8a, 0x25, 0xcf, 0xc8, 0x02, 0x7c, - 0x6d, 0xa8, 0xe1, 0x2c, 0xae, 0xd3, 0x62, 0x66, 0x99, 0xdf, 0xbe, 0x6f, 0x3f, 0x9e, 0x3f, 0x0f, - 0x03, 0x97, 0x16, 0xcc, 0xad, 0xee, 0x6f, 0xc2, 0xb4, 0x15, 0x0d, 0xf4, 0x49, 0x32, 0xf6, 0xa0, - 0x57, 0xd2, 0x2a, 0x97, 0x34, 0x1d, 0x7d, 0xc3, 0xe0, 0xb4, 0x9d, 0x10, 0xe8, 0x08, 0x5a, 0xa0, - 0x3d, 0xcc, 0x8b, 0xec, 0x33, 0x99, 0x01, 0x29, 0xb0, 0x48, 0x50, 0xc5, 0x52, 0x65, 0x3a, 0xb6, - 0x35, 0x2a, 0xff, 0xdf, 0xf1, 0xeb, 0xd4, 0x49, 0x1f, 0x96, 0xbb, 0xbc, 0xa8, 0xef, 0x9c, 0xef, - 0x2a, 0xd3, 0x6e, 0x3f, 0xfa, 0x84, 0xc1, 0x69, 0x2d, 0x99, 0x41, 0x5f, 0xf3, 0x4c, 0x50, 0xb3, - 0x56, 0xb8, 0x3f, 0xc5, 0x95, 0xbe, 0x3b, 0x94, 0xde, 0x73, 0x67, 0x7c, 0x15, 0x5f, 0x98, 0xcb, - 0x12, 0xa7, 0xad, 0xe8, 0x42, 0x1f, 0xa3, 0x66, 0xdd, 0x9f, 0x36, 0x90, 0x46, 0x53, 0xc5, 0x0d, - 0x2a, 0x4e, 0x89, 0x0f, 0x3d, 0xb6, 0xa2, 0x42, 0x60, 0xbe, 0xab, 0xbb, 0x1f, 0xc9, 0x25, 0x9c, - 0x99, 0x4d, 0xcc, 0x53, 0x5b, 0xd2, 0x8b, 0x3a, 0x66, 0xf3, 0x96, 0x92, 0x21, 0x40, 0xfd, 0x53, - 0xfc, 0xff, 0x96, 0x34, 0x36, 0xe4, 0x16, 0xbc, 0xed, 0xe7, 0xd2, 0x25, 0x65, 0xe8, 0x77, 0x2c, - 0xae, 0x17, 0xe3, 0x39, 0x3c, 0x48, 0x95, 0x05, 0xab, 0xaa, 0x44, 0x95, 0x63, 0x9a, 0xa1, 0x0a, - 0x96, 0x34, 0x51, 0x9c, 0xb9, 0xdb, 0xa0, 0x77, 0x0d, 0x17, 0x4f, 0x19, 0x37, 0xab, 0x75, 0xb2, - 0x1d, 0xc3, 0x86, 0x38, 0x74, 0xe2, 0xd0, 0x89, 0x43, 0x27, 0x4e, 0xba, 0x76, 0x7c, 0xf9, 0x0d, - 0x00, 0x00, 0xff, 0xff, 0x1d, 0x13, 0xa8, 0x68, 0x83, 0x02, 0x00, 0x00, + // 408 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x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de, 0xf0, 0xf1, 0x7b, 0xa3, 0xc3, 0x6c, 0x3e, 0x5d, 0x95, 0xd5, 0x8e, 0xb9, 0x4a, + 0xe6, 0x2a, 0x99, 0xab, 0x64, 0x9e, 0x9e, 0xc4, 0xf2, 0xe7, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xf5, 0x25, 0xa8, 0x8c, 0x06, 0x03, 0x00, 0x00, } diff --git a/protos/common/collection.proto b/protos/common/collection.proto index 7b6d4ff702f..656b2f077cf 100644 --- a/protos/common/collection.proto +++ b/protos/common/collection.proto @@ -33,6 +33,10 @@ message StaticCollectionConfig { // a reference to a policy residing / managed in the config block // to define which orgs have access to this collection’s private data CollectionPolicyConfig member_orgs_policy = 2; + // the minimum number of internal/external peers required to be sent + // private data to + int32 required_internal_peer_count = 3; + int32 required_external_peer_count = 4; }