Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingFields = fmt.Errorf("not all fields are provided") ErrInvalidOrgnName = fmt.Errorf("organization name does not follow policies") ErrWrongCredentials = fmt.Errorf("user credentials are not matching with db record") ErrInvalidJWT = fmt.Errorf("jwt is no longer valid") ErrJWTParse = fmt.Errorf("could not parse jwt token") ErrCorruptJWT = fmt.Errorf("jwt could not be parsed (JWT might be corrupted)") ErrExpiredJWT = fmt.Errorf("provided JWT has expired") )
Functions ¶
This section is empty.
Types ¶
type AuthedUser ¶
func LoggedIn ¶
func LoggedIn(accessToken string) (*AuthedUser, error)
type User ¶
type User struct { Uuid string `bson:"_id"` Username string `bson:"username" required:"yes"` Organization string `bson:"organization" required:"yes"` Password string `bson:"password"` }
func NewDefaultUser ¶
func (User) AccessToken ¶
AccessToken generates a JWT based on the User information
func (User) Credentials ¶
func (*User) HashAndSalt ¶
HashAndSalt hashes the plain text user password
Click to show internal directories.
Click to hide internal directories.