Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHashAndPassword ¶
CompareHashAndPassword receives a plaintext password and its hash, and returns true if they match.
func GenerateRandomToken ¶
GenerateRandomToken generates a random character token.
func HashPassword ¶
HashPassword receives a plaintext password and returns its hashed equivalent.
Types ¶
type DataAccess ¶
type DataAccess interface {
Initialize() error
GroupAddUser(string, string) error
GroupCreate(rest.Group) error
GroupDelete(string) error
GroupExists(string) (bool, error)
GroupGet(string) (rest.Group, error)
GroupGrantRole() error
GroupList() ([]rest.Group, error)
GroupRemoveUser(string, string) error
GroupRevokeRole() error
GroupUpdate(rest.Group) error
GroupUserList(group string) ([]rest.User, error)
GroupUserAdd(group string, user string) error
GroupUserDelete(group string, user string) error
UserAuthenticate(string, string) (bool, error)
UserCreate(rest.User) error
UserDelete(string) error
UserExists(string) (bool, error)
UserGet(string) (rest.User, error)
UserGroupList(user string) ([]rest.Group, error)
UserGroupAdd(user string, group string) error
UserGroupDelete(user string, group string) error
UserList() ([]rest.User, error)
UserUpdate(rest.User) error
TokenEvaluate(token string) bool
TokenGenerate(user string, duration time.Duration) (rest.Token, error)
TokenInvalidate(token string) error
TokenRetrieveByUser(user string) (rest.Token, error)
TokenRetrieveByToken(token string) (rest.Token, error)
}
DataAccess represents a common DataAccessObject, backed either by a database or an in-memory datastore.
Click to show internal directories.
Click to hide internal directories.