Skip to content

handlers

import "github.com/prawo-i-piesc/backend/internal/handlers"

Index

type AsyncResultRequest

type AsyncResultRequest struct {
    Target string           `json:"target"`
    TestID string           `json:"testId"`
    Result EngineTestResult `json:"result"`
}

type AuthHandler

type AuthHandler struct {
    db *gorm.DB
}

func NewAuthHandler

func NewAuthHandler(db *gorm.DB) *AuthHandler

func (*AuthHandler) GenerateToken

func (h *AuthHandler) GenerateToken(userID string) (string, error)

func (*AuthHandler) Login

func (h *AuthHandler) Login(c *gin.Context)

func (*AuthHandler) Me

func (h *AuthHandler) Me(c *gin.Context)

func (*AuthHandler) Register

func (h *AuthHandler) Register(c *gin.Context)

type CommandParameter

type CommandParameter struct {
    Name      string   `json:"Name"`
    Arguments []string `json:"Arguments"`
}

type CreateScanRequest

type CreateScanRequest struct {
    TargetURL string `json:"target_url" binding:"required"`
}

type EngineTestResult

type EngineTestResult struct {
    Name        string      `json:"Name"`
    Certainty   int         `json:"Certainty"`
    ThreatLevel string      `json:"ThreatLevel"`
    Metadata    interface{} `json:"Metadata"`
    Description string      `json:"Description"`
}

type LoginRequest

type LoginRequest struct {
    Email    string `json:"email" binding:"required,email"`
    Password string `json:"password" binding:"required,min=8"`
}

type RegisterRequest

type RegisterRequest struct {
    FullName string `json:"full_name" binding:"required"`
    Email    string `json:"email" binding:"required,email"`
    Password string `json:"password" binding:"required,min=8"`
}

type ResultSubmissionRequest

type ResultSubmissionRequest struct {
    ScanID      string           `json:"scan_id" binding:"required,uuid"`
    Status      string           `json:"status" binding:"required,oneof=COMPLETED FAILED"`
    StartedAt   time.Time        `json:"started_at" binding:"required"`
    CompletedAt time.Time        `json:"completed_at" binding:"required"`
    Results     []ScanResultItem `json:"results" binding:"required,dive"`
}

type ScanHandler

type ScanHandler struct {
    amqpChannel *amqp.Channel
    db          *gorm.DB
}

func NewScanHandler

func NewScanHandler(ch *amqp.Channel, db *gorm.DB) *ScanHandler

func (*ScanHandler) HandleGetScan

func (h *ScanHandler) HandleGetScan(c *gin.Context)

func (*ScanHandler) HandleHealthCheck

func (h *ScanHandler) HandleHealthCheck(c *gin.Context)

func (*ScanHandler) HandleResultSubmission

func (h *ScanHandler) HandleResultSubmission(c *gin.Context)

func (*ScanHandler) HandleScanSubmission

func (h *ScanHandler) HandleScanSubmission(c *gin.Context)

type ScanResultItem

type ScanResultItem struct {
    TestID      string `json:"test_id" binding:"required"`
    TestName    string `json:"test_name" binding:"required"`
    Category    string `json:"category" binding:"required"`
    Severity    string `json:"severity" binding:"required"`
    Passed      bool   `json:"passed"`
    Message     string `json:"message"`
    Reference   string `json:"reference"`
    Remediation string `json:"remediation"`
}

type ScanTaskMessage

type ScanTaskMessage struct {
    ID        string `json:"id"`
    TargetURL string `json:"target_url"`
}

type ScanTaskPayload

type ScanTaskPayload struct {
    Target     string             `json:"Target"`
    Parameters []CommandParameter `json:"Parameters"`
}

Generated by gomarkdoc