Avatar Ilya Mateyko

go.astrophena.name/tsid Module

GitHub repository | Commit (92c1550)

Authenticate Tailscale users with Caddy.

This package is unmaintained.

package tsid

import "go.astrophena.name/tsid"

Package tsid is a Caddy plugin that allows access only to requests coming from the Tailscale network and allows to identify users behind these requests by setting some Caddy placeholders.

Index

Types

type Middleware

type Middleware struct{}

Middleware is a Caddy HTTP handler that allows requests only from the Tailscale network and sets placeholders based on the Tailscale node information.

func (Middleware) CaddyModule

func (Middleware) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (Middleware) ServeHTTP

func (Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements the caddyhttp.MiddlewareHandler interface.

func (Middleware) UnmarshalCaddyfile

func (Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements the caddyfile.Unmarshaler interface.