verifcid

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPossiblyInsecureHashFunction = errors.New("potentially insecure hash functions not allowed")
	ErrBelowMinimumHashLength       = fmt.Errorf("hashes must be at least %d bytes long", minimumHashLength)
	ErrAboveMaximumHashLength       = fmt.Errorf("hashes must be at most %d bytes long", maximumHashLength)
)
View Source
var DefaultAllowlist defaultAllowlist

DefaultAllowlist is the default list of hashes allowed in IPFS.

Functions

func ValidateCid

func ValidateCid(allowlist Allowlist, c cid.Cid) error

ValidateCid validates multihash allowance behind given CID.

Types

type Allowlist added in v0.12.0

type Allowlist interface {
	// IsAllowed checks for multihash allowance by the code.
	IsAllowed(code uint64) bool
}

Allowlist defines an interface containing list of allowed multihashes.

func NewAllowlist added in v0.12.0

func NewAllowlist(allowset map[uint64]bool) Allowlist

NewAllowlist constructs new Allowlist from the given map set.

func NewOverridingAllowlist added in v0.12.0

func NewOverridingAllowlist(override Allowlist, allowset map[uint64]bool) Allowlist

NewOverridingAllowlist is like NewAllowlist but it will fallback to an other [AllowList] if keys are missing. If override is nil it will return unsecure for unknown things.

Jump to

Keyboard shortcuts

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