drogue-iot / drogue-cloud

Cloud Native IoT
https://drogue.io
Apache License 2.0
113 stars 30 forks source link

Consider allowing in process of deletion to receive commands/send data #324

Open lulf opened 1 year ago

lulf commented 1 year ago

A useful pattern when writing Drogue Cloud extensions is to hook into the lifecycle of devices: when device is created, an operator can detect that and send commands to a device for it to 'initialize'.

The operator can add itself to finalizers for the device to ensure it can follow some process when the device is being deleted. This can be sending some command to the device, and also expecting some confirmation message back from the device, before the operator removes itself from the finalizers.

At present, the authentication service considers devices under deletion as unauthenticated, which prevents the above shutdown process. Changing this policy to allow devices under deletion to authenticate would allow extensions to hook into the 'shutdown lifecycle' of a device.