methods

package
v0.0.0-...-66da4ae Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthModule

func BasicAuthModule(c *gin.Context)

BasicAuthModule godoc @Summary Use Basic HTTP auth for module @Description for a specific action, check basic auth for module @Produce json @Header 200 {string} Authorization "Basic base64(username:password)" @Success 200 {object} response.StatusOK{code=int,message=string,data=object} @Failure 401 {object} response.StatusUnauthorized{code=int,message=string,data=object} @Failure 403 {object} response.StatusForbidden{code=int,message=string,data=object} @Router /module/{module_id}/http-basic/{action} [get] @Tags /module basic_auth

func CheckOTP

func CheckOTP(username string, otp string) bool

CheckOTP godoc @Summary Check if OTP validates for the given username

func CreateClusterTask

func CreateClusterTask(c *gin.Context)

CreateClusterTask godoc @Summary Create and queue a cluster task @Description create a cluster task @Produce json @Param payload body models.TaskJSON true "Task Payload" @Success 200 {object} response.StatusCreated{code=int,message=string,data=models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /cluster/tasks [post] @Tags /tasks cluster

func CreateModuleTask

func CreateModuleTask(c *gin.Context)

CreateModuleTask godoc @Summary Create and queue a module task @Description create a module task @Produce json @Param module_id path string true "Module ID" @Param payload body models.TaskJSON true "Task Payload" @Success 200 {object} response.StatusCreated{code=int,message=string,data=models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /module/{module_id}/tasks [post] @Tags /tasks module

func CreateNodeTask

func CreateNodeTask(c *gin.Context)

CreateNodeTask godoc @Summary Create and queue a node task @Description create a node task @Produce json @Param node_id path string true "Node ID" @Param payload body models.TaskJSON true "Task Payload" @Success 200 {object} response.StatusCreated{code=int,message=string,data=models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /node/{node_id}/tasks [post] @Tags /tasks node

func Del2FAStatus

func Del2FAStatus(c *gin.Context)

Del2FAStatus godoc @Summary Revocate secret for 2FA @Description revocate secret for 2FA @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=object} @Failure 500 {object} response.StatusInternalServerError{code=int,message=string,data=object} @Router /2FA [delete] @Tags /2FA auth

func Get2FAStatus

func Get2FAStatus(c *gin.Context)

Get2FAStatus godoc @Summary Get current 2FA status for user @Description get current 2FA status for user @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=object} @Failure 500 {object} response.StatusInternalServerError{code=int,message=string,data=object} @Router /2FA [get] @Tags /2FA auth

func GetAudits

func GetAudits(c *gin.Context)

GetAudits godoc @Summary Get audit logs for user, action and timestamp @Description get audit logs (user, action, data, timestamp) @Produce json @Param user query string false "user search by user" @Param action query string false "action search by action" @Param data query string false "data full text search by data" @Param from query string false "filter result search by from date ISO8601" @Param to query string false "filter result search by to date ISO8601" @Param limit query string false "limit results to limit value" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /audit [get] @Tags /audit audit

func GetAuditsActions

func GetAuditsActions(c *gin.Context)

GetAuditsActions godoc @Summary Get all actions in audit.db @Description get audit actions @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /audit/actions [get] @Tags /audit audit

func GetAuditsUsers

func GetAuditsUsers(c *gin.Context)

GetAuditsUsers godoc @Summary Get all users in audit.db @Description get audit users @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /audit/users [get] @Tags /audit audit

func GetClusterTaskContext

func GetClusterTaskContext(c *gin.Context)

GetClusterTaskContext godoc @Summary Get the context of a cluster task @Description get task statuses (context) @Produce json @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /cluster/task/{task_id}/context [get] @Tags /tasks cluster

func GetClusterTaskFiles

func GetClusterTaskFiles(c *gin.Context)

GetClusterTaskFiles godoc @Summary Get the output, error or exit code of a cluster task @Description get task statuses (output, error, exit_code) @Produce json @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /cluster/task/{task_id}/status [get] @Tags /tasks cluster

func GetClusterTasks

func GetClusterTasks(c *gin.Context)

GetClusterTasks godoc @Summary Get the list of current cluster tasks @Description get cluster tasks @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=[]models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /cluster/tasks [get] @Tags /tasks cluster

func GetModuleTaskContext

func GetModuleTaskContext(c *gin.Context)

GetModuleTaskContext godoc @Summary Get the context of a module task @Description get task statuses (context) @Produce json @Param module_id path string true "Module ID" @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /module/{module_id}/task/{task_id}/context [get] @Tags /tasks module

func GetModuleTaskFiles

func GetModuleTaskFiles(c *gin.Context)

GetModuleTaskFiles godoc @Summary Get the output, error or exit code of a module task @Description get task statuses (output, error, exit_code) @Produce json @Param module_id path string true "Module ID" @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /module/{module_id}/task/{task_id}/status [get] @Tags /tasks module

func GetModuleTasks

func GetModuleTasks(c *gin.Context)

GetModuleTasks godoc @Summary Get the list of current module tasks @Description get module tasks @Produce json @Param module_id path string true "Module ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=[]models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /module/{module_id}/tasks [get] @Tags /tasks module

func GetModules

func GetModules(c *gin.Context)

GetModules godoc @Summary Get the list of modules @Description get modules @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=[]string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /modules [get] @Tags /tasks node

func GetNodeTaskContext

func GetNodeTaskContext(c *gin.Context)

GetNodeTaskContext godoc @Summary Get the context of a node task @Description get task statuses (context) @Produce json @Param node_id path string true "Node ID" @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /node/{node_id}/task/{task_id}/context [get] @Tags /tasks node

func GetNodeTaskFiles

func GetNodeTaskFiles(c *gin.Context)

GetNodeTaskFiles godoc @Summary Get the output, error or exit code of a node task @Description get task statuses (output, error, exit_code) @Produce json @Param node_id path string true "Node ID" @Param task_id path string true "Task ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /node/{node_id}/task/{task_id}/status [get] @Tags /tasks node

func GetNodeTasks

func GetNodeTasks(c *gin.Context)

GetNodeTasks godoc @Summary Get the list of current node tasks @Description get node tasks @Produce json @Param node_id path string true "Node ID" @Success 200 {object} response.StatusOK{code=int,message=string,data=[]models.Task} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /node/{node_id}/tasks [get] @Tags /tasks node

func GetNodes

func GetNodes(c *gin.Context)

GetNodes godoc @Summary Get the list of nodes @Description get nodes @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=[]string} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /nodes [get] @Tags /tasks node

func Needs2faCheck

func Needs2faCheck(username string) bool

func QRCode

func QRCode(c *gin.Context)

QRCode godoc @Summary Generate QRCode for 2FA @Description use this API to generate a valid qr-code for google auth @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=object} @Failure 500 {object} response.StatusInternalServerError{code=int,message=string,data=object} @Router /2FA/qrcode [get] @Tags /2FA/qrcode auth

func RedisAuthentication

func RedisAuthentication(username string, password string) error

func RedisAuthorization

func RedisAuthorization(username string, c *gin.Context) (models.UserAuthorizations, error)

RedisAuthorization godoc @Summary Login and remove JWT token @Description logout and remove JWT token @Produce json @Success 200 {object} response.StatusOK{code=int} @Header 200 {string} Authorization "Bearer <valid.JWT.token>" @Failure 500 {object} response.StatusInternalServerError{code=int,message=string,data=object} @Router /logout [post] @Tags /logout auth

func RedisLive

func RedisLive() bool

func Set2FAStatus

func Set2FAStatus(c *gin.Context)

Set2FAStatus godoc @Summary Set the 2FA Redis flag, if OTP is verified @Produce json @Success 200 {object} response.StatusOK{code=int,message=string,data=object} @Failure 400 {object} response.StatusBadRequest{code=int,message=string,data=object} @Router /2FA [post] @Tags /2FA auth

Types

This section is empty.

Jump to

Keyboard shortcuts

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