fabric: github.com/hyperledger/fabric/discovery/support/acl Index | Files

package acl

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

Index

Package Files

support.go

type ChannelConfigGetter Uses

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

ChannelConfigGetter enables to retrieve the channel config resources

type ChannelConfigGetterFunc Uses

type ChannelConfigGetterFunc func(cid string) channelconfig.Resources

ChannelConfigGetterFunc returns the resources of the channel config

func (ChannelConfigGetterFunc) GetChannelConfig Uses

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

GetChannelConfig returns the resources of the channel config

type ChannelPolicyManagerGetter Uses

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)
}

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

type ChannelVerifier Uses

type ChannelVerifier struct {
    policies.ChannelPolicyManagerGetter
    Policy string
}

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

func NewChannelVerifier Uses

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 Uses

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 Uses

type DiscoverySupport struct {
    ChannelConfigGetter
    Verifier
    Evaluator
}

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

func NewDiscoverySupport Uses

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

NewDiscoverySupport creates a new DiscoverySupport

func (*DiscoverySupport) ConfigSequence Uses

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

ConfigSequence returns the configuration sequence of the given channel

func (*DiscoverySupport) EligibleForService Uses

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 Uses

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

type Evaluator Uses

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

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

type Verifier Uses

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
}

Verifier verifies a signature and a message

Package acl imports 6 packages (graph) and is imported by 2 packages. Updated 2018-12-21. Refresh now. Tools for package owners.