auth

package
v0.0.0-...-6f42548 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowRead = 1 << iota
	AllowWrite
	AllowInternalRead
	AllowTransfer
	AllowAccept
	AllowTruncate
	AllowStat
	AllowUser
	AllowPassword
)
View Source
const (
	RoleReader = 1 << iota
	RoleWriter
	RoleHub
	RoleAdmin
	RoleInstance
)
View Source
const (
	DefaultAdmin = "admin"
	Anonymous    = "all"
)

Variables

This section is empty.

Functions

func LoadInstanceKey

func LoadInstanceKey(home string) (string, error)

Types

type Permissions

type Permissions struct {
	Users map[string]*UserData
	// contains filtered or unexported fields
}

func LoadPermissions

func LoadPermissions(home string) (*Permissions, error)

func (*Permissions) DeleteUser

func (perms *Permissions) DeleteUser(user string)

func (*Permissions) IsAllowed

func (perms *Permissions) IsAllowed(action, user, password string) bool

func (*Permissions) Save

func (perms *Permissions) Save(home string) error

func (*Permissions) SetPassword

func (perms *Permissions) SetPassword(user string, password string)

func (*Permissions) SetRoles

func (perms *Permissions) SetRoles(user string, roles []string)

type UserData

type UserData struct {
	Roles        int
	PasswordHash []byte
}

Jump to

Keyboard shortcuts

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