auth

package
v0.0.0-...-a23bd61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SESSION_KEY = "x-evebox-session-id"

Variables

View Source
var ErrNoPassword = errors.New("no password provided")
View Source
var ErrNoUsername = errors.New("no username provided")

Functions

This section is empty.

Types

type AnonymousAuthenticator

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

The anonymous authenticator is used when no authentication is desired. Each http request will be authenticated with a session without having to login.

func NewAnonymousAuthenticator

func NewAnonymousAuthenticator(sessionStore *sessions.SessionStore) *AnonymousAuthenticator

func (*AnonymousAuthenticator) Authenticate

func (*AnonymousAuthenticator) Login

type AuthenticationRequiredResponse

type AuthenticationRequiredResponse struct {
	Types []string `json:"types"`
}

type Authenticator

type Authenticator interface {
	Login(r *http.Request) (*sessions.Session, error)
	Authenticate(w http.ResponseWriter, r *http.Request) *sessions.Session
}

type UsernameAuthenticator

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

func NewUsernameAuthenticator

func NewUsernameAuthenticator(sessionStore *sessions.SessionStore) *UsernameAuthenticator

func (*UsernameAuthenticator) Authenticate

func (*UsernameAuthenticator) Login

func (*UsernameAuthenticator) WriteStatusUnauthorized

func (a *UsernameAuthenticator) WriteStatusUnauthorized(w http.ResponseWriter)

type UsernamePasswordAuthenticator

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

func NewUsernamePasswordAuthenticator

func NewUsernamePasswordAuthenticator(sessionStore *sessions.SessionStore,
	userStore core.UserStore) *UsernamePasswordAuthenticator

func (*UsernamePasswordAuthenticator) Authenticate

func (*UsernamePasswordAuthenticator) Login

func (*UsernamePasswordAuthenticator) WriteStatusUnauthorized

func (a *UsernamePasswordAuthenticator) WriteStatusUnauthorized(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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