Skip to content

Commit d30c318

Browse files
authored
Merge pull request #796 from telefonicaid/task/use_apikey_to_search_group_config
use apikey to search group config
2 parents c2fb903 + 7b18da4 commit d30c318

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGES_NEXT_RELEASE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- ADD use apikey to search group config at device creation time
2+
- ADD to use apikey to search group configuration at device registration time
13
- Upgrade async dependency from 2.6.1 to 2.6.2
24
- Upgrade body-parser dependency from ~1.18.3 to ~1.19.0
35
- Upgrade moment dependency from ~2.22.2 to ~2.24.0
@@ -10,4 +12,4 @@
1012
- Upgrade mocha dev dependency from 5.2.0 to 6.1.4
1113
- Upgrade nock dev dependency from 10.0.1 to 10.0.6
1214
- Upgrade timekeeper dev dependency from 2.1.2 to 2.2.0
13-
- Set Nodejs 8 as minimum version in packages.json (effectively removing Nodev6 from supported versions)
15+
- Set Nodejs 8 as minimum version in packages.json (effectively removing Nodev6 from supported versions)

lib/services/devices/deviceService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ function findConfigurationGroup(deviceObj, callback) {
636636
deviceObj.service,
637637
deviceObj.subservice,
638638
deviceObj.type,
639+
deviceObj.apikey,
639640
handlerGroupFind);
640641
}
641642
}

lib/services/groups/groupRegistryMongoDB.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ exports.create = alarmsInt(constants.MONGO_ALARM, intoTrans(context, createGroup
303303
exports.list = alarmsInt(constants.MONGO_ALARM, intoTrans(context, listGroups));
304304
exports.init = alarmsInt(constants.MONGO_ALARM, intoTrans(context, init));
305305
exports.find = alarmsInt(constants.MONGO_ALARM, intoTrans(context, find));
306-
exports.findType = alarmsInt(constants.MONGO_ALARM, intoTrans(context, findBy(['service', 'subservice', 'type'])));
306+
exports.findType = alarmsInt(constants.MONGO_ALARM,
307+
intoTrans(context, findBy(['service', 'subservice', 'type', 'apikey'])));
307308
exports.findBy = alarmsInt(constants.MONGO_ALARM, intoTrans(context, findBy));
308309
exports.get = alarmsInt(constants.MONGO_ALARM, intoTrans(context, findBy(['resource', 'apikey'])));
309310
exports.getType = alarmsInt(constants.MONGO_ALARM, intoTrans(context, findBy(['type'])));

lib/services/northBound/deviceProvisioningServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function handleProvision(req, res, next) {
106106

107107
callback(null, {
108108
id: body['device_id'],
109+
apikey: body['apikey'],
109110
type: body['entity_type'],
110111
name: body['entity_name'],
111112
service: service,
@@ -141,7 +142,6 @@ function handleProvision(req, res, next) {
141142
}
142143

143144
logger.debug(context, 'Handling device provisioning request.');
144-
145145
async.map(extractDevices(), provisionSingleDevice, handleProvisioningFinish);
146146
}
147147

0 commit comments

Comments
 (0)