fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/policies Index | Files

package policies

import "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/policies"

Index

Package Files

implicitmetaparser.go policy.go util.go

Constants

const (
    // Path separator is used to separate policy names in paths
    PathSeparator = "/"

    // ChannelPrefix is used in the path of standard channel policy managers
    ChannelPrefix = "Channel"

    // ApplicationPrefix is used in the path of standard application policy paths
    ApplicationPrefix = "Application"

    // OrdererPrefix is used in the path of standard orderer policy paths
    OrdererPrefix = "Orderer"

    // ChannelReaders is the label for the channel's readers policy (encompassing both orderer and application readers)
    ChannelReaders = PathSeparator + ChannelPrefix + PathSeparator + "Readers"

    // ChannelWriters is the label for the channel's writers policy (encompassing both orderer and application writers)
    ChannelWriters = PathSeparator + ChannelPrefix + PathSeparator + "Writers"

    // ChannelApplicationReaders is the label for the channel's application readers policy
    ChannelApplicationReaders = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Readers"

    // ChannelApplicationWriters is the label for the channel's application writers policy
    ChannelApplicationWriters = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Writers"

    // ChannelApplicationAdmins is the label for the channel's application admin policy
    ChannelApplicationAdmins = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Admins"

    // BlockValidation is the label for the policy which should validate the block signatures for the channel
    BlockValidation = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "BlockValidation"

    // ChannelOrdererAdmins is the label for the channel's orderer admin policy
    ChannelOrdererAdmins = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Admins"

    // ChannelOrdererWriters is the label for the channel's orderer writers policy
    ChannelOrdererWriters = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Writers"

    // ChannelOrdererReaders is the label for the channel's orderer readers policy
    ChannelOrdererReaders = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Readers"
)

func ImplicitMetaFromString Uses

func ImplicitMetaFromString(input string) (*cb.ImplicitMetaPolicy, error)

type ChannelPolicyManagerGetter Uses

type ChannelPolicyManagerGetter interface {
    // Returns the policy manager associated with the specified channel.
    Manager(channelID string) Manager
}

ChannelPolicyManagerGetter is a support interface to get access to the policy manager of a given channel

type ConfigPolicy Uses

type ConfigPolicy interface {
    // Key is the key this value should be stored in the *cb.ConfigGroup.Policies map.
    Key() string

    // Value is the backing policy implementation for this ConfigPolicy
    Value() *cb.Policy
}

ConfigPolicy defines a common representation for different *cb.ConfigPolicy values.

type Converter Uses

type Converter interface {
    Convert() (*cb.SignaturePolicyEnvelope, error)
}

Converter represents a policy which may be translated into a SignaturePolicyEnvelope

type InquireablePolicy Uses

type InquireablePolicy interface {
    // SatisfiedBy returns a slice of PrincipalSets that each of them
    // satisfies the policy.
    SatisfiedBy() []PrincipalSet
}

InquireablePolicy is a Policy that one can inquire

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) (Policy, bool)

    // Manager returns the sub-policy manager for a given path and whether it exists
    Manager(path []string) (Manager, bool)
}

Manager is a read only subset of the policy ManagerImpl

type ManagerImpl Uses

type ManagerImpl struct {
    Policies map[string]Policy
    // contains filtered or unexported fields
}

ManagerImpl is an implementation of Manager and configtx.ConfigHandler In general, it should only be referenced as an Impl for the configtx.ConfigManager

type Policy Uses

type Policy interface {
    // Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies the policy
    Evaluate(signatureSet []*protoutil.SignedData) error
}

Policy is used to determine if a signature is valid

type PolicyLogger Uses

type PolicyLogger struct {
    Policy Policy
    // contains filtered or unexported fields
}

type PolicyManagerGetterFunc Uses

type PolicyManagerGetterFunc func(channelID string) Manager

PolicyManagerGetterFunc is a function adapater for ChannelPolicyManagerGetter.

type PrincipalSet Uses

type PrincipalSet []*msp.MSPPrincipal

PrincipalSet is a collection of MSPPrincipals

type PrincipalSets Uses

type PrincipalSets []PrincipalSet

PrincipalSets aggregates PrincipalSets

type Provider Uses

type Provider interface {
    // NewPolicy creates a new policy based on the policy bytes
    NewPolicy(data []byte) (Policy, proto.Message, error)
}

Provider provides the backing implementation of a policy

type StandardConfigPolicy Uses

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

StandardConfigValue implements the ConfigValue interface.

func ImplicitMetaAllPolicy Uses

func ImplicitMetaAllPolicy(policyName string) *StandardConfigPolicy

ImplicitMetaAllPolicy defines an implicit meta policy whose sub_policy and key is policyname with rule ALL.

func ImplicitMetaAnyPolicy Uses

func ImplicitMetaAnyPolicy(policyName string) *StandardConfigPolicy

ImplicitMetaAnyPolicy defines an implicit meta policy whose sub_policy and key is policyname with rule ANY.

func ImplicitMetaMajorityPolicy Uses

func ImplicitMetaMajorityPolicy(policyName string) *StandardConfigPolicy

ImplicitMetaMajorityPolicy defines an implicit meta policy whose sub_policy and key is policyname with rule MAJORITY.

func SignaturePolicy Uses

func SignaturePolicy(policyName string, sigPolicy *cb.SignaturePolicyEnvelope) *StandardConfigPolicy

ImplicitMetaMajorityPolicy defines a policy with key policyName and the given signature policy.

func (*StandardConfigPolicy) Key Uses

func (scv *StandardConfigPolicy) Key() string

Key is the key this value should be stored in the *cb.ConfigGroup.Values map.

func (*StandardConfigPolicy) Value Uses

func (scv *StandardConfigPolicy) Value() *cb.Policy

Value is the *cb.Policy which should be stored as the *cb.ConfigPolicy.Policy.

Package policies imports 7 packages (graph) and is imported by 2 packages. Updated 2019-09-05. Refresh now. Tools for package owners.