ChannelConfigGetter enables to retrieve the channel config resources
type ChannelConfigGetter interface { // GetChannelConfig returns the resources of the channel config GetChannelConfig(cid string) channelconfig.Resources }
ChannelConfigGetterFunc returns the resources of the channel config
type ChannelConfigGetterFunc func(cid string) channelconfig.Resources
func (f ChannelConfigGetterFunc) GetChannelConfig(cid string) channelconfig.Resources
GetChannelConfig returns the resources of the channel config
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) }
ChannelVerifier verifies a signature and a message on the context of a channel
type ChannelVerifier struct { policies.ChannelPolicyManagerGetter Policy string }
func NewChannelVerifier(policy string, polMgr policies.ChannelPolicyManagerGetter) *ChannelVerifier
NewChannelVerifier returns a new channel verifier from the given policy and policy manager getter
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.
DiscoverySupport implements support that is used for service discovery that is related to access control
type DiscoverySupport struct { ChannelConfigGetter Verifier Evaluator }
func NewDiscoverySupport(v Verifier, e Evaluator, chanConf ChannelConfigGetter) *DiscoverySupport
NewDiscoverySupport creates a new DiscoverySupport
func (s *DiscoverySupport) ConfigSequence(channel string) uint64
ConfigSequence returns the configuration sequence of the given channel
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 (s *DiscoverySupport) SatisfiesPrincipal(channel string, rawIdentity []byte, principal *msp.MSPPrincipal) error
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 }
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 }