auth

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUpdateRole

func CreateUpdateRole(c *gin.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 *gin.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 *gin.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 *gin.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 *gin.Context)

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

func ListRole

func ListRole(c *gin.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 *gin.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 *gin.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 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"`
}

Jump to

Keyboard shortcuts

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