etcd

package
v0.0.0-...-2ca7a8e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const NO_RIGHTS = "^$"

String to represent no user rights

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcd

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

Authentication with ETCD backend

func New

func New(endpoints []string) (a *Etcd, err error)

New returns a pointer to an Auth struct. Endpoints are an array of etcd endpoints

func (*Etcd) AddOrUpdateUser

func (t *Etcd) AddOrUpdateUser(username string, password string) (err error)

AddOrUdpdateUser adds or updates a user's password, storing a hash of the password in etcd under /passwd/<usename>

func (*Etcd) Authenticate

func (t *Etcd) Authenticate(username string, password string) bool

Authenticate checks the given password with the hashed version stored in etcd

func (*Etcd) Rights

func (t *Etcd) Rights(username string) (rights string)

Rights returns a string of allowed access rights

func (*Etcd) SetRights

func (t *Etcd) SetRights(username string, rights string) (err error)

SetRights sets user rights

func (*Etcd) User

func (t *Etcd) User(username string) (u auth.User, err error)

Returns user object for a given username

func (*Etcd) UserExists

func (t *Etcd) UserExists(username string) bool

UserExists returns true if the user exists and false for anything else

Jump to

Keyboard shortcuts

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