cmdutils

package
v0.38.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowBigBlockOptionName = "allow-big-block"
	SoftBlockLimit          = 1024 * 1024 // https://github.com/ipfs/kubo/issues/7421#issuecomment-910833499
)

Variables

View Source
var AllowBigBlockOption cmds.Option

Functions

func CheckBlockSize

func CheckBlockSize(req *cmds.Request, size uint64) error

func CheckCIDSize

func CheckCIDSize(req *cmds.Request, c cid.Cid, dagAPI coreiface.APIDagService) error

func CleanAndTrim added in v0.38.0

func CleanAndTrim(str string) string

CleanAndTrim sanitizes untrusted strings from remote peers to prevent display issues across web UIs, terminals, and logs. It replaces control characters, format characters, and surrogates with U+FFFD (�), then enforces a maximum length of 128 runes.

This follows the libp2p identify specification and RFC 9839 guidance: replacing problematic code points is preferred over deletion as deletion is a known security risk.

func PathOrCidPath added in v0.24.0

func PathOrCidPath(str string) (path.Path, error)

PathOrCidPath returns a path.Path built from the argument. It keeps the old behaviour by building a path from a CID string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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