leshan icon indicating copy to clipboard operation
leshan copied to clipboard

Ensure that client use same endpoint for a given registration

Open sbernard31 opened this issue 1 year ago • 1 comments

This was discuss at https://github.com/eclipse-leshan/leshan/issues/1415

So,

  • Registration.getLastEndpointUsed() is now Registration.getEndpointUri()
  • Authorizer check clients use same server endpoint for a given registration.
  • now Authorizer is used in SendHandler to check for SEND request too.

The main consequence is that if you persist your registration and re-run Leshan server with different endpoint this could lead to unexpected issue. Like registration can not be reused if the server endpoint doesn't exist anymore or have different Uri.

Typically, if you persist registration and you create your endpoint with a wildcard port number (letting system pick a free port for you) when you will restart the server this will probably lead to issue. But my guess is this is not a real production use cases.

sbernard31 avatar Oct 11 '24 16:10 sbernard31

@JaroslawLegierski , @cyril2maq, It could be worth to look at this too.

sbernard31 avatar Oct 18 '24 09:10 sbernard31