authenticator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2017 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package authenticator handles the management of 'X-USER-TOKEN's, allowing an authorized admin to add, remove, and validate keys for http log collection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(token string) error

Add adds an authorized 'X-USER-TOKEN' for http collecting

func ExportLogvac

func ExportLogvac(exportWriter io.Writer) error

ExportLogvac exports auth tokens to a `logvac import`able file

func ImportLogvac

func ImportLogvac(importReader io.Reader) error

ImportLogvac imports auth tokens from a `logvac export`ed file

func Init

func Init() error

Init initializes the chosen authenticator

func NewBoltDb

func NewBoltDb(config string) (*boltdb, error)

NewBoltDb creates a new boltdb (currently, it is critical to set dbAddr)

func NewPgDb

func NewPgDb(addr string) (*postgresql, error)

NewPgDb creates a new postgres authenticator

func Remove

func Remove(token string) error

Remove removes an authorized 'X-USER-TOKEN' for http collecting

func Valid

func Valid(token string) bool

Valid validates an authorized 'X-USER-TOKEN' for http collecting

Types

type Authenticatable

type Authenticatable interface {
	// contains filtered or unexported methods
}

Authenticatable contains methods all authenticators should have

Jump to

Keyboard shortcuts

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