Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve create alerts input #493

Merged
merged 4 commits into from
Dec 1, 2020
Merged

Improve create alerts input #493

merged 4 commits into from
Dec 1, 2020

Conversation

erenJag
Copy link
Contributor

@erenJag erenJag commented Dec 1, 2020

  • Here we check in each alert decisions if start_ip & end_ip are valid. Before merging that we need to evaluate if it's less efficient or not.

Example result :

eren@linux ~/crowdsec (improve_createAlerts_input)$ http POST localhost:8080/v1/alerts 'Authorization: Bearer eyJhbGciOiJI.....' < pkg/apiserver/tests/alert_sample.json 
HTTP/1.1 400 Bad Request
Content-Length: 66
Content-Type: application/json; charset=utf-8
Date: Tue, 01 Dec 2020 11:32:08 GMT

{
    "message": "'start_ip' must be lower than 'end_ip' in a decision"
}

pkg/apiserver/controllers/v1/alerts.go Outdated Show resolved Hide resolved
Copy link
Contributor

@buixor buixor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@erenJag erenJag merged commit 71325d9 into master Dec 1, 2020
@erenJag erenJag deleted the improve_createAlerts_input branch December 1, 2020 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants