auth

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrForbidden occurs when user is identified but not authorized
	ErrForbidden = errors.New("forbidden access")
)

Functions

func ReadAuthContent

func ReadAuthContent(r *http.Request) string

ReadAuthContent from Header or Cookie

func UserFromContext

func UserFromContext(ctx context.Context) *model.User

UserFromContext retrieves user from context

Types

type App

type App interface {
	Handler(http.Handler) http.Handler
	IsAuthenticated(*http.Request) (*model.User, error)
}

App of package

func New

func New(config Config) App

New creates new App from Config

func NewService

func NewService(config Config, identService ident.Service) App

NewService creates new App from Flags' config with service

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

Jump to

Keyboard shortcuts

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