lapi to capi : allow push of tainted/custom/manual decisions (#1154)

* add console command to control signal sharing
* modify metrics endpoint to add lastpush

Co-authored-by: alteredCoder <kevin@crowdsec.net>
This commit is contained in:
Thibault "bui" Koechlin 2022-01-13 16:46:16 +01:00 committed by GitHub
parent 50fb1e3df1
commit 6e92da76ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 851 additions and 81 deletions

View file

@ -156,10 +156,14 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
gctx.JSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}
if !matched {
continue
}
alert.Decisions = append(alert.Decisions, profileDecisions...)
if len(alert.Decisions) == 0 { // non manual decision
alert.Decisions = append(alert.Decisions, profileDecisions...)
}
profileAlert := *alert
c.sendAlertToPluginChannel(&profileAlert, uint(pIdx))
if profile.OnSuccess == "break" {