Skip to content

Commit

Permalink
Merge pull request #1024 from telefonicaid/task/store_service_lowerca…
Browse files Browse the repository at this point in the history
…se_in_db_models

force store service in lowercase
  • Loading branch information
fgalan authored Apr 30, 2021
2 parents f333af3 + f61f61e commit c4da324
Show file tree
Hide file tree
Showing 176 changed files with 1,469 additions and 1,471 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fix: ensure service of groups, device and commands is stored in mongo in lowercase (#1023)
- Add: add getTypeSilently for device group and use in device registration to avoid false mongo alarm
- Fix: group command is not provisioned in device when entity_type is different (#1011)
- Hotfix: avoid automatic conversion from geo:xxxx ('xxxx' diferent from 'json') to geo:json (reverts the work done in PR #854)
Expand Down
2 changes: 1 addition & 1 deletion lib/model/Command.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Command = new Schema({
type: String,
name: String,
value: Object,
service: String,
service: { type: String, lowercase: true },
subservice: String,
creationDate: { type: Date, default: Date.now }
});
Expand Down
2 changes: 1 addition & 1 deletion lib/model/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Device = new Schema({
transport: String,
staticAttributes: Array,
subscriptions: Array,
service: String,
service: { type: String, lowercase: true },
subservice: String,
polling: Boolean,
timezone: String,
Expand Down
2 changes: 1 addition & 1 deletion lib/model/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Group = new Schema({
resource: String,
apikey: String,
type: String,
service: String,
service: { type: String, lowercase: true },
subservice: String,
description: String,
trust: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "centigrades"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "Boolean"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "Array"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "Boolean"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"attributes": [],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "Array"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "centigrades"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "kelvin"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "commandType"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "lumens"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Wheel"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Wheel"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "centigrades"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"registrationId": "6319a7f5254b05844116584d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "Array"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"registrationId": "6319a7f5254b05844116584d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "commandType"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"registrationId": "6319a7f5254b05844116584d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "command"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "Hgmm"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"registrationId": "6319a7f5254b05844116584d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "commandType"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "commandType"
}
],
"providingApplication": "http://smartGondor.com"
"providingApplication": "http://smartgondor.com"
}
],
"duration": "P1M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "light1"
}
],
"reference": "http://smartGondor.com/notification",
"reference": "http://smartgondor.com/notification",
"duration": "P1M",
"notifyConditions": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "term2"
}
],
"reference": "http://smartGondor.com/notification",
"reference": "http://smartgondor.com/notification",
"duration": "P1M",
"notifyConditions": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"device_id": "Light2",
"protocol": "GENERIC_PROTO",
"service" : "smartGondor",
"service" : "smartgondor",
"service_path": "gardens",
"entity_name": "TheSecondLight",
"entity_type": "TheLightType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"devices": [
{
"protocol": "GENERIC_PROTO",
"service" : "smartGondor",
"service" : "smartgondor",
"entity_name": "TheFirstLight",
"attributes": [],
"commands": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"device_id": "Light1",
"protocol": "GENERIC_PROTO",
"service" : "smartGondor",
"service" : "smartgondor",
"service_path": "gardens",
"entity_name": "TheFirstLight",
"entity_type": "TheLightType"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"device_id": "LightFull",
"protocol": "GENERIC_PROTO",
"service" : "smartGondor",
"service" : "smartgondor",
"service_path": "gardens",
"entity_name": "TheFullLight",
"entity_type": "TheLightType",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"device_id": "Light1",
"protocol": "GENERIC_PROTO",
"service" : "smartGondor",
"service" : "smartgondor",
"service_path": "gardens",
"entity_name": "TheFirstLight",
"entity_type": "TheLightType",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/examples/iotamRequests/registrationEmpty.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocol": "GENERIC_PROTOCOL",
"description": "A generic protocol",
"iotagent": "http://smartGondor.com/iot",
"iotagent": "http://smartgondor.com/iot",
"resource": "/iot/d",
"services": []
}
4 changes: 2 additions & 2 deletions test/unit/examples/iotamRequests/registrationWithGroups.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocol": "GENERIC_PROTOCOL",
"description": "A generic protocol",
"iotagent": "http://smartGondor.com/iot",
"iotagent": "http://smartgondor.com/iot",
"resource": "/iot/d",
"services": [
{
Expand All @@ -10,7 +10,7 @@
"cbHost":"http://unexistentHost:1026",
"entity_type": "SensorMachine",
"resource": "/deviceTest",
"service": "theService",
"service": "theservice",
"service_path": "theSubService",
"attributes": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"protocol": "GENERIC_PROTOCOL",
"description": "A generic protocol",
"iotagent": "http://smartGondor.com/iot",
"iotagent": "http://smartgondor.com/iot",
"resource": "/iot/d",
"services": [
{
"apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8732",
"token": "8970A9078A803H3BL98PINEQRW8342HBAMS",
"entity_type": "SensorMachine",
"resource": "/deviceTest",
"service": "theService",
"service": "theservice",
"service_path": "theSubService",
"attributes": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocol": "GENERIC_PROTOCOL",
"description": "A generic protocol",
"iotagent": "http://smartGondor.com/iot",
"iotagent": "http://smartgondor.com/iot",
"resource": "/iot/d",
"services": [
{
Expand All @@ -10,7 +10,7 @@
"cbHost":"http://unexistentHost:1026",
"entity_type": "SensorMachine",
"resource": "/deviceTest",
"service": "theService",
"service": "theservice",
"service_path": "theSubService",
"attributes": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "TheFirstLight"
}
],
"reference": "http://smartGondor.com/notify",
"reference": "http://smartgondor.com/notify",
"duration": "P1M",
"notifyConditions": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "FirstMicroLight"
}
],
"reference": "http://smartGondor.com/notify",
"reference": "http://smartgondor.com/notify",
"duration": "P1M",
"notifyConditions": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "light1"
}
],
"reference": "http://smartGondor.com/notify",
"reference": "http://smartgondor.com/notify",
"duration": "P1M",
"notifyConditions": [
{
Expand Down
Loading

0 comments on commit c4da324

Please sign in to comment.