account

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(broker brokerLib.IBroker, databaseRead SQL.InterfaceRead,
	databaseWrite SQL.InterfaceWrite, cache cacheRepository.Interface, appConfig *app.Config) *Handler

func (*Handler) ChangePassword added in v1.3.0

func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)

@Tags Account @Description change password! @ID change-password @Accept json @Produce json @Param password body string true "new password" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/change-password [post] @Security ApiKeyAuth

func (*Handler) CreateAccount added in v1.3.0

func (h *Handler) CreateAccount(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Create a new account! @ID create-account @Accept json @Produce json @Param CreateAccount body dto.CreateAccount true "create account info" @Success 201 {object} http.Response{content=string} "STATUS CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/create-account [post]

func (*Handler) CreateAccountFromKeycloak

func (h *Handler) CreateAccountFromKeycloak(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Create a new account with keycloak data! @ID create-account-keycloak @Accept json @Produce json @Param KeycloakToken body dto.KeycloakToken true "keycloak token info" @Success 200 {object} http.Response{content=dto.CreateAccountFromKeycloakResponse} "STATUS OK" @Success 201 {object} http.Response{content=string} "STATUS CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/create-account-from-keycloak [post]

func (*Handler) DeleteAccount added in v1.3.0

func (h *Handler) DeleteAccount(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Delete account and all permissions! @ID delete-account @Accept json @Produce json @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/delete [delete] @Security ApiKeyAuth

func (*Handler) Logout added in v1.3.0

func (h *Handler) Logout(w http.ResponseWriter, r *http.Request)

@Tags Account @Description logout! @ID logout @Accept json @Produce json @Success 200 {object} http.Response{content=string} "NO CONTENT" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/logout [post] @Security ApiKeyAuth

func (*Handler) Options

func (h *Handler) Options(w http.ResponseWriter, _ *http.Request)

func (*Handler) RenewToken added in v1.3.0

func (h *Handler) RenewToken(w http.ResponseWriter, r *http.Request)

@Tags Account @Description renew token! @ID renew-token @Accept json @Produce json @Param refreshToken body string true "refresh token" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Router /auth/account/renew-token [post] @Security ApiKeyAuth

func (*Handler) SendResetPasswordCode added in v1.3.0

func (h *Handler) SendResetPasswordCode(w http.ResponseWriter, r *http.Request)

@Tags Account @Description send reset password code! @ID reset-password-code @Accept json @Produce json @Param EmailData body dto.EmailData true "reset password email info" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/send-code [post]

func (*Handler) Update added in v1.3.0

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Update account username and/or email @ID update-account @Accept json @Produce json @Param UpdateAccount body dto.UpdateAccount true "update account info" @Success 200 {object} http.Response{content=string} "OK" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/update [patch] @Security ApiKeyAuth

func (*Handler) ValidateEmail added in v1.3.0

func (h *Handler) ValidateEmail(w http.ResponseWriter, r *http.Request)

@Tags Account @Description validate email! @ID validate-email @Accept json @Produce json @Param accountID path string true "accountID of the account" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/validate/{accountID} [get]

func (*Handler) ValidateResetPasswordCode added in v1.3.0

func (h *Handler) ValidateResetPasswordCode(w http.ResponseWriter, r *http.Request)

@Tags Account @Description validate reset password code! @ID validate-password-code @Accept json @Produce json @Param ResetCodeData body dto.ResetCodeData true "reset password data info" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/validate-code [post]

func (*Handler) VerifyAlreadyInUse added in v1.3.0

func (h *Handler) VerifyAlreadyInUse(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Verify if email and username already in use! @ID validate-unique @Accept json @Produce json @Param ValidateUnique body dto.ValidateUnique true "validate unique info" @Success 201 {object} http.Response{content=string} "STATUS CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /auth/account/verify-already-used [post]

Jump to

Keyboard shortcuts

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