authorization

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2015 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTwoFactor is returned by an Authorizer when a two factor code is
	// either invalid or required.
	ErrTwoFactor = errors.New("authorization: two factor code required or invalid")

	// ErrUnauthorized is returned when creating an authorization fails
	// because of invalid credentials.
	ErrUnauthorized = errors.New("authorization: unauthorized")
)

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Authorize(username, password, twofactor string) (*empire.User, error)
}

Authorizer is an interface that can authorize a user.

type Fake

type Fake struct{}

Fake is a fake implementation of the Authorizer interface that let's anyone in. Used in development and tests.

func (*Fake) Authorize

func (a *Fake) Authorize(username, password, twofactor string) (*empire.User, error)

Authorizer implements Authorizer Authorize.

type MembershipError

type MembershipError struct {
	Organization string
}

func (*MembershipError) Error

func (e *MembershipError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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