Documentation ¶
Index ¶
Constants ¶
const UpdateInterval = 5 * time.Minute
UpdateInterval is the default interval at which the public list is refected and updated
Variables ¶
This section is empty.
Functions ¶
func NewFilteredBlockstore ¶
func NewFilteredBlockstore(bstore blockstore.Blockstore, filter Filter) blockstore.Blockstore
Types ¶
type BlockFilter ¶
type BlockFilter struct {
// contains filtered or unexported fields
}
BlockFilter manages updating a deny list and checking for CID inclusion in that list
func NewBlockFilter ¶
func NewBlockFilter() *BlockFilter
func (*BlockFilter) FulfillRequest ¶
func (bf *BlockFilter) FulfillRequest(p peer.ID, c cid.Cid) (bool, error)
FulfillRequest checks if a given CID is in the deny list, per the rules of hashing cids (convert to base32, add "/" to path, then sha256 hash)
func (*BlockFilter) ParseUpdate ¶
func (bf *BlockFilter) ParseUpdate(stream io.Reader) error
ParseUpdate parses and updates the block filter list based on an endpoint response
type ConfigFilter ¶
type ConfigFilter struct {
// contains filtered or unexported fields
}
ConfigFilter manages filtering based on a remotely fetched retrieval configuration
func NewConfigFilter ¶
func NewConfigFilter() *ConfigFilter
NewConfigFilter constructs a new peer filter
func (*ConfigFilter) FulfillRequest ¶
func (cf *ConfigFilter) FulfillRequest(p peer.ID, c cid.Cid) (bool, error)
FulfillRequest checks if a given peer is in the allow/deny list and decides whether to fulfill the request
func (*ConfigFilter) ParseUpdate ¶
func (cf *ConfigFilter) ParseUpdate(stream io.Reader) error
ParseUpdate parses and updates the Peer filter list based on an endpoint response
type Fetcher ¶
Fetcher is a function that fetches from a remote source The first return value indicates whether any update has occurred since the last fetch time The second return is a stream of data if an update has occurred The third is any error
func FetcherForHTTPEndpoint ¶
FetcherForHTTPEndpoint makes an fetcher that reads from an HTTP endpoint
type FilterDefinition ¶
type FilteredBlockstore ¶
type FilteredBlockstore struct { blockstore.Blockstore // contains filtered or unexported fields }
type MultiFilter ¶
type MultiFilter struct {
// contains filtered or unexported fields
}
func NewMultiFilter ¶
func NewMultiFilter( cfgDir string, apiFilterEndpoint string, apiFilterAuth string, BadBitsDenyList []string, ) *MultiFilter
func NewMultiFilterWithConfigs ¶
func NewMultiFilterWithConfigs(cfgDir string, filterDefinitions []FilterDefinition, clock clock.Clock, onTick func()) *MultiFilter
func (*MultiFilter) FulfillRequest ¶
func (mf *MultiFilter) FulfillRequest(p peer.ID, c cid.Cid) (bool, error)
FulfillRequest returns true if a request should be fulfilled error indicates an error in processing
type PeerListType ¶
type PeerListType string
PeerListType is either an allow list or a deny list
const AllowList PeerListType = "allowlist"
AllowList is a peer list where only the specified peers are allowed to serve retrievals
const DenyList PeerListType = "denylist"
DenyList is a peer list where the specified peers cannot serve retrievals, but all others can