security

package
v3.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature         = errors.New("Invalid signature")
	ErrInvalidSignatureEncoding = errors.New("Invalid signature encoding")
)
View Source
var ErrInvalidSourceAddress = errors.New("invalid source address")
View Source
var ErrSecurityOptionsNotAllowed = ierrors.New(403, "Security processing options are not allowed", "Invalid URL")
View Source
var ErrSourceAddressNotAllowed = errors.New("source address is not allowed")
View Source
var ErrSourceFileTooBig = ierrors.New(422, "Source image file is too big", "Invalid source image")
View Source
var ErrSourceFrameResolutionTooBig = ierrors.New(422, "Source image frame resolution is too big", "Invalid source image")
View Source
var ErrSourceResolutionTooBig = ierrors.New(422, "Source image resolution is too big", "Invalid source image")

Functions

func CheckDimensions

func CheckDimensions(width, height, frames int, opts Options) error

func CheckFileSize added in v3.14.0

func CheckFileSize(size int, opts Options) error

func IsSecurityOptionsAllowed added in v3.14.0

func IsSecurityOptionsAllowed() error

func LimitFileSize added in v3.14.0

func LimitFileSize(r io.Reader, opts Options) io.Reader

func VerifySignature

func VerifySignature(signature, path string) error

func VerifySourceNetwork added in v3.15.0

func VerifySourceNetwork(addr string) error

func VerifySourceURL

func VerifySourceURL(imageURL string) error

Types

type Options added in v3.14.0

type Options struct {
	MaxSrcResolution            int
	MaxSrcFileSize              int
	MaxAnimationFrames          int
	MaxAnimationFrameResolution int
}

func DefaultOptions added in v3.14.0

func DefaultOptions() Options

Jump to

Keyboard shortcuts

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