Documentation ¶
Index ¶
- Variables
- func NewLDAPCache(config *store.LDAPConfig) store.Cache
- func NewLDAPChecker(config *store.LDAPConfig) common.PasswordChecker
- func RegisterAPI(opts Options) *mux.Router
- type Details
- type Options
- type Registry
- func (u *Registry) BcryptChecker() common.PasswordChecker
- func (u *Registry) Delete(username string) error
- func (u *Registry) Get(username string) (*Details, error)
- func (u *Registry) LoadFromJSON(r io.Reader) error
- func (u *Registry) PlainTextChecker() common.PasswordChecker
- func (u *Registry) Put(user *Details) error
- func (u *Registry) SaveToJSON(w io.Writer) error
- type State
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidUser = errors.New("invalid user")
)
Common Errors
var (
ErrNotFound = errors.New("not found")
)
Errors
Functions ¶
func NewLDAPCache ¶ added in v0.1.0
func NewLDAPCache(config *store.LDAPConfig) store.Cache
NewLDAPCache returns a cache suitable for interacting with LDAP
func NewLDAPChecker ¶ added in v0.1.0
func NewLDAPChecker(config *store.LDAPConfig) common.PasswordChecker
NewLDAPChecker returns a password checker using LDAP
func RegisterAPI ¶
RegisterAPI returns a router for the api.
Types ¶
type Details ¶
type Details struct { ID uint64 `json:"id"` Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` Name string `json:"name"` State State `json:"state"` }
Details describes the user details
type Registry ¶ added in v0.0.7
type Registry struct {
// contains filtered or unexported fields
}
Registry maintains the known users
func NewRegistry ¶ added in v0.0.7
NewRegistry returns an initialized UserRegistry
func (*Registry) BcryptChecker ¶ added in v0.0.7
func (u *Registry) BcryptChecker() common.PasswordChecker
BcryptChecker creates in implementation of common.Checker that uses bcrypt to verify password against the password field in the user details
func (*Registry) Get ¶ added in v0.0.7
Get returns a user registration by username, or an error if not found
func (*Registry) LoadFromJSON ¶ added in v0.0.7
LoadFromJSON loads users encoded in JSON
func (*Registry) PlainTextChecker ¶ added in v0.0.7
func (u *Registry) PlainTextChecker() common.PasswordChecker
PlainTextChecker creates in implementation of common.Checker that uses simple text comparison to verify password against the plain text password field in the user details