traefik_allowlist

package module
v0.0.0-...-76db77a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XFF = "X-Forwarded-For"
)

Variables

This section is empty.

Functions

func New

func New(_ context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

New instantiates and returns the required components used to handle a HTTP request

Types

type AllowList

type AllowList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AllowList holds the necessary components of a Traefik plugin

func (*AllowList) ServeHTTP

func (u *AllowList) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP checks the leftmost ip in the XFF header to see if this ip is allowed

type Config

type Config struct {
	Allow []string `json:"allow,omitempty" toml:"allow,omitempty" yaml:"allow,omitempty"`
}

func CreateConfig

func CreateConfig() *Config

CreateConfig creates and initializes the plugin configuration.

Jump to

Keyboard shortcuts

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