Documentation ¶
Index ¶
- func BasicAuthModule(c *gin.Context)
- func CheckOTP(username string, otp string) bool
- func CreateClusterTask(c *gin.Context)
- func CreateModuleTask(c *gin.Context)
- func CreateNodeTask(c *gin.Context)
- func Del2FAStatus(c *gin.Context)
- func Get2FAStatus(c *gin.Context)
- func GetAudits(c *gin.Context)
- func GetAuditsActions(c *gin.Context)
- func GetAuditsUsers(c *gin.Context)
- func GetClusterTaskContext(c *gin.Context)
- func GetClusterTaskFiles(c *gin.Context)
- func GetClusterTasks(c *gin.Context)
- func GetModuleTaskContext(c *gin.Context)
- func GetModuleTaskFiles(c *gin.Context)
- func GetModuleTasks(c *gin.Context)
- func GetModules(c *gin.Context)
- func GetNodeTaskContext(c *gin.Context)
- func GetNodeTaskFiles(c *gin.Context)
- func GetNodeTasks(c *gin.Context)
- func GetNodes(c *gin.Context)
- func Needs2faCheck(username string) bool
- func QRCode(c *gin.Context)
- func RedisAuthentication(username string, password string) error
- func RedisAuthorization(username string, c *gin.Context) (models.UserAuthorizations, error)
- func RedisLive() bool
- func Set2FAStatus(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthModule ¶
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 CreateClusterTask ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 QRCode ¶
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 RedisAuthorization ¶
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 Set2FAStatus ¶
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.