authenticators

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Accounts = []auth.Account{
		{ID: 1, Title: "Engineering", Email: "admin@admin.com", Password: "adminadmin"},
	}

	Groups = []auth.Group{
		{ID: 1, Name: "developers"},
		{ID: 2, Name: "operation"},
	}
)

Functions

This section is empty.

Types

type DbAuthenicator

type DbAuthenicator struct {
	DbClient *gorm.DB
	auth.Authenticator
}

func NewDBAuthenticator

func NewDBAuthenticator(dbDriver, dbDsn string) *DbAuthenicator

func (*DbAuthenicator) Account

func (db *DbAuthenicator) Account(idOrEmail interface{}) (*auth.Account, error)

func (*DbAuthenicator) AccountGroups

func (db *DbAuthenicator) AccountGroups(listOptions model.ListOptions) (*[]auth.Group, error)

func (*DbAuthenicator) Accounts

func (db *DbAuthenicator) Accounts(listOptions model.ListOptions) (*[]auth.Account, error)

func (*DbAuthenicator) CreateAccount

func (db *DbAuthenicator) CreateAccount(groupId uint64, a *auth.Account) error

func (*DbAuthenicator) CreateGroup

func (db *DbAuthenicator) CreateGroup(g *auth.Group) error

func (*DbAuthenicator) DeleteAccount

func (db *DbAuthenicator) DeleteAccount(a *auth.Account) error

func (*DbAuthenicator) DeleteGroup

func (db *DbAuthenicator) DeleteGroup(groupId uint64) error

func (*DbAuthenicator) EncryptPassword

func (db *DbAuthenicator) EncryptPassword(password string) string

func (*DbAuthenicator) Group

func (db *DbAuthenicator) Group(id uint64) (*auth.Group, error)

func (*DbAuthenicator) GroupAccounts

func (db *DbAuthenicator) GroupAccounts(listOptions model.ListOptions) (*[]auth.Account, error)

func (*DbAuthenicator) Groups

func (db *DbAuthenicator) Groups(listOptions model.ListOptions) (*[]auth.Group, error)

func (*DbAuthenicator) JoinGroup

func (db *DbAuthenicator) JoinGroup(accountId, groupId uint64) error

func (*DbAuthenicator) LeaveGroup

func (db *DbAuthenicator) LeaveGroup(accountId, groupId uint64) error

func (*DbAuthenicator) Login

func (db *DbAuthenicator) Login(a *auth.Account) (string, error)

func (*DbAuthenicator) ModificationAllowed

func (db *DbAuthenicator) ModificationAllowed() bool

func (*DbAuthenicator) UpdaetAccount

func (db *DbAuthenicator) UpdaetAccount(a *auth.Account) error

func (*DbAuthenicator) UpdateGroup

func (db *DbAuthenicator) UpdateGroup(g *auth.Group) error

type Default

type Default struct {
	auth.Authenticator
}

func NewDefaultAuthenticator

func NewDefaultAuthenticator() *Default

func (*Default) Account

func (d *Default) Account(idOrEmail interface{}) (*auth.Account, error)

func (*Default) AccountGroups

func (d *Default) AccountGroups(listOptions model.ListOptions) (auths *[]auth.Group, err error)

func (*Default) Accounts

func (d *Default) Accounts(listOptions model.ListOptions) (auths *[]auth.Account, err error)

func (*Default) CreateAccount

func (d *Default) CreateAccount(groupId uint64, a *auth.Account) error

func (*Default) CreateGroup

func (d *Default) CreateGroup(g *auth.Group) error

func (*Default) DeleteAccount

func (d *Default) DeleteAccount(a *auth.Account) error

func (*Default) DeleteGroup

func (d *Default) DeleteGroup(groupId uint64) error

func (*Default) EncryptPassword

func (d *Default) EncryptPassword(password string) string

func (*Default) GetDefaultAccounts

func (d *Default) GetDefaultAccounts() []auth.Account

func (*Default) Group

func (d *Default) Group(id uint64) (*auth.Group, error)

func (*Default) Groups

func (d *Default) Groups(listOptions model.ListOptions) (auths *[]auth.Group, err error)

func (*Default) JoinGroup

func (d *Default) JoinGroup(accountId, groupId uint64) error

func (*Default) LeaveGroup

func (d *Default) LeaveGroup(accountId, groupId uint64) error

func (*Default) Login

func (d *Default) Login(a *auth.Account) (string, error)

func (*Default) ModificationAllowed

func (d *Default) ModificationAllowed() bool

func (*Default) UpdateAccount

func (d *Default) UpdateAccount(a *auth.Account) error

func (*Default) UpdateGroup

func (d *Default) UpdateGroup(g *auth.Group) error

type Ldap

type Ldap struct {
	auth.Authenticator
}

func (*Ldap) ModificationAllowed

func (d *Ldap) ModificationAllowed() bool

Jump to

Keyboard shortcuts

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