Documentation
¶
Index ¶
- type EvidenceTemplateHandler
- func (h *EvidenceTemplateHandler) Create(ctx echo.Context) error
- func (h *EvidenceTemplateHandler) Delete(ctx echo.Context) error
- func (h *EvidenceTemplateHandler) Get(ctx echo.Context) error
- func (h *EvidenceTemplateHandler) List(ctx echo.Context) error
- func (h *EvidenceTemplateHandler) Register(apiGroup *echo.Group)
- func (h *EvidenceTemplateHandler) Update(ctx echo.Context) error
- type RiskTemplateHandler
- func (h *RiskTemplateHandler) Create(ctx echo.Context) error
- func (h *RiskTemplateHandler) Delete(ctx echo.Context) error
- func (h *RiskTemplateHandler) Get(ctx echo.Context) error
- func (h *RiskTemplateHandler) List(ctx echo.Context) error
- func (h *RiskTemplateHandler) Register(apiGroup *echo.Group)
- func (h *RiskTemplateHandler) Update(ctx echo.Context) error
- type SubjectTemplateHandler
- func (h *SubjectTemplateHandler) Create(ctx echo.Context) error
- func (h *SubjectTemplateHandler) Get(ctx echo.Context) error
- func (h *SubjectTemplateHandler) List(ctx echo.Context) error
- func (h *SubjectTemplateHandler) Register(apiGroup *echo.Group)
- func (h *SubjectTemplateHandler) Update(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvidenceTemplateHandler ¶
type EvidenceTemplateHandler struct {
// contains filtered or unexported fields
}
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func NewEvidenceTemplateHandler ¶
func NewEvidenceTemplateHandler(sugar *zap.SugaredLogger, db *gorm.DB) *EvidenceTemplateHandler
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) Create ¶
func (h *EvidenceTemplateHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create evidence template
@Description Create an evidence template with selector labels, label schema, and linked risk/subject template IDs.
@Tags Evidence Templates
@Accept json
@Produce json
@Param template body upsertEvidenceTemplateRequest true "Evidence template payload"
@Success 201 {object} evidenceTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/evidence-templates [post]
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) Delete ¶
func (h *EvidenceTemplateHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete evidence template
@Description Delete an evidence template and its associated selector labels, label schema, and join rows.
@Tags Evidence Templates
@Produce json
@Param id path string true "Evidence Template ID"
@Success 204
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/evidence-templates/{id} [delete]
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) Get ¶
func (h *EvidenceTemplateHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get evidence template
@Description Get an evidence template by ID.
@Tags Evidence Templates
@Produce json
@Param id path string true "Evidence Template ID"
@Success 200 {object} evidenceTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/evidence-templates/{id} [get]
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) List ¶
func (h *EvidenceTemplateHandler) List(ctx echo.Context) error
List godoc
@Summary List evidence templates
@Description List evidence templates with optional filters and pagination.
@Tags Evidence Templates
@Produce json
@Param plugin-id query string false "Plugin ID"
@Param policy-package query string false "Policy package"
@Param is-active query bool false "Active flag"
@Param page query int false "Page number"
@Param limit query int false "Page size"
@Success 200 {object} svc.ListResponse[evidenceTemplateResponse]
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/evidence-templates [get]
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) Register ¶
func (h *EvidenceTemplateHandler) Register(apiGroup *echo.Group)
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
func (*EvidenceTemplateHandler) Update ¶
func (h *EvidenceTemplateHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update evidence template
@Description Update an evidence template and atomically replace selector labels, label schema, and linked IDs.
@Tags Evidence Templates
@Accept json
@Produce json
@Param id path string true "Evidence Template ID"
@Param template body upsertEvidenceTemplateRequest true "Evidence template payload"
@Success 200 {object} evidenceTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/evidence-templates/{id} [put]
TODO[codex-review]: Dead code. Consider removing. For Copilot - this is a known issue and the moment the code will be removed is afterwards a full integration test battery. Please ignore review comments related to these methods / this comment
type RiskTemplateHandler ¶
type RiskTemplateHandler struct {
// contains filtered or unexported fields
}
func NewRiskTemplateHandler ¶
func NewRiskTemplateHandler(sugar *zap.SugaredLogger, db *gorm.DB) *RiskTemplateHandler
func (*RiskTemplateHandler) Create ¶
func (h *RiskTemplateHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create risk template
@Description Create a risk template with threat references and remediation template/tasks.
@Tags Risk Templates
@Accept json
@Produce json
@Param template body upsertRiskTemplateRequest true "Risk template payload"
@Success 201 {object} riskTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/risk-templates [post]
func (*RiskTemplateHandler) Delete ¶
func (h *RiskTemplateHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete risk template
@Description Delete a risk template and its associated threat references and remediation data.
@Tags Risk Templates
@Produce json
@Param id path string true "Risk Template ID"
@Success 204
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/risk-templates/{id} [delete]
func (*RiskTemplateHandler) Get ¶
func (h *RiskTemplateHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get risk template
@Description Get a risk template by ID.
@Tags Risk Templates
@Produce json
@Param id path string true "Risk Template ID"
@Success 200 {object} riskTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/risk-templates/{id} [get]
func (*RiskTemplateHandler) List ¶
func (h *RiskTemplateHandler) List(ctx echo.Context) error
List godoc
@Summary List risk templates
@Description List risk templates with optional filters and pagination.
@Tags Risk Templates
@Produce json
@Param plugin-id query string false "Plugin ID"
@Param policy-package query string false "Policy package"
@Param is-active query bool false "Active flag"
@Param page query int false "Page number"
@Param limit query int false "Page size"
@Success 200 {object} svc.ListResponse[riskTemplateResponse]
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/risk-templates [get]
func (*RiskTemplateHandler) Register ¶
func (h *RiskTemplateHandler) Register(apiGroup *echo.Group)
func (*RiskTemplateHandler) Update ¶
func (h *RiskTemplateHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update risk template
@Description Update a risk template and atomically replace threat refs and remediation tasks.
@Tags Risk Templates
@Accept json
@Produce json
@Param id path string true "Risk Template ID"
@Param template body upsertRiskTemplateRequest true "Risk template payload"
@Success 200 {object} riskTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/risk-templates/{id} [put]
type SubjectTemplateHandler ¶
type SubjectTemplateHandler struct {
// contains filtered or unexported fields
}
func NewSubjectTemplateHandler ¶
func NewSubjectTemplateHandler(sugar *zap.SugaredLogger, db *gorm.DB) *SubjectTemplateHandler
func (*SubjectTemplateHandler) Create ¶
func (h *SubjectTemplateHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create subject template
@Description Create a subject template with selector labels and label schema.
@Tags Subject Templates
@Accept json
@Produce json
@Param template body upsertSubjectTemplateRequest true "Subject template payload"
@Success 201 {object} subjectTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/subject-templates [post]
func (*SubjectTemplateHandler) Get ¶
func (h *SubjectTemplateHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get subject template
@Description Get a subject template by ID.
@Tags Subject Templates
@Produce json
@Param id path string true "Subject Template ID"
@Success 200 {object} subjectTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/subject-templates/{id} [get]
func (*SubjectTemplateHandler) List ¶
func (h *SubjectTemplateHandler) List(ctx echo.Context) error
List godoc
@Summary List subject templates
@Description List subject templates with optional filters and pagination.
@Tags Subject Templates
@Produce json
@Param type query string false "Subject type"
@Param source-mode query string false "Source mode"
@Param page query int false "Page number"
@Param limit query int false "Page size"
@Success 200 {object} svc.ListResponse[subjectTemplateResponse]
@Failure 400 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/subject-templates [get]
func (*SubjectTemplateHandler) Register ¶
func (h *SubjectTemplateHandler) Register(apiGroup *echo.Group)
func (*SubjectTemplateHandler) Update ¶
func (h *SubjectTemplateHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update subject template
@Description Update a subject template and atomically replace selector labels and label schema.
@Tags Subject Templates
@Accept json
@Produce json
@Param id path string true "Subject Template ID"
@Param template body upsertSubjectTemplateRequest true "Subject template payload"
@Success 200 {object} subjectTemplateDataResponse
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /admin/subject-templates/{id} [put]