handlers¶
Index¶
- Variables
- type AsyncResultRequest
- type AuthHandler
- func NewAuthHandler(db *gorm.DB) *AuthHandler
- func (h *AuthHandler) DB() *gorm.DB
- func (h *AuthHandler) GenerateToken(userID string, role string) (string, error)
- func (h *AuthHandler) Login(c *gin.Context)
- func (h *AuthHandler) Me(c *gin.Context)
- func (h *AuthHandler) Register(c *gin.Context)
- type CommandParameter
- type CreateScanRequest
- type EngineTestResult
- type LoginRequest
- type PremiumScanRequest
- type RegisterRequest
- type ResultSubmissionRequest
- type ScanHandler
- func NewScanHandler(ch *amqp.Channel, db *gorm.DB) *ScanHandler
- func (h *ScanHandler) HandleAvailableScans(c *gin.Context)
- func (h *ScanHandler) HandleGetScan(c *gin.Context)
- func (h *ScanHandler) HandleHealthCheck(c *gin.Context)
- func (h *ScanHandler) HandlePremiumGetScan(c *gin.Context)
- func (h *ScanHandler) HandlePremiumScanSubmission(c *gin.Context)
- func (h *ScanHandler) HandleResultSubmission(c *gin.Context)
- func (h *ScanHandler) HandleScanSubmission(c *gin.Context)
- func (h *ScanHandler) HandleUserScans(c *gin.Context)
- type ScanResultItem
- type ScanTaskMessage
- type ScanTaskPayload
Variables¶
var AllowedPremiumTests = func() map[string]bool {
m := make(map[string]bool)
for _, test := range AvailableTestsList {
m[test] = true
}
return m
}()
var AvailableTestsList = []string{
"https", "hsts", "serv-h-a", "csp", "cookie-sec",
"js-obf", "xframe", "permissions-policy", "x-content-type-options",
"referrer-policy", "cross-origin-x",
}
type AsyncResultRequest¶
type AsyncResultRequest struct {
Target string `json:"target"`
TestID string `json:"testId"`
Result EngineTestResult `json:"result"`
}
type AuthHandler¶
func NewAuthHandler¶
func (*AuthHandler) DB¶
func (*AuthHandler) GenerateToken¶
func (*AuthHandler) Login¶
func (*AuthHandler) Me¶
func (*AuthHandler) Register¶
type CommandParameter¶
type CreateScanRequest¶
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 PremiumScanRequest¶
type PremiumScanRequest struct {
TargetURL string `json:"target_url" binding:"required"`
Tests []string `json:"tests" binding:"required,min=1"`
AuthorizedTester bool `json:"authorized_tester"`
}
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¶
func NewScanHandler¶
func (*ScanHandler) HandleAvailableScans¶
func (*ScanHandler) HandleGetScan¶
func (*ScanHandler) HandleHealthCheck¶
func (*ScanHandler) HandlePremiumGetScan¶
func (*ScanHandler) HandlePremiumScanSubmission¶
func (*ScanHandler) HandleResultSubmission¶
func (*ScanHandler) HandleScanSubmission¶
func (*ScanHandler) HandleUserScans¶
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 ScanTaskPayload¶
type ScanTaskPayload struct {
Target string `json:"Target"`
Parameters []CommandParameter `json:"Parameters"`
}
Generated by gomarkdoc