You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Registration we have a way to attach "custom" data.
The idea :
When a client tries to register, a Leshan server could need to call external services to know if client is authorized to register.
This is done in Authorizer. During this authorization step, you could get some data (collected from that services) that you want to attach to registration (kind of optimization to avoid to recall that services later).
publicclassRegistration {
// ... /** * @return Some application data which could have been added at Registration by the {@link Authorizer} */publicMap<String, String> getApplicationData() {
returnapplicationData;
}
// ...
}
/** * This class is responsible to authorize up-link request from LWM2M client. */publicinterfaceAuthorizer {
/** * Return an approved {@link Authorization}, if this request should be handled by the LWM2M Server. when a * declined{@link Authorization} is returned the LWM2M server will stop to handle this request and will respond with * a {@link ResponseCode#FORBIDDEN} or {@link ResponseCode#BAD_REQUEST}. * <p> * Some Application Data could be attached to on approved {@link Authorization} using : * * <pre> * return Authorization.approved(myAppData); * </pre> * * @param request the request received * @param registration the registration linked to the received request.<br> * For register request this is the registration which will be created<br> * For update request this is the registration before the update was done. * @param senderIdentity the {@link Identity} used to send the request. * * @return an {@link Authorization} status. */AuthorizationisAuthorized(UplinkRequest<?> request, Registrationregistration, IdentitysenderIdentity);
}
The issue: ApplicationData is maybe not clear enough, see : #1237 (comment)
Proposed alternatives :
UserData
UserDefinedData
MetaData
What should we do ?
Do you think we should change that name ? or is ApplicationData clear enough ?
If you want to change it let us know which name you prefer ?
(If you want to add more alternatives name let us know too)
Note that this will break the API and maybe the redis serialization but if we think changing the name will make the code clearer, we should not be stopped by this.
The text was updated successfully, but these errors were encountered:
In
Registration
we have a way to attach "custom" data.The idea :
When a client tries to register, a Leshan server could need to call external services to know if client is authorized to register.
This is done in Authorizer. During this authorization step, you could get some data (collected from that services) that you want to attach to registration (kind of optimization to avoid to recall that services later).
(See :#1018 and #1293 and for more details)
Currently this looks like :
The issue:
ApplicationData
is maybe not clear enough, see : #1237 (comment)Proposed alternatives :
UserData
UserDefinedData
MetaData
What should we do ?
Do you think we should change that name ? or is
ApplicationData
clear enough ?If you want to change it let us know which name you prefer ?
(If you want to add more alternatives name let us know too)
Note that this will break the API and maybe the redis serialization but if we think changing the name will make the code clearer, we should not be stopped by this.
The text was updated successfully, but these errors were encountered: