X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=otf-frontend%2Fserver%2Fsrc%2Ffeathers%2Fservices%2Fusers%2Fusers.service.js;h=981f1143b75ff1d8ec3bfe4dd18e0a5e43635550;hb=cf067bb8bd9b45e79a85e9612a0f4c5abeb727b8;hp=b4350bb83391c77a136b105978a9f1590f9a7980;hpb=596b1d89c5f63170ed40abb6f7b9395178c5e44e;p=it%2Fotf.git diff --git a/otf-frontend/server/src/feathers/services/users/users.service.js b/otf-frontend/server/src/feathers/services/users/users.service.js index b4350bb..981f114 100644 --- a/otf-frontend/server/src/feathers/services/users/users.service.js +++ b/otf-frontend/server/src/feathers/services/users/users.service.js @@ -31,29 +31,9 @@ module.exports = function (app) { paginate }; - const mongoConfig = app.get('mongo'); - const rateLimitConfig = app.get('rate-limit'); - - const createUserLimiter = new RateLimit({ - store: new MongoStore({ - uri: 'mongodb://' + mongoConfig.username + ':' + mongoConfig.password + '@' + mongoConfig.baseUrl + - mongoConfig.dbOtf + '?replicaSet=' + mongoConfig.replicaSet, - collectionName: rateLimitConfig.mongoStore.collection - }), - max: app.get('rate-limit').services.users.max, - windowsMs: app.get('rate-limit').services.users.windowMs, - message: app.get('rate-limit').services.users.message - }); - // Initialize our service with any options it requires, // and limit any POST methods. - app.use(app.get('base-path') + 'users', (req, res, next) => { - if (req.method === 'POST') { - createUserLimiter(req, res, next); - } else { - next(); - } - }, createService(options)); + app.use(app.get('base-path') + 'users', createService(options)); // Get our initialized service so that we can register hooks const service = app.service(app.get('base-path') + 'users');