user

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

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) BasicAuth

func (h *Handlers) BasicAuth(next http.Handler) http.Handler

BasicAuth is a middleware that provides basic auth support.

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

func (h *Handlers) InjectUserID(next http.Handler) http.Handler

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

func (h *Handlers) RequireLogin(next http.Handler) http.Handler

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

type OauthState struct {
	Random      string
	RedirectURL string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL