ipallowlist

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker allows to check that addresses are in a trusted IPs. Check function copied from traefik codebase, thanks to them.

func NewChecker

func NewChecker(trustedIPs []string) (*Checker, error)

func (*Checker) Contains

func (ip *Checker) Contains(addr string) (bool, error)

Contains checks if provided address is in the trusted IPs.

func (*Checker) ContainsIP

func (ip *Checker) ContainsIP(addr net.IP) bool

func (*Checker) IsAuthorized

func (ip *Checker) IsAuthorized(addr string) error

type IPAllowList

type IPAllowList struct {
	SourceRange []string `cfg:"source_range"`
}

func (*IPAllowList) Middleware

func (m *IPAllowList) Middleware(ctx context.Context, _ string) (func(lconn *net.TCPConn) error, error)

Jump to

Keyboard shortcuts

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