OpenLEADR/openleadr-python

Client should check the ven_id in _on_event

juantxorena opened this issue · 1 comments

IMHO the default implementation of _on_event should check if the venID of the received event matches the one of the client, and optOut the event if it doesn't. This can be done on the user's implementation of on_event, but I don't see any use case where this check doesn't make sense.

In addition, when this happens, it should respond with a 462 response code. It looks like the _on_event method only responds with 200, which is wrong.

Actually the VEN should respond with a 462 also when the resourceID doesn't match. This can only be done in the on_event implementation, but AFAIK it will always answer with a 200, so we should have the option of choosing which response to use for each event.