acl

package
v0.0.0-...-15ab7cc Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelConfigGetter

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

type ChannelConfigGetterFunc func(cid string) channelconfig.Resources

ChannelConfigGetterFunc returns the resources of the channel config

func (ChannelConfigGetterFunc) GetChannelConfig

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

GetChannelConfig returns the resources of the channel config

type ChannelPolicyManagerGetter

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

type ChannelVerifier struct {
	policies.ChannelPolicyManagerGetter
	Policy string
}

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

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

type DiscoverySupport struct {
	ChannelConfigGetter
	Verifier
	Evaluator
}

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

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

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

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

Jump to

Keyboard shortcuts

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