auth

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerFunc added in v0.37.0

func HandlerFunc(cfg *ServerConfig, origHandler http.HandlerFunc) http.HandlerFunc

func MultiAuthnHandlerFunc added in v0.37.0

func MultiAuthnHandlerFunc(cfg *ServerConfig, origHandler http.HandlerFunc) http.HandlerFunc

func NullHandler

func NullHandler(next http.HandlerFunc) http.HandlerFunc

Types

type Authenticator added in v0.37.0

type Authenticator interface {
	AuthRequest(r *http.Request) (stdctx.Context, error)
}

type ClientAuth

type ClientAuth interface {
	AddAuth(*http.Request) error
}

func AuthClient

func AuthClient(authConfig ClientConfig) ClientAuth

TODO: Choose a better name

type ClientConfig added in v0.37.0

type ClientConfig struct {
	BasicAuthConfig  basic.ClientConfig  `mapstructure:"basic"`
	GitHubAuthConfig github.ClientConfig `mapstructure:"github"`
	HMACAuthConfig   hmac.ClientConfig   `mapstructure:"hmac"`
}

need something to deserialize and append details to http.Request

type GenericAuthConfig added in v0.37.0

type GenericAuthConfig struct {
	Name   string                 `mapstructure:"name"`
	Config map[string]interface{} `mapstructure:"config"`
}

type Handler added in v0.37.0

type Handler struct {
	Config ServerConfig
}

func NewHandler added in v0.37.0

func NewHandler(cfg *ServerConfig) *Handler

func (*Handler) Wrap added in v0.37.0

func (h *Handler) Wrap(handler http.Handler) http.Handler

type Middleware added in v0.37.0

type Middleware interface {
	//	AuthRequest(r *http.Request) (stdctx.Context, error)
	Wrap(http.Handler) http.Handler
}

type ServerConfig added in v0.37.0

type ServerConfig struct {
	BasicAuthConfig  basic.ServerConfig  `mapstructure:"basic"`
	GitHubAuthConfig github.ServerConfig `mapstructure:"github"`
	HMACAuthConfig   hmac.ServerConfig   `mapstructure:"hmac"`

	Providers []string `mapstructure:"providers"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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