fabric: github.com/hyperledger/fabric/common/policies/inquire Index | Files

package inquire

import "github.com/hyperledger/fabric/common/policies/inquire"

Index

Package Files

compare.go inquire.go merge.go

func CartesianProduct Uses

func CartesianProduct(s1, s2 ComparablePrincipalSets) comparablePrincipalSetPairs

CartesianProduct returns a comparablePrincipalSetPairs that is comprised of the combination of every possible pair of ComparablePrincipalSet such that the first element is in s1, and the second element is in s2.

func NewInquireableSignaturePolicy Uses

func NewInquireableSignaturePolicy(sigPol *common.SignaturePolicyEnvelope) policies.InquireablePolicy

NewInquireableSignaturePolicy creates a signature policy that can be inquired, from a policy and a signature policy.

type ComparablePrincipal Uses

type ComparablePrincipal struct {
    // contains filtered or unexported fields
}

ComparablePrincipal defines an MSPPrincipal that can be compared to other principals

func NewComparablePrincipal Uses

func NewComparablePrincipal(principal *msp.MSPPrincipal) *ComparablePrincipal

NewComparablePrincipal creates a ComparablePrincipal out of the given MSPPrincipal. Returns nil if a failure occurs.

func (*ComparablePrincipal) IsA Uses

func (cp *ComparablePrincipal) IsA(other *ComparablePrincipal) bool

IsA determines whether all identities that satisfy this ComparablePrincipal also satisfy the other ComparablePrincipal. Example: if this ComparablePrincipal is a Peer role, and the other ComparablePrincipal is a Member role, then all identities that satisfy this ComparablePrincipal (are peers) also satisfy the other principal (are members).

func (*ComparablePrincipal) IsFound Uses

func (cp *ComparablePrincipal) IsFound(set ...*ComparablePrincipal) bool

IsFound returns whether the ComparablePrincipal is found among the given set of ComparablePrincipals For the ComparablePrincipal x to be found, there needs to be some ComparablePrincipal y in the set such that x.IsA(y) will be true.

func (*ComparablePrincipal) ToOURole Uses

func (cp *ComparablePrincipal) ToOURole() *ComparablePrincipal

ToOURole converts this ComparablePrincipal to OU principal, and returns nil on failure

func (*ComparablePrincipal) ToRole Uses

func (cp *ComparablePrincipal) ToRole() *ComparablePrincipal

ToRole converts this ComparablePrincipal to MSP Role, and returns nil if the conversion failed

type ComparablePrincipalSet Uses

type ComparablePrincipalSet []*ComparablePrincipal

ComparablePrincipalSet aggregates ComparablePrincipals

func NewComparablePrincipalSet Uses

func NewComparablePrincipalSet(set policies.PrincipalSet) ComparablePrincipalSet

NewComparablePrincipalSet constructs a ComparablePrincipalSet out of the given PrincipalSet

func (ComparablePrincipalSet) Clone Uses

func (cps ComparablePrincipalSet) Clone() ComparablePrincipalSet

Clone returns a copy of this ComparablePrincipalSet

func (ComparablePrincipalSet) Contains Uses

func (cps ComparablePrincipalSet) Contains(s *ComparablePrincipal) bool

Contains returns whether this ComparablePrincipalSet contains the given ComparablePrincipal. A ComparablePrincipalSet X contains a ComparablePrincipal y if there is a ComparablePrincipal x in X such that x.IsA(y). From here it follows that every signature set that satisfies X, also satisfies y.

func (ComparablePrincipalSet) IsContainedIn Uses

func (cps ComparablePrincipalSet) IsContainedIn(set ComparablePrincipalSet) bool

IsContainedIn returns whether this ComparablePrincipalSet is contained in the given ComparablePrincipalSet. More formally- a ComparablePrincipalSet X is said to be contained in ComparablePrincipalSet Y if for each ComparablePrincipalSet x in X there is a ComparablePrincipalSet y in Y such that y.IsA(x) is true. If a ComparablePrincipalSet X is contained by a ComparablePrincipalSet Y then if a signature set satisfies Y, it also satisfies X, because for each x in X there is a y in Y such that there exists a signature of a corresponding identity such that the identity satisfies y, and therefore satisfies x too.

func (ComparablePrincipalSet) IsSubset Uses

func (cps ComparablePrincipalSet) IsSubset(sets ComparablePrincipalSet) bool

IsSubset returns whether this ComparablePrincipalSet is a subset of the given ComparablePrincipalSet

func (ComparablePrincipalSet) String Uses

func (cps ComparablePrincipalSet) String() string

String returns a string representation of this ComparablePrincipalSet

func (ComparablePrincipalSet) ToPrincipalSet Uses

func (cps ComparablePrincipalSet) ToPrincipalSet() policies.PrincipalSet

ToPrincipalSet converts this ComparablePrincipalSet to a PrincipalSet

type ComparablePrincipalSets Uses

type ComparablePrincipalSets []ComparablePrincipalSet

ComparablePrincipalSets aggregate ComparablePrincipalSets

func Merge Uses

func Merge(s1, s2 ComparablePrincipalSets) ComparablePrincipalSets

Merge returns ComparablePrincipalSets that the underlying PrincipalSets consist of PrincipalSets that satisfy the endorsement policies that both ComparablePrincipalSets were derived of. More formally speaking, let EP1 and EP2 be endorsement policies, and P1 and P2 be the principal sets that each principal set p in P1 satisfies EP1, and each principal set p in P2 satisfies EP2. Denote as S1 and S2 the ComparablePrincipalSets derived from EP1 and EP2 respectively. Then, S = Merge(S1, S2) wields ComparablePrincipalSets such that every ComparablePrincipalSet s in S, satisfies both EP1 and EP2.

func (ComparablePrincipalSets) ExcludeIndices Uses

func (cps ComparablePrincipalSets) ExcludeIndices(mapping map[int][]int) ComparablePrincipalSets

ExcludeIndices returns a ComparablePrincipalSets without the given indices found in the keys

func (ComparablePrincipalSets) OfMapping Uses

func (cps ComparablePrincipalSets) OfMapping(mapping map[int][]int, sets2 ComparablePrincipalSets) comparablePrincipalSetPairs

OfMapping returns comparablePrincipalSetPairs comprising only of the indices found in the given keys

func (ComparablePrincipalSets) Reduce Uses

func (cps ComparablePrincipalSets) Reduce() ComparablePrincipalSets

Reduce returns the ComparablePrincipalSets in a form such that no element contains another element. Every element that contains some other element is omitted from the result.

func (ComparablePrincipalSets) ToPrincipalSets Uses

func (cps ComparablePrincipalSets) ToPrincipalSets() policies.PrincipalSets

ToPrincipalSets converts this ComparablePrincipalSets to a PrincipalSets

Package inquire imports 9 packages (graph) and is imported by 2 packages. Updated 2019-06-15. Refresh now. Tools for package owners.