ceremonyclient/go-libp2p/p2p/protocol/circuitv2/relay/acl.go
2023-08-20 23:07:43 -05:00

18 lines
552 B
Go

package relay
import (
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
)
// ACLFilter is an Access Control mechanism for relayed connect.
type ACLFilter interface {
// AllowReserve returns true if a reservation from a peer with the given peer ID and multiaddr
// is allowed.
AllowReserve(p peer.ID, a ma.Multiaddr) bool
// AllowConnect returns true if a source peer, with a given multiaddr is allowed to connect
// to a destination peer.
AllowConnect(src peer.ID, srcAddr ma.Multiaddr, dest peer.ID) bool
}