auth

package
v0.0.0-...-ea2d26f Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, a *AuthContext) context.Context

Types

type AuthContext

type AuthContext struct {
	AuthMethod string
	UserName   string
}

func FromContext

func FromContext(ctx context.Context) (*AuthContext, bool)

type AuthProvider

type AuthProvider interface {
	// Returns HTTP middleware for performing authentication.
	Middleware() func(http.Handler) http.Handler
}

Abstracts the authentication backend for the server.

func NewBasicAuth

func NewBasicAuth(realm, username, password string) (AuthProvider, error)

func NewFromURL

func NewFromURL(cfg *config.Config, authURL string) (AuthProvider, error)

type BasicAuth

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

func (*BasicAuth) Middleware

func (b *BasicAuth) Middleware() func(http.Handler) http.Handler

Jump to

Keyboard shortcuts

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