plugin_allowpath

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

Allow Path

Allow Path is a middleware plugin for Traefik which sends an HTTP 403 Forbidden response when the requested HTTP path does not matches one of the configured regular expressions.

command:
  - "--experimental.plugins.allowpath.modulename=github.com/17media/plugin-allowpath"
  - "--experimental.plugins.allowpath.version=v0.1.0"
# Allow path starting with /foo only
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: allowpath
spec:
  plugin:
    allowpath:
      regex: ["^/foo(.*)"]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New creates and returns a plugin instance.

Types

type Config

type Config struct {
	Regex []string `json:"regex,omitempty"`
}

Config holds the plugin configuration.

func CreateConfig

func CreateConfig() *Config

Jump to

Keyboard shortcuts

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