Implement CrowdSec Decision Test Infrastructure

- Added integration test script `crowdsec_decision_integration.sh` for verifying CrowdSec decision management functionality.
- Created QA report for the CrowdSec decision management integration test infrastructure, detailing file verification, validation results, and overall status.
- Included comprehensive test cases for starting CrowdSec, managing IP bans, and checking API responses.
- Ensured proper logging, error handling, and cleanup procedures within the test script.
- Verified syntax, security, and functionality of all related files.
This commit is contained in:
GitHub Actions
2025-12-12 20:33:41 +00:00
parent 9ad3afbd22
commit 7da24a2ffb
10 changed files with 1514 additions and 29 deletions
@@ -899,7 +899,8 @@ type lapiDecision struct {
// - type: filter by decision type (e.g., "ban", "captcha")
func (h *CrowdsecHandler) GetLAPIDecisions(c *gin.Context) {
// Get LAPI URL from security config or use default
lapiURL := "http://localhost:8080"
// Default port is 8085 to avoid conflict with Charon management API on port 8080
lapiURL := "http://127.0.0.1:8085"
if h.Security != nil {
cfg, err := h.Security.Get()
if err == nil && cfg != nil && cfg.CrowdSecAPIURL != "" {
@@ -1042,7 +1043,8 @@ func getLAPIKey() string {
// CheckLAPIHealth verifies that CrowdSec LAPI is responding.
func (h *CrowdsecHandler) CheckLAPIHealth(c *gin.Context) {
// Get LAPI URL from security config or use default
lapiURL := "http://localhost:8080"
// Default port is 8085 to avoid conflict with Charon management API on port 8080
lapiURL := "http://127.0.0.1:8085"
if h.Security != nil {
cfg, err := h.Security.Get()
if err == nil && cfg != nil && cfg.CrowdSecAPIURL != "" {