tlsauth

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 5 Imported by: 0

README

TLS Client Cert Authentication Traefik Plugin

Traefik plugin to authenticate users based on the Common Name, DNS Names and Email Addresses of their TLS client certificate. Optionally add the username as a request header for the upstream service.

Config
  • Users
    • key/value map of CN/DNSName/EmailAddress of the TLS client certificate mapped to a username
    • only users in this map will be allowed, all others denied
  • UsernameHeader
    • set to a header to include the username in upstream requests
type Config struct {
	Users          map[string]string
	UsernameHeader string
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New created a new plugin.

Types

type Config

type Config struct {
	Users          map[string]string
	UsernameHeader string
}

Config is the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type TLSAuth

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

TLSAuth is a TLS authentication plugin.

func (*TLSAuth) ServeHTTP

func (ta *TLSAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles a http request.

Jump to

Keyboard shortcuts

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