eclipse / kapua

Eclipse Public License 2.0
225 stars 160 forks source link

Permitted Symbols In Devices -> Configuration -> RestService #2211

Open LeoNerdoG opened 5 years ago

LeoNerdoG commented 5 years ago

If user enters certain symbols into user.name or roles fields in Devices -> Configuration -> RestService, Kapua replaces them with question marks ("?") and after saving the changes user goes back to these fields, all of them are in error state, wich is ok, but they shoul be in error state earlier when the symbols are first inserted into these fields.

Testflow:

  1. Login as kapua-sys or any other user that has proper permission
  2. Connect a live Kura device to Kapua (e.g. device0)
  3. In Kapua go to Devices, select device0 and go to its Configuration -> RestService
  4. Enter 255 special symbols (e.g. @‹›€ı–°·Œ„‰“‘”’ÉÎÏÌÓ◊ш¯È) into all 9 fields and save changes Refresh the Configuration tab and return to RestService. Observe the fields that are in error state.

Expected behavior Kapua should report an error prior to saving the changes, otherwise all the special symbols are replaced with question marks.

Screenshot No. 1: screenshot 2018-11-27 at 09 46 30

Screenshot No. 2: screenshot 2018-11-27 at 09 36 38

Version of Kapua 1.1.0-SNAPSHOT

Type of deployment [ ] Local Vagrant deployment [x] Docker [ ] Openshift (in its variants) [ ] Others

Main component affected [x] Console (in case of console please report info on which browser you encountered the problem) [ ] REST API [ ] Message Broker [ ] - Others

Browsers used:

ct-anaalbic commented 5 years ago

Hi @lorthirk in this issue, some special symbols are problem, because Kapua replaces them with question marks ("?"), and after changes are saved, fields are in error state. My solution is to set some regular expression on this fields. Maybe we can allow some characters, and some characters can be forbidden. This kind of regex already exists, and maybe we can apply it. What is your opinion about this? Is this acceptable solution?

Thank you. Regards, Ana

lorthirk commented 5 years ago

Does this happen with any service with textboxes or just with the RestService?