traefik_secret_request_header_middleware

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

Traefik Secret Request Header Middleware

This custom Traefik middleware makes it possible to inject a request header from a Kubernetes Secret value.

See the plugindemo for more information about custom middleware.

Usage

See install a plugin on how to use this plugin.

It can be installed by adding this to the Traefik static configuration:

experimental:
  plugins:
    secret-request-header: # Name of the plugin
      moduleName: github.com/fundarealestate/traefik-secret-request-header-middleware
      version: "v1.2.3" # See releases

And then use the Middleware like this:

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: my-middleware
spec:
  plugin:
    secret-request-header:
      headers:
        X-Secret: urn:k8s:secret:{name}:{key}

Ownership

This codebase is owned by SRE.

Documentation

Overview

Package traefik_secret_request_header_middleware a custom Traefik Middleware.

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 created a Middleware instance.

Types

type Config

type Config struct {
	Headers map[string]string `json:"headers,omitempty"`
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type Middleware

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

Middleware a Middleware plugin.

func (*Middleware) ServeHTTP

func (a *Middleware) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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