authenticator

package
v0.0.0-...-cc38a72 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

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

Aggregator aggregates authenticators

func NewAggregator

func NewAggregator(authenticators ...Authenticator) Aggregator

NewAggregator receives list of authenticators order of passed authenticator determines in which order they will be queried

func (Aggregator) Authenticate

func (a Aggregator) Authenticate(token string) (*unversioned.UserInfo, error)

Authenticate try all providers until first error or success hit

type Authenticator

type Authenticator interface {
	Authenticate(token string) (*unversioned.UserInfo, error)
}

Authenticator is the general concept providing authentication information Authenticate method should return error only if internal error happened if user could not be identified returned value should be nil, nil

type Noop

type Noop struct{}

Noop is the default authenticator which only returns empty user

func (Noop) Authenticate

func (n Noop) Authenticate(token string) (*unversioned.UserInfo, error)

Authenticate return empty userinfo

type Static

type Static map[string]*unversioned.UserInfo

Static represents authentication mechanism via hardcoded token - user pair passed with a csv file

func NewStatic

func NewStatic(filepath string) (Static, error)

NewStatic populates StaticAuthneticator object by reading from passed csv file

func (Static) Authenticate

func (tokens Static) Authenticate(token string) (*unversioned.UserInfo, error)

Authenticate looks up a user for the provided token and returns UID

Jump to

Keyboard shortcuts

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