Documentation ¶
Index ¶
- type Handlers
- func (h *Handlers) BasicAuth(next http.Handler) http.Handler
- func (h *Handlers) CheckAvailability(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) GetProfile(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) InjectUserID(next http.Handler) http.Handler
- func (h *Handlers) Login(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) OauthCallback(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) OauthRedirect(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) RegisterUser(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) RequireLogin(next http.Handler) http.Handler
- func (h *Handlers) UpdatePassword(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) UpdateProfile(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) VerifyEmail(w http.ResponseWriter, r *http.Request)
- type OauthState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers represents a group of http handlers in charge of handling users operations.
func NewHandlers ¶
func NewHandlers(userManager hub.UserManager, cfg *viper.Viper) *Handlers
NewHandlers creates a new Handlers instance.
func (*Handlers) CheckAvailability ¶
func (h *Handlers) CheckAvailability(w http.ResponseWriter, r *http.Request)
CheckAvailability is an http handler that checks the availability of a given value for the provided resource kind.
func (*Handlers) GetProfile ¶
func (h *Handlers) GetProfile(w http.ResponseWriter, r *http.Request)
GetProfile is an http handler used to get a logged in user profile.
func (*Handlers) InjectUserID ¶
InjectUserID is a middleware that injects the id of the user doing the request into the request context when a valid session id is provided.
func (*Handlers) Login ¶
func (h *Handlers) Login(w http.ResponseWriter, r *http.Request)
Login is an http handler used to log a user in.
func (*Handlers) Logout ¶
func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)
Logout is an http handler used to log a user out.
func (*Handlers) OauthCallback ¶
func (h *Handlers) OauthCallback(w http.ResponseWriter, r *http.Request)
OauthCallback is an http handler in charge of completing the oauth authentication process, registering the user if needed.
func (*Handlers) OauthRedirect ¶
func (h *Handlers) OauthRedirect(w http.ResponseWriter, r *http.Request)
OauthRedirect is an http handler that redirects the user to the oauth provider to proceed with the authorization.
func (*Handlers) RegisterUser ¶
func (h *Handlers) RegisterUser(w http.ResponseWriter, r *http.Request)
RegisterUser is an http handler used to register a user in the hub database.
func (*Handlers) RequireLogin ¶
RequireLogin is a middleware that verifies if a user is logged in.
func (*Handlers) UpdatePassword ¶
func (h *Handlers) UpdatePassword(w http.ResponseWriter, r *http.Request)
UpdatePassword is an http handler used to update the password in the hub database.
func (*Handlers) UpdateProfile ¶
func (h *Handlers) UpdateProfile(w http.ResponseWriter, r *http.Request)
UpdateProfile is an http handler used to update the user in the hub database.
func (*Handlers) VerifyEmail ¶
func (h *Handlers) VerifyEmail(w http.ResponseWriter, r *http.Request)
VerifyEmail is an http handler used to verify a user's email address.
type OauthState ¶
OauthState represents the state of an oauth authorization session, used to increase the security of the process and to restore the state of the application.
func NewOauthState ¶
func NewOauthState(s string) (*OauthState, error)
NewOauthState creates a new OauthState instance from the string representation provided.
func (*OauthState) String ¶
func (s *OauthState) String() string
String returns an OauthState instance as a string.