reauth

package module
v0.0.0-...-31c8788 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 15 Imported by: 0

README

caddy2-reauth

testify Coverage Status Godoc Caddy Community

Another authentication plugin for Caddy v2.

TODO

  • Tests
  • Examples
  • Readme

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Type string `json:"type,omitempty"`
	// contains filtered or unexported fields
}

Backend is an authentication backend.

func (*Backend) Authenticate

func (b *Backend) Authenticate(r *http.Request) (string, error)

Authenticate performs authentication with an authentication provider.

func (Backend) MarshalJSON

func (b Backend) MarshalJSON() ([]byte, error)

MarshalJSON packs configuration info JSON byte array

func (*Backend) UnmarshalJSON

func (b *Backend) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks configuration into appropriate structures.

func (*Backend) Validate

func (b *Backend) Validate() error

Validate checks whether an authentication provider is functional.

type Failure

type Failure struct {
	Mode string `json:"mode,omitempty"`
	// contains filtered or unexported fields
}

Failure is a failure mode

func (*Failure) Handle

func (f *Failure) Handle(w http.ResponseWriter, r *http.Request) error

Handle handles the failure mode.

func (Failure) MarshalJSON

func (f Failure) MarshalJSON() ([]byte, error)

MarshalJSON packs configuration info JSON byte array

func (*Failure) UnmarshalJSON

func (f *Failure) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks configuration into appropriate structures.

func (*Failure) Validate

func (f *Failure) Validate() error

Validate checks whether an failure mode is functional.

type Reauth

type Reauth struct {
	Backends []Backend `json:"backends,omitempty"`
	Failure  Failure   `json:"failure,omitempty"`
	// contains filtered or unexported fields
}

Reauth module

func (Reauth) Authenticate

func (r Reauth) Authenticate(w http.ResponseWriter, req *http.Request) (caddyauth.User, bool, error)

Authenticate the request

func (Reauth) CaddyModule

func (Reauth) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Reauth) Provision

func (r *Reauth) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner.

func (Reauth) Validate

func (r Reauth) Validate() error

Validate implements caddy.Validator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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