Skip to content

bwplotka/go-ipfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP Filter

Build Status

Tiny Golang lib for IP filtering.

This is helpful to restrict access to some endpoints on public service (e.g debug endpoints)

Well, why not just use proper auth (e.g basic, oidc, oauth2)?

Because some endpoints are problematic to hide using auth, like debug or metrics endpoints.

Usage

Filters are in a form of Bool conditions that takes IP in a form of net.IP

type Condition func(net.IP) bool

You can chain multiple conditions with some logic using ipfilter.OR(...) ipfilter.AND(...)

This package also contain useful HTTP middleware integration.

About

Tiny Golang lib for IP filtering. (e.g private only)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages