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

package policy

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

Index

Package Files

application.go policy.go

type ApplicationPolicyEvaluator Uses

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

func New Uses

func New(deserializer msp.IdentityDeserializer, channel string, channelPolicyManagerGetter policies.ChannelPolicyManagerGetter) (*ApplicationPolicyEvaluator, error)

New returns an evaluator for application policies

func (*ApplicationPolicyEvaluator) Evaluate Uses

func (a *ApplicationPolicyEvaluator) Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error

type ChannelPolicyManagerGetter Uses

type ChannelPolicyManagerGetter interface {
    policies.ChannelPolicyManagerGetter
}

ChannelPolicyManagerGetter is the local interface that used to generate mocks for foreign interface.

type ChannelPolicyReferenceProvider Uses

type ChannelPolicyReferenceProvider interface {
    // NewPolicy creates a new policy based on the policy bytes.
    NewPolicy(channelConfigPolicyReference string) (policies.Policy, error)
}

ChannelPolicyReferenceProvider is used to determine if a set of signature is valid and complies with a policy.

type ChannelPolicyReferenceProviderImpl Uses

type ChannelPolicyReferenceProviderImpl struct {
    Manager
}

func (*ChannelPolicyReferenceProviderImpl) NewPolicy Uses

func (c *ChannelPolicyReferenceProviderImpl) NewPolicy(channelConfigPolicyReference string) (policies.Policy, error)

type Identity Uses

type Identity interface {
    msp.Identity
}

Identity is the local interface that used to generate mocks for foreign interface.

type IdentityDeserializer Uses

type IdentityDeserializer interface {
    msp.IdentityDeserializer
}

IdentityDeserializer is the local interface that used to generate mocks for foreign interface.

type Manager Uses

type Manager interface {
    // GetPolicy returns a policy and true if it was the policy requested, or false if it is the default policy
    GetPolicy(id string) (policies.Policy, bool)
}

Manager defines functions to interface with the policy manager of a channel

type Policy Uses

type Policy interface {
    policies.Policy
}

Policy is the local interface that used to generate mocks for foreign interface.

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 []*protoutil.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 NewPolicyChecker Uses

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

NewPolicyChecker creates a new instance of PolicyChecker

type PolicyManager Uses

type PolicyManager interface {
    policies.Manager
}

PolicyManager is the local interface that used to generate mocks for foreign interface.

type SignaturePolicyProvider Uses

type SignaturePolicyProvider interface {
    // NewPolicy creates a new policy based on the policy bytes.
    NewPolicy(signaturePolicy *common.SignaturePolicyEnvelope) (policies.Policy, error)
}

SignaturePolicyProvider provides the backing implementation of a policy.

Directories

PathSynopsis
mocks

Package policy imports 11 packages (graph) and is imported by 128 packages. Updated 2020-07-10. Refresh now. Tools for package owners.