auth

package
v0.0.0-...-b56887b Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package auth provides the authentication methods for the API of the wavepipe media server.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoUsername is returned when no username is provided on login
	ErrNoUsername = errors.New("no username provided")
	// ErrNoPassword is returned when no password is provided on login
	ErrNoPassword = errors.New("no password provided")
	// ErrInvalidUsername is returned when an invalid username is provided on login
	ErrInvalidUsername = errors.New("invalid username")
	// ErrInvalidPassword is returned when an invalid password is provided on login
	ErrInvalidPassword = errors.New("invalid password")

	// ErrNoToken is returned when no API token is provided on all other API calls
	ErrNoToken = errors.New("no token provided")
	// ErrInvalidToken is returned when an invalid API token is provided on all other API calls
	ErrInvalidToken = errors.New("invalid token")
	// ErrSessionExpired is returned when the session is expired
	ErrSessionExpired = errors.New("session expired")

	// ErrEmptyBasic is returned when a blank HTTP Basic authentication header is passed
	ErrEmptyBasic = errors.New("empty HTTP Basic header")
	// ErrInvalidBasic is returned when an invalid HTTP Basic authentication header is passed
	ErrInvalidBasic = errors.New("invalid HTTP Basic header")
)

Functions

This section is empty.

Types

type AuthenticatorFunc

type AuthenticatorFunc func(*http.Request) (*data.User, *data.Session, error, error)

AuthenticatorFunc is an adapter which allows any function with the appropriate signature to act as an authentication function for the wavepipe API

func Factory

func Factory(path string) AuthenticatorFunc

Factory generates the appropriate authorization method by using input parameters

func (AuthenticatorFunc) Authenticate

func (f AuthenticatorFunc) Authenticate(req *http.Request) (*data.User, *data.Session, error, error)

Authenticate invokes an AuthenticatorFunc and returns a user, its session, a client error, and a server error

Jump to

Keyboard shortcuts

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