auth

package
v0.0.0-...-b0e10ae Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package auth manages the authorization of SIFT users

Index

Constants

This section is empty.

Variables

View Source
var Log = logging.Log.New("pkg", "auth")

Log is used to log messages for the auth package. Logs are disabled by default; use sift/logging.SetLevel() to set log levels for all packages, or Log.SetHandler() to set a custom handler for this package (see: https://godoc.org/gopkg.in/inconshreveable/log15.v2)

Functions

This section is empty.

Types

type Authorizor

type Authorizor interface {
	Login() Token
	Authorize(Token, interface{}) bool
}

An Authorizor allows users to log in to a system, and authorizes them for specific actions

type SiftAuthorizor

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

A SiftAuthorizor authorizes users to log in to a system, and authorizes them for specific actions. SiftAuthorizors could be instantiated by a call to auth.New()

func New

func New() *SiftAuthorizor

New creates a new SiftAuthorizor

func (*SiftAuthorizor) Authorize

func (a *SiftAuthorizor) Authorize(t Token, path interface{}) bool

Authorize confirms whether or not a particular user (represented by their token) has access to perform a particular action.

func (*SiftAuthorizor) Login

func (a *SiftAuthorizor) Login() Token

Login registers a new user and returns a unique Token that they may use to authorize further actions.

type Token

type Token string

A Token uniquely identifies a user. To get a Token, call Authorizor.Login().

Jump to

Keyboard shortcuts

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