Skip to content

Commit 1ffb87e

Browse files
author
Jason Yellick
committed
[FAB-2255] Create ImplicitMetaPolicy policy type
https://jira.hyperledger.org/browse/FAB-2255 This CR introduces the proto structure for the implicit meta policy type. It does not add a provider for this policy type, but simply defines the structure. Change-Id: I4256f3faf9cede3f34ddecc266c98dcbcd1148e6 Signed-off-by: Jason Yellick <[email protected]>
1 parent 22d2d5c commit 1ffb87e

File tree

3 files changed

+103
-30
lines changed

3 files changed

+103
-30
lines changed

protos/common/common.pb.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/policies.pb.go

+83-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/policies.proto

+19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ message Policy {
2929
UNKNOWN = 0; // Reserved to check for proper initialization
3030
SIGNATURE = 1;
3131
MSP = 2;
32+
IMPLICIT_META = 3;
3233
}
3334
int32 type = 1; // For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
3435
bytes policy = 2;
@@ -57,3 +58,21 @@ message SignaturePolicy {
5758
NOutOf from = 2;
5859
}
5960
}
61+
62+
// ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration
63+
// It is implicit because the rule is generate implicitly based on the number of sub policies
64+
// It is meta because it depends only on the result of other policies
65+
// When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy
66+
// of name sub_policy, evaluates the collection and applies the rule.
67+
// For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves
68+
// each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY
69+
// 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures.
70+
message ImplicitMetaPolicy {
71+
enum Rule {
72+
ANY = 0; // Requires any of the sub-policies be satisfied, if no sub-policies exist, always returns true
73+
ALL = 1; // Requires all of the sub-policies be satisfied
74+
MAJORITY = 2; // Requires a strict majority (greater than half) of the sub-policies be satisfied
75+
}
76+
string sub_policy = 1;
77+
Rule rule = 2;
78+
}

0 commit comments

Comments
 (0)