Uninett / Argus

Argus is an alert aggregator for monitoring systems
GNU General Public License v3.0
18 stars 12 forks source link

Ensure source systems may not send Event.Type.INCIDENT_START events #751

Open hmpf opened 2 months ago

hmpf commented 2 months ago

INCIDENT_START is created by the backend when it receives a new incident and should not be created by any other process.

Needed:

.. plus eventual surprises..

This is really a case where making the test first is a good way to proceed!

hmpf commented 2 months ago

.. it might be useful to have a readonly endpoint that shows which event types are available for use with the API for the logged-in user.

johannaengland commented 2 months ago

While I am at it: Should it be allowed to post stateless events? Because when creating a stateless incident a stateless event is automatically created.

johannaengland commented 2 months ago

And I was also thinking: Why should we explicitly forbid source systems to send start events? Because currently when encountering an event that doesn't fit (e.g. a start event, a double reopen, ...) we simply register the event without it influencing the incidents (see https://github.com/Uninett/Argus/blob/master/src/argus/incident/views.py#L507-L517). Why do we need to change this?