auth

package
v0.0.0-...-dde2e2b Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

A unified authentication module.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserExist     = errors.New("User Exist")
	ErrUserNotExist  = errors.New("User Not Exist")
	ErrWrongPassword = errors.New("Wrong Password")
)
View Source
var ErrAuthFailed = errors.New("Authentication Failed")
View Source
var ErrNoMatchedPublicKey = errors.New("No Matched Public Key")

Functions

This section is empty.

Types

type Authentication

type Authentication interface {
	// Auth should return with (username, err).
	Auth(url.Values) (string, error)
}

Authentication just means knowing who you are.

type AuthenticationList

type AuthenticationList []Authentication

func (AuthenticationList) Auth

func (al AuthenticationList) Auth(params url.Values) (user string, err error)

func (AuthenticationList) Of

type Password

type Password struct {
	// Usually this should be a scoped storage.
	Store rkv.Interface
}

func (Password) Auth

func (p Password) Auth(params url.Values) (string, error)

v is a map with keys "user" and "pass".

func (Password) New

func (p Password) New(user, pass string) error

func (Password) Set

func (p Password) Set(user, pass string) error

type PublicKey

type PublicKey struct {
	// Usually this should be a scoped storage.
	Store rkv.Interface
}

func (PublicKey) Auth

func (p PublicKey) Auth(params url.Values) (string, error)

func (PublicKey) Set

func (p PublicKey) Set(user string, authorizedKeys []byte) error

Jump to

Keyboard shortcuts

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