kapua icon indicating copy to clipboard operation
kapua copied to clipboard

No Description Entity Validation

Open zanpizmoht opened this issue 5 years ago • 1 comments

Describe the bug When creating or editing entities like Group, Device or Tag, there is no validation for Description field. The method that is used to create i. e. new Group is create(...) in GroupServiceImpl.java file. There is only validation checking for Name but not for Description also.

To Reproduce Steps to reproduce the behavior:

  1. Try to create or edit new group with update() and create() methods
  2. Set Description value to string that is 256 characters long
  3. Group will be created/edited Same goes for Devices and Tags

Expected behavior Kapua should return KapuaIllegalArgumentException if the Description is too long.

Screenshots /

Version of Kapua 1.2.0

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

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

zanpizmoht avatar Dec 23 '19 14:12 zanpizmoht

After fixing this, please check PR #2886 - uncomment tests "Creating unique Access Group with too long description" and "Editing Access Group description to too long description" in file "service/security/test/src/test/resources/features/GroupServiceUnitTests.feature". I am commeting this here so we don't forget to include the test from PR mentioned.

LeoNerdoG avatar Jun 30 '20 11:06 LeoNerdoG