Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
compares a plain text password with a hash and returns true for matches otherwise false
func HashPassword ¶
generates an encrypted password
Types ¶
type RoleType ¶
type RoleType int
RoleType defines role for a User
type User ¶
type User struct { ID string `json:"_id"` Name string `json:"name" binding:"required"` Password string `json:"password" binding:"required"` Email string `json:"email,omitempty"` Role string `json:"role"` Type string `json:"type"` }
User is basic authentication information
func (*User) AuthMiddleware ¶
func (u *User) AuthMiddleware(bucket string, d ds.DataSource) *jwt.GinJWTMiddleware
AuthMiddleware initializes our jwt components
func (*User) BootstrapUsers ¶
func (u *User) BootstrapUsers(defaultuser *string, d ds.DataSource) error
add a user named 'bfpdadmin' with ADMIN role
Click to show internal directories.
Click to hide internal directories.