fabric: github.com/hyperledger/fabric/core/policy Index | Files | Directories

package policy

import "github.com/hyperledger/fabric/core/policy"

Index

Package Files

policy.go

func RegisterPolicyCheckerFactory Uses

func RegisterPolicyCheckerFactory(f PolicyCheckerFactory)

RegisterPolicyCheckerFactory is to be called once to set the factory that will be used to obtain instances of PolicyChecker

type PolicyChecker Uses

type PolicyChecker interface {
    // CheckPolicy checks that the passed signed proposal is valid with the respect to
    // passed policy on the passed channel.
    // If no channel is passed, CheckPolicyNoChannel is invoked directly.
    CheckPolicy(channelID, policyName string, signedProp *pb.SignedProposal) error

    // CheckPolicyBySignedData checks that the passed signed data is valid with the respect to
    // passed policy on the passed channel.
    // If no channel is passed, the method will fail.
    CheckPolicyBySignedData(channelID, policyName string, sd []*common.SignedData) error

    // CheckPolicyNoChannel checks that the passed signed proposal is valid with the respect to
    // passed policy on the local MSP.
    CheckPolicyNoChannel(policyName string, signedProp *pb.SignedProposal) error
}

PolicyChecker offers methods to check a signed proposal against a specific policy defined in a channel or not.

func GetPolicyChecker Uses

func GetPolicyChecker() PolicyChecker

GetPolicyChecker returns instances of PolicyChecker; the actual implementation is controlled by the factory that is registered via RegisterPolicyCheckerFactory

func NewPolicyChecker Uses

func NewPolicyChecker(channelPolicyManagerGetter policies.ChannelPolicyManagerGetter, localMSP msp.IdentityDeserializer, principalGetter mgmt.MSPPrincipalGetter) PolicyChecker

NewPolicyChecker creates a new instance of PolicyChecker

type PolicyCheckerFactory Uses

type PolicyCheckerFactory interface {
    NewPolicyChecker() PolicyChecker
}

PolicyCheckerFactory defines a factory interface so that the actual implementation can be injected

Directories

PathSynopsis
mocks

Package policy imports 8 packages (graph) and is imported by 41 packages. Updated 2018-12-12. Refresh now. Tools for package owners.