auth

package
v3.0.0-beta.0+incompat... Latest Latest
Warning

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

Go to latest
Published: May 6, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserAlreadyExist = errors.New("auth: user already exists")
	ErrUserNotFound     = errors.New("auth: user not found")
	ErrRoleAlreadyExist = errors.New("auth: role already exists")
	ErrRoleNotFound     = errors.New("auth: role not found")
	ErrAuthFailed       = errors.New("auth: authentication failed, invalid user ID or password")
)

Functions

func NewAuthStore

func NewAuthStore(be backend.Backend) *authStore

Types

type AuthStore

type AuthStore interface {
	// AuthEnable turns on the authentication feature
	AuthEnable()

	// Authenticate does authentication based on given user name and password,
	// and returns a token for successful case.
	// Note that the generated token is valid only for the member the client
	// connected to within fixed time duration. Reauth is required after the duration.
	Authenticate(name string, password string) (*pb.AuthenticateResponse, error)

	// Recover recovers the state of auth store from the given backend
	Recover(b backend.Backend)

	// UserAdd adds a new user
	UserAdd(r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error)

	// UserDelete deletes a user
	UserDelete(r *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error)

	// UserChangePassword changes a password of a user
	UserChangePassword(r *pb.AuthUserChangePasswordRequest) (*pb.AuthUserChangePasswordResponse, error)

	// UserGrant grants a role to the user
	UserGrant(r *pb.AuthUserGrantRequest) (*pb.AuthUserGrantResponse, error)

	// RoleAdd adds a new role
	RoleAdd(r *pb.AuthRoleAddRequest) (*pb.AuthRoleAddResponse, error)

	// RoleGrant grants a permission to a role
	RoleGrant(r *pb.AuthRoleGrantRequest) (*pb.AuthRoleGrantResponse, error)
}

Directories

Path Synopsis
Package authpb is a generated protocol buffer package.
Package authpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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