auth

package
v1.0.0-beta8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUpdateRole

func CreateUpdateRole(c zhttp.Context)

@Id CreateRole @Summary Create role @security BasicAuth @Tags Role @Accept json @Produce json @Param role body meta.Role true "Role data" @Success 200 {object} meta.HTTPResponseID @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/role [post]

func CreateUpdateUser

func CreateUpdateUser(c zhttp.Context)

@Id CreateUser @Summary Create user @security BasicAuth @Tags User @Accept json @Produce json @Param user body meta.User true "User data" @Success 200 {object} meta.HTTPResponseID @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/user [post]

func DeleteRole

func DeleteRole(c zhttp.Context)

@Id DeleteRole @Summary Delete role @security BasicAuth @Tags Role @Produce json @Param id path string true "Role id" @Success 200 {object} meta.HTTPResponseID @Success 500 {object} meta.HTTPResponseError @Router /api/role/{id} [delete]

func DeleteUser

func DeleteUser(c zhttp.Context)

@Id DeleteUser @Summary Delete user @security BasicAuth @Tags User @Produce json @Param id path string true "User id" @Success 200 {object} meta.HTTPResponseID @Success 500 {object} meta.HTTPResponseError @Router /api/user/{id} [delete]

func ListPermissions

func ListPermissions(c zhttp.Context)

@Id ListPermissions @Summary List permissions @security BasicAuth @Tags Permission @Produce json @Success 200 {object} []string @Router /api/permissions [get]

func ListRole

func ListRole(c zhttp.Context)

@Id ListRoles @Summary List role @security BasicAuth @Tags Role @Produce json @Success 200 {object} []meta.Role @Failure 500 {object} meta.HTTPResponseError @Router /api/role [get]

func ListUser

func ListUser(c zhttp.Context)

@Id ListUsers @Summary List user @security BasicAuth @Tags User @Produce json @Success 200 {object} []meta.User @Failure 500 {object} meta.HTTPResponseError @Router /api/user [get]

func Login

func Login(c zhttp.Context)

@Id Login @Summary Login @Tags User @Accept json @Produce json @Param login body LoginRequest true "Login credentials" @Success 200 {object} LoginResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/login [post]

func UpdateAccount

func UpdateAccount(c zhttp.Context)

@Id UpdateAccount @Summary Update own name and/or password @Tags User @Accept json @Produce json @Param account body UpdateAccountRequest true "Current password plus new name and/or new password" @Success 200 {object} LoginUser @Failure 400 {object} meta.HTTPResponseError @Failure 401 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/account [put]

func UpdateForSDK

func UpdateForSDK()

@Id UpdateUser @Summary Update user @security BasicAuth @Tags User @Accept json @Produce json @Param user body meta.User true "User data" @Success 200 {object} meta.HTTPResponseID @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/user [put]

Types

type LoginRequest

type LoginRequest struct {
	ID       string `json:"_id"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Validated bool      `json:"validated"`
	User      LoginUser `json:"user"`
}

type LoginUser

type LoginUser struct {
	ID   string `json:"_id"`
	Name string `json:"name"`
	Role string `json:"role"`
}

type UpdateAccountRequest

type UpdateAccountRequest struct {
	ID          string `json:"_id"`
	Password    string `json:"password"`
	Name        string `json:"name,omitempty"`
	NewPassword string `json:"new_password,omitempty"`
}

Jump to

Keyboard shortcuts

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