From 173089f2eaa50273c3ce0a32724ae018666ca3d5 Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Mon, 24 Feb 2020 14:00:37 +0100 Subject: [PATCH] /#1238: Add header validation support for Transaction Request Services (#190) * Update dependencies. * Update version to 9.2.0 --- package-lock.json | 142 ++++++++++++---------- package.json | 6 +- src/util/hapi/plugins/headerValidation.js | 3 +- 3 files changed, 85 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index cee17ec3..c9ae277f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/central-services-shared", - "version": "9.1.4", + "version": "9.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -588,13 +588,12 @@ } }, "@mojaloop/event-sdk": { - "version": "8.8.1-snapshot.2", - "resolved": "https://registry.npmjs.org/@mojaloop/event-sdk/-/event-sdk-8.8.1-snapshot.2.tgz", - "integrity": "sha512-ufq+PCbASUfVA24jJ7yFKBUNVVeayop9Us8eKh05Ow5AD+JNfoulVDKPnhqDplTuRQ8Jss88u2kjPmcx9B8IXA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@mojaloop/event-sdk/-/event-sdk-9.2.0.tgz", + "integrity": "sha512-CpdmsSAjieE+053gxbS+H1eeEiuXX2x0qDXhiGWjynMeEWdZhZsZnTACRDAKcxdqZjJdo2ioVw8XVWqaPeyZtA==", "requires": { "@grpc/proto-loader": "0.5.3", - "@mojaloop/central-services-logger": "8.6.0", - "@types/protobufjs": "6.0.0", + "@mojaloop/central-services-logger": "9.1.0", "brototype": "0.0.6", "error-callsites": "2.0.2", "grpc": "1.24.2", @@ -604,39 +603,53 @@ "protobufjs": "6.8.8", "rc": "1.2.8", "serialize-error": "4.1.0", - "sinon": "8.0.4", + "sinon": "8.1.1", "traceparent": "1.0.0", "tslib": "1.10.0", - "uuid4": "1.1.4", - "winston": "3.2.1" + "uuid4": "1.1.4" }, "dependencies": { - "@mojaloop/central-services-logger": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-logger/-/central-services-logger-8.6.0.tgz", - "integrity": "sha512-TPr6gnYxJfeUjOccDVM10uibPCF4magYhUUbK8xGuPHUfZNAN1uxKGVdkWoDvHvu5ZCZPolie+12ANogAQIH9Q==", - "requires": { - "parse-strings-in-object": "1.2.0", - "rc": "1.2.8", - "winston": "3.2.1" - }, - "dependencies": { - "parse-strings-in-object": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parse-strings-in-object/-/parse-strings-in-object-1.2.0.tgz", - "integrity": "sha512-lI8XgBWZ5COL0G2G6MsLqPSc4X/SnYPw5jGDiins/qzdOdlY493j/niCY9UiJqWjDoeY20k7vhEXvKRHTy6Dfw==" - } + "@sinonjs/formatio": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-4.0.1.tgz", + "integrity": "sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw==", + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^4.2.0" + } + }, + "@sinonjs/samsam": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.2.tgz", + "integrity": "sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==", + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "nise": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-3.0.1.tgz", + "integrity": "sha512-fYcH9y0drBGSoi88kvhpbZEsenX58Yr+wOJ4/Mi1K4cy+iGP/a73gNoyNhu5E9QxPdgTlVChfIaAlnyOy/gHUA==", + "requires": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/formatio": "^4.0.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^5.0.1", + "path-to-regexp": "^1.7.0" } }, "sinon": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.0.4.tgz", - "integrity": "sha512-cFsmgmvsgFb87e7SV7IcekogITlHX2KmlplyI9Pda0FH1Z8Ms/kWbpLs25Idp0m6ZJ3HEEjhaYYXbcTtWWUn4w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.1.1.tgz", + "integrity": "sha512-E+tWr3acRdoe1nXbHMu86SSqA1WGM7Yw3jZRLvlCMnXwTHP8lgFFVn5BnKnF26uc5SfZ3D7pA9sN7S3Y2jG4Ew==", "requires": { "@sinonjs/commons": "^1.7.0", "@sinonjs/formatio": "^4.0.1", - "@sinonjs/samsam": "^4.2.1", - "diff": "^4.0.1", + "@sinonjs/samsam": "^4.2.2", + "diff": "^4.0.2", "lolex": "^5.1.2", "nise": "^3.0.1", "supports-color": "^7.1.0" @@ -736,28 +749,40 @@ "dev": true }, "@sinonjs/commons": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", - "integrity": "sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz", + "integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==", "requires": { "type-detect": "4.0.8" } }, + "@sinonjs/fake-timers": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz", + "integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, "@sinonjs/formatio": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-4.0.1.tgz", - "integrity": "sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", + "dev": true, "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^4.2.0" + "@sinonjs/samsam": "^5.0.2" } }, "@sinonjs/samsam": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.2.tgz", - "integrity": "sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.2.tgz", + "integrity": "sha512-p3yrEVB5F/1wI+835n+X8llOGRgV8+jw5BHQ/cJoLBUXXZ5U8Tr5ApwPc4L4av/vjla48kVPoN0t6dykQm+Rvg==", + "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", + "@sinonjs/formatio": "^5.0.0", "lodash.get": "^4.4.2", "type-detect": "^4.0.8" } @@ -797,17 +822,9 @@ "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/node": { - "version": "10.17.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.15.tgz", - "integrity": "sha512-daFGV9GSs6USfPgxceDA8nlSe48XrVCJfDeYm7eokxq/ye7iuOH87hKXgMtEAVLFapkczbZsx868PMDT1Y0a6A==" - }, - "@types/protobufjs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@types/protobufjs/-/protobufjs-6.0.0.tgz", - "integrity": "sha512-A27RDExpAf3rdDjIrHKiJK6x8kqqJ4CmoChwtipfhVAn1p7+wviQFFP7dppn8FslSbHtQeVPvi8wNKkDjSYjHw==", - "requires": { - "protobufjs": "*" - } + "version": "10.17.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.16.tgz", + "integrity": "sha512-A4283YSA1OmnIivcpy/4nN86YlnKRiQp8PYwI2KdPCONEBN093QTb0gCtERtkLyVNGKKIGazTZ2nAmVzQU51zA==" }, "abab": { "version": "2.0.3", @@ -4908,15 +4925,16 @@ "dev": true }, "nise": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-3.0.1.tgz", - "integrity": "sha512-fYcH9y0drBGSoi88kvhpbZEsenX58Yr+wOJ4/Mi1K4cy+iGP/a73gNoyNhu5E9QxPdgTlVChfIaAlnyOy/gHUA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.2.tgz", + "integrity": "sha512-ALDnm0pTTyeGdbg5FCpWGd58Nmp3qO8d8x+dU2Fw8lApeJTEBSjkBZZM4S8t6GpKh+czxkfM/TKxpRMroZzwOg==", + "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", - "@sinonjs/formatio": "^4.0.1", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/formatio": "^5.0.1", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^5.0.1", "path-to-regexp": "^1.7.0" } }, @@ -6693,17 +6711,17 @@ } }, "sinon": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.1.1.tgz", - "integrity": "sha512-E+tWr3acRdoe1nXbHMu86SSqA1WGM7Yw3jZRLvlCMnXwTHP8lgFFVn5BnKnF26uc5SfZ3D7pA9sN7S3Y2jG4Ew==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.0.tgz", + "integrity": "sha512-c4bREcvuK5VuEGyMW/Oim9I3Rq49Vzb0aMdxouFaA44QCFpilc5LJOugrX+mkrvikbqCimxuK+4cnHVNnLR41g==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", - "@sinonjs/formatio": "^4.0.1", - "@sinonjs/samsam": "^4.2.2", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/formatio": "^5.0.0", + "@sinonjs/samsam": "^5.0.1", "diff": "^4.0.2", - "lolex": "^5.1.2", - "nise": "^3.0.1", + "nise": "^4.0.1", "supports-color": "^7.1.0" } }, diff --git a/package.json b/package.json index b29f7560..59769470 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/central-services-shared", - "version": "9.1.4", + "version": "9.2.0", "description": "Shared code for central services", "main": "src/index.js", "scripts": { @@ -46,7 +46,7 @@ "@mojaloop/central-services-error-handling": "9.1.0", "@mojaloop/central-services-logger": "9.1.0", "@mojaloop/central-services-metrics": "9.1.0", - "@mojaloop/event-sdk": "8.8.1-snapshot.2", + "@mojaloop/event-sdk": "9.2.0", "axios": "0.19.2", "base64url": "3.0.1", "clone": "2.1.2", @@ -68,7 +68,7 @@ "proxyquire": "2.1.3", "rc": "1.2.8", "rewire": "4.0.1", - "sinon": "8.1.1", + "sinon": "9.0.0", "standard": "14.3.1", "tap-xunit": "2.4.1", "tape": "4.13.0", diff --git a/src/util/hapi/plugins/headerValidation.js b/src/util/hapi/plugins/headerValidation.js index 11f6bbff..14e6ba7a 100644 --- a/src/util/hapi/plugins/headerValidation.js +++ b/src/util/hapi/plugins/headerValidation.js @@ -14,7 +14,8 @@ const defaultProtocolResources = [ 'parties', 'participants', 'quotes', - 'transfers' + 'transfers', + 'transactionRequests' ] const defaultProtocolVersions = [