...

Package acl

import "github.com/hyperledger/fabric/discovery/support/acl"
Overview
Index

Overview ▾

type ChannelConfigGetter

ChannelConfigGetter enables to retrieve the channel config resources

type ChannelConfigGetter interface {
    // GetChannelConfig returns the resources of the channel config
    GetChannelConfig(cid string) channelconfig.Resources
}

type ChannelConfigGetterFunc

ChannelConfigGetterFunc returns the resources of the channel config

type ChannelConfigGetterFunc func(cid string) channelconfig.Resources

func (ChannelConfigGetterFunc) GetChannelConfig

func (f ChannelConfigGetterFunc) GetChannelConfig(cid string) channelconfig.Resources

GetChannelConfig returns the resources of the channel config

type ChannelPolicyManagerGetter

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

type ChannelPolicyManagerGetter interface {
    // Returns the policy manager associated to the passed channel
    // and true if it was the manager requested, or false if it is the default manager
    Manager(channelID string) (policies.Manager, bool)
}

type ChannelVerifier

ChannelVerifier verifies a signature and a message on the context of a channel

type ChannelVerifier struct {
    policies.ChannelPolicyManagerGetter
    Policy string
}

func NewChannelVerifier

func NewChannelVerifier(policy string, polMgr policies.ChannelPolicyManagerGetter) *ChannelVerifier

NewChannelVerifier returns a new channel verifier from the given policy and policy manager getter

func (*ChannelVerifier) VerifyByChannel

func (cv *ChannelVerifier) VerifyByChannel(channel string, sd *cb.SignedData) error

VerifyByChannel checks that signature is a valid signature of message under a peer's verification key, but also in the context of a specific channel. If the verification succeeded, Verify returns nil meaning no error occurred. If peerIdentity is nil, then the verification fails.

type DiscoverySupport

DiscoverySupport implements support that is used for service discovery that is related to access control

type DiscoverySupport struct {
    ChannelConfigGetter
    Verifier
    Evaluator
}

func NewDiscoverySupport

func NewDiscoverySupport(v Verifier, e Evaluator, chanConf ChannelConfigGetter) *DiscoverySupport

NewDiscoverySupport creates a new DiscoverySupport

func (*DiscoverySupport) ConfigSequence

func (s *DiscoverySupport) ConfigSequence(channel string) uint64

ConfigSequence returns the configuration sequence of the given channel

func (*DiscoverySupport) EligibleForService

func (s *DiscoverySupport) EligibleForService(channel string, data cb.SignedData) error

Eligible returns whether the given peer is eligible for receiving service from the discovery service for a given channel

func (*DiscoverySupport) SatisfiesPrincipal

func (s *DiscoverySupport) SatisfiesPrincipal(channel string, rawIdentity []byte, principal *msp.MSPPrincipal) error

type Evaluator

Evaluator evaluates signatures. It is used to evaluate signatures for the local MSP

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

type Verifier

Verifier verifies a signature and a message

type Verifier interface {
    // VerifyByChannel checks that signature is a valid signature of message
    // under a peer's verification key, but also in the context of a specific channel.
    // If the verification succeeded, Verify returns nil meaning no error occurred.
    // If peerIdentity is nil, then the verification fails.
    VerifyByChannel(channel string, sd *cb.SignedData) error
}