leshan
leshan copied to clipboard
Ensure that client use same endpoint for a given registration
This was discuss at https://github.com/eclipse-leshan/leshan/issues/1415
So,
Registration.getLastEndpointUsed()is nowRegistration.getEndpointUri()Authorizercheck clients use same server endpoint for a given registration.- now
Authorizeris used inSendHandlerto 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.
@JaroslawLegierski , @cyril2maq, It could be worth to look at this too.