policies

package
v0.0.0-...-95b87ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PathSeparator = "/"

	ChannelPrefix = "Channel"

	ApplicationPrefix = "Application"

	OrdererPrefix = "Orderer"

	ChannelReaders = PathSeparator + ChannelPrefix + PathSeparator + "Readers"

	ChannelWriters = PathSeparator + ChannelPrefix + PathSeparator + "Writers"

	ChannelApplicationReaders = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Readers"

	ChannelApplicationWriters = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Writers"

	ChannelApplicationAdmins = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + "Admins"

	BlockValidation = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "BlockValidation"

	ChannelOrdererAdmins = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Admins"

	ChannelOrdererWriters = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Writers"

	ChannelOrdererReaders = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "Readers"
)

Variables

This section is empty.

Functions

func ImplicitMetaFromString

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

func ImplicitMetaPolicyWithSubPolicy

func ImplicitMetaPolicyWithSubPolicy(subPolicyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigPolicy

func TemplateImplicitMetaAllPolicy

func TemplateImplicitMetaAllPolicy(path []string, policyName string) *cb.ConfigGroup

func TemplateImplicitMetaAnyPolicy

func TemplateImplicitMetaAnyPolicy(path []string, policyName string) *cb.ConfigGroup

func TemplateImplicitMetaMajorityPolicy

func TemplateImplicitMetaMajorityPolicy(path []string, policyName string) *cb.ConfigGroup

func TemplateImplicitMetaPolicy

func TemplateImplicitMetaPolicy(path []string, policyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigGroup

func TemplateImplicitMetaPolicyWithSubPolicy

func TemplateImplicitMetaPolicyWithSubPolicy(path []string, policyName string, subPolicyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigGroup

Types

type ChannelPolicyManagerGetter

type ChannelPolicyManagerGetter interface {
	Manager(channelID string) Manager
}

type ConfigPolicy

type ConfigPolicy interface {
	Key() string

	Value() *cb.Policy
}

type Converter

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

type ImplicitMetaPolicy

type ImplicitMetaPolicy struct {
	Threshold   int
	SubPolicies []Policy

	SubPolicyName string
	// contains filtered or unexported fields
}

func NewImplicitMetaPolicy

func NewImplicitMetaPolicy(data []byte, managers map[string]*ManagerImpl) (*ImplicitMetaPolicy, error)

func (*ImplicitMetaPolicy) Convert

func (*ImplicitMetaPolicy) Evaluate

func (imp *ImplicitMetaPolicy) Evaluate(signatureSet []*protoutil.SignedData) error

type InquireablePolicy

type InquireablePolicy interface {
	SatisfiedBy() []PrincipalSet
}

type Manager

type Manager interface {
	GetPolicy(id string) (Policy, bool)

	Manager(path []string) (Manager, bool)
}

type ManagerImpl

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

func NewManagerImpl

func NewManagerImpl(path string, providers map[int32]Provider, root *cb.ConfigGroup) (*ManagerImpl, error)

func (*ManagerImpl) GetPolicy

func (pm *ManagerImpl) GetPolicy(id string) (Policy, bool)

func (*ManagerImpl) Manager

func (pm *ManagerImpl) Manager(path []string) (Manager, bool)

type Policy

type Policy interface {
	Evaluate(signatureSet []*protoutil.SignedData) error
}

type PolicyLogger

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

func (*PolicyLogger) Convert

func (pl *PolicyLogger) Convert() (*cb.SignaturePolicyEnvelope, error)

func (*PolicyLogger) Evaluate

func (pl *PolicyLogger) Evaluate(signatureSet []*protoutil.SignedData) error

type PolicyManagerGetterFunc

type PolicyManagerGetterFunc func(channelID string) Manager

func (PolicyManagerGetterFunc) Manager

func (p PolicyManagerGetterFunc) Manager(channelID string) Manager

type PrincipalSet

type PrincipalSet []*msp.MSPPrincipal

func (PrincipalSet) ContainingOnly

func (ps PrincipalSet) ContainingOnly(f func(*msp.MSPPrincipal) bool) bool

func (PrincipalSet) UniqueSet

func (ps PrincipalSet) UniqueSet() map[*msp.MSPPrincipal]int

type PrincipalSets

type PrincipalSets []PrincipalSet

func (PrincipalSets) ContainingOnly

func (psSets PrincipalSets) ContainingOnly(f func(*msp.MSPPrincipal) bool) PrincipalSets

type Provider

type Provider interface {
	NewPolicy(data []byte) (Policy, proto.Message, error)
}

type StandardConfigPolicy

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

func ImplicitMetaAllPolicy

func ImplicitMetaAllPolicy(policyName string) *StandardConfigPolicy

func ImplicitMetaAnyPolicy

func ImplicitMetaAnyPolicy(policyName string) *StandardConfigPolicy

func ImplicitMetaMajorityPolicy

func ImplicitMetaMajorityPolicy(policyName string) *StandardConfigPolicy

func SignaturePolicy

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

func (*StandardConfigPolicy) Key

func (scv *StandardConfigPolicy) Key() string

func (*StandardConfigPolicy) Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL