auth

package
v0.0.0-...-ea3c427 Latest Latest
Warning

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

Go to latest
Published: May 26, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixStatic = "static"
	PrefixFile   = "file"
	PrefixRPC    = "rpc"

	KeyAnonymous = "anonymous"
	KeyPassword  = "password"
	KeyPubKey    = "pubkey"

	ValueUnderstandRasks = "I Understand the Risks"
)
View Source
const (
	RPCPassword = "Auth.Password"
	RPCPubKey   = "Auth.PublicKey"
)

Variables

View Source
var (
	// Callbacks should retuen this error, whatever the real reason is.
	ErrFailed = errors.New("Auth failed")
)

Functions

func Register

func Register(key, prefix string, f OptionsHandler)

Types

type Config

type Config struct {
	Anonymous bool
	PublicKey PublicKey
	Password  Password
}

Configuration of Authorization

func LoadConfig

func LoadConfig(data map[string]string) (cfg *Config, err error)

type OptionsHandler

type OptionsHandler func(cfg *Config, key, prefix, value string) (bool, error)

Return `ture` for exclusive options

type Password

type Password interface {
	Callback() passwordCallback
}

Password callback

type PublicKey

type PublicKey interface {
	Callback() publicKeyCallback
}

PublicKey callback

Jump to

Keyboard shortcuts

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