auth

package module
v0.0.0-...-8c46164 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2014 License: BSD-3-Clause Imports: 5 Imported by: 0

README

gorillax-auth Build Status

simple web session based auth built on top of the go library gorilla toolkit

Documentation

Index

Constants

View Source
const (
	AUTHENTICATED_PRINCIPAL = "AUTH_PRINCIPAL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManager

type AuthManager struct {
	*mux.Router
	Store sessions.Store

	SecuredURLs         []string
	PasswordEncoder     PasswordEncoder
	UserDetailsService  UserDetailsService
	AccessDeniedHanlder http.Handler
	// contains filtered or unexported fields
}

func NewAuthManager

func NewAuthManager(router *mux.Router, store sessions.Store, sessionName string, securedURLs []string, passwordEncoder PasswordEncoder, userDetailsService UserDetailsService, accessDeniedHanlder http.Handler) *AuthManager

func NewBasicAuthManager

func NewBasicAuthManager() *AuthManager

func (*AuthManager) AuthenticateUser

func (a *AuthManager) AuthenticateUser(w http.ResponseWriter, req *http.Request, username, rawPassword string) bool

func (*AuthManager) ClearAuthentication

func (a *AuthManager) ClearAuthentication(w http.ResponseWriter, req *http.Request)

func (*AuthManager) ServeHTTP

func (a *AuthManager) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AuthenticatedPrincipal

type AuthenticatedPrincipal string

type PasswordEncoder

type PasswordEncoder interface {
	Encode(rawPassword string) string
	Matches(rawPassword, encodedPassword string) bool
}

type UserDetails

type UserDetails interface {
	GetUsername() string
	GetPassword() string
}

type UserDetailsService

type UserDetailsService interface {
	LoadUserByUsername(username string) UserDetails
}

Jump to

Keyboard shortcuts

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