telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 85 forks source link

Fix Service Header to use upper case value #1613

Closed Madhu1029 closed 3 months ago

Madhu1029 commented 4 months ago

Fixes #1528. Now, uppercase value can also be used for service header in case of update and delete.

fgalan commented 3 months ago

Note the merge conflict. It should be easy to solve, just adding the existing and new lines.

mapedraza commented 3 months ago

The PR looks good, thank you so much for your contribution. Being said that, I have a couple of comments:

  1. it would be great if you could add a test to prove it works propperly. It should prove that creating a group having the FIWARE-service header with capitals can be deleted also using the same FIWARE-service value
  2. This fix is valid for group update and delete as checkServiceIdentity() function is only used for those 2 methods. What about the rest of the requests? (e.g: group read and list and device CRUDL)
Madhu1029 commented 3 months ago

Hi @mapedraza ,

The PR looks good, thank you so much for your contribution. Being said that, I have a couple of comments:

  1. it would be great if you could add a test to prove it works propperly. It should prove that creating a group having the FIWARE-service header with capitals can be deleted also using the same FIWARE-service value.

I have added test case for deletion and updation with FIWARE-service in uppercase.

  1. This fix is valid for group update and delete as checkServiceIdentity() function is only used for those 2 methods. What about the rest of the requests? (e.g: group read and list and device CRUDL)

As mentioned in issue, the bug exists for deletion and updation only. Group create and read is working fine.

Madhu1029 commented 3 months ago

Hi @fgalan ,

If the PR seems OK, please merge the PR.