token

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

caddy-token

Caddy token based authentication. Supports static tokens and JWT ID Tokens

building

You first need to build a new caddy executable with this plugin. The easiest way is to do this with xcaddy.

Install xcaddy:

go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

After xcaddy installation you can build caddy with this plugin by executing:

xcaddy build v2.8.4 --with github.com/loafoe/caddy-token

usage

TODO

license

License is Apache 2.0

Documentation

Index

Constants

View Source
const (
	Prefix = "lst_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Version      string `json:"v"`
	Token        string `json:"t"`
	Organization string `json:"o"`
	Environment  string `json:"e"`
	Region       string `json:"r"`
	Project      string `json:"p"`
}

type Middleware

type Middleware struct {
	TokenFile string

	Issuer string
	// contains filtered or unexported fields
}

func (*Middleware) CaddyModule

func (m *Middleware) CaddyModule() caddy.ModuleInfo

func (*Middleware) Provision

func (m *Middleware) Provision(ctx caddy.Context) error

func (*Middleware) ServeHTTP

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

func (*Middleware) UnmarshalCaddyfile

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

UnmarshalCaddyfile sets up Lessor from Caddyfile tokens. Syntax: UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

	token [<token_file>] {
	    file <token_file>
        issuer <issuer_url>
	}

func (*Middleware) Validate

func (m *Middleware) Validate() error

Jump to

Keyboard shortcuts

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