From 0874816f2721c2c9d1ce18026e2e1f6ec684db1a Mon Sep 17 00:00:00 2001 From: shashi165 <33355509+shashi165@users.noreply.github.com> Date: Thu, 4 Jun 2020 07:13:25 -0500 Subject: [PATCH 1/3] fixed JWS issue with GET transfers (#433) Co-authored-by: Shashi --- package-lock.json | 251 +++++++++++------------------ package.json | 8 +- src/handlers/notification/index.js | 4 +- 3 files changed, 102 insertions(+), 161 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8236de73..06080c9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/ml-api-adapter", - "version": "10.2.0", + "version": "10.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1184,6 +1184,38 @@ "@mojaloop/sdk-standard-components": "10.2.4", "jest": "26.0.1", "lodash": "4.17.15" + }, + "dependencies": { + "@mojaloop/sdk-standard-components": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.2.4.tgz", + "integrity": "sha512-0BAZhdvdIvWAjoQTP3mAazq98CD6Wyb7dW9OBGj3ukKJ4CG2TI6U87Iyj9gnDzbcH5gP3N+5IIBxEaj3PHPmYw==", + "requires": { + "base64url": "3.0.1", + "ilp-packet": "2.2.0", + "jsonwebtoken": "8.5.1", + "jws": "4.0.0" + } + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + } } }, "@mojaloop/central-services-health": { @@ -1319,6 +1351,19 @@ "requires": { "@mojaloop/sdk-standard-components": "10.2.4", "lodash": "4.17.15" + }, + "dependencies": { + "@mojaloop/sdk-standard-components": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.2.4.tgz", + "integrity": "sha512-0BAZhdvdIvWAjoQTP3mAazq98CD6Wyb7dW9OBGj3ukKJ4CG2TI6U87Iyj9gnDzbcH5gP3N+5IIBxEaj3PHPmYw==", + "requires": { + "base64url": "3.0.1", + "ilp-packet": "2.2.0", + "jsonwebtoken": "8.5.1", + "jws": "4.0.0" + } + } } }, "ajv": { @@ -1331,6 +1376,25 @@ "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } } } }, @@ -1513,9 +1577,9 @@ } }, "@mojaloop/sdk-standard-components": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.2.4.tgz", - "integrity": "sha512-0BAZhdvdIvWAjoQTP3mAazq98CD6Wyb7dW9OBGj3ukKJ4CG2TI6U87Iyj9gnDzbcH5gP3N+5IIBxEaj3PHPmYw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.3.0.tgz", + "integrity": "sha512-y+y/w4FA6mbo5AZldZ8O5XpM0bSdPjoyEcNW06Gx/czOHaHwBn2rjt3FhQlZztioyclO1pBnczwSix5f+U+ViQ==", "requires": { "base64url": "3.0.1", "ilp-packet": "2.2.0", @@ -2792,35 +2856,6 @@ "make-dir": "^3.0.0", "package-hash": "^4.0.0", "write-file-atomic": "^3.0.0" - }, - "dependencies": { - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - } } }, "call-me-maybe": { @@ -4594,23 +4629,6 @@ "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" - }, - "dependencies": { - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "find-root": { @@ -4704,9 +4722,9 @@ }, "dependencies": { "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -4844,6 +4862,12 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-port": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", @@ -5531,9 +5555,9 @@ } }, "hapi-swagger": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/hapi-swagger/-/hapi-swagger-13.0.1.tgz", - "integrity": "sha512-ZjhHJ6TPOdSzRDYXUvNuaNHe+2izYHhDiKmgGh8fftK+ZbtZM7QTjKD7WD80qnnq3fXaQsdtx8F4SKV90MJ4Ww==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/hapi-swagger/-/hapi-swagger-13.0.2.tgz", + "integrity": "sha512-fPUSVPLh1tpCS1q1ECUhmxL3sZCo6MmrQArwZIoh7QrwN7Tmw2zprz5nGS96KjSQE/MDJOfq82pdEq6FHD7yIQ==", "requires": { "@hapi/boom": "^8.0.1", "@hapi/hoek": "^9.0.2", @@ -6478,9 +6502,9 @@ }, "dependencies": { "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -6488,15 +6512,6 @@ "which": "^2.0.1" } }, - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, "p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", @@ -6512,21 +6527,6 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -9469,9 +9469,9 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" }, "nyc": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", - "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -9482,6 +9482,7 @@ "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", @@ -9566,12 +9567,6 @@ "path-exists": "^4.0.0" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -9587,15 +9582,6 @@ "p-locate": "^4.1.0" } }, - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -9620,27 +9606,6 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -9698,9 +9663,9 @@ } }, "yargs-parser": { - "version": "18.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.2.tgz", - "integrity": "sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -11642,30 +11607,6 @@ "which": "^2.0.1" }, "dependencies": { - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -12036,9 +11977,9 @@ "integrity": "sha1-cAcEaNbSl3ylI3suUZyn0Gouo/0=" }, "swagger-ui-dist": { - "version": "3.25.4", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.25.4.tgz", - "integrity": "sha512-IiupbwT2znZ/BXDgSv9gIaxTL+oVSvhaSe5K4NxSCxRe6bTFK/Q4JwOGzYLep5I2h460xSbwdIuUUblNDolTNg==" + "version": "3.25.5", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.25.5.tgz", + "integrity": "sha512-JZ6dVQS2nPgVYW0+JIIxm84vvFbR/ole6xYJG2DcSdejDLt8ARqIhbZ4InL7RVsLdXpPirUMb7hf2z4Fzqesyw==" }, "symbol-tree": { "version": "3.2.4", @@ -12618,9 +12559,9 @@ "dev": true }, "uglify-js": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz", - "integrity": "sha512-r5ImcL6QyzQGVimQoov3aL2ZScywrOgBXGndbWrdehKoSvGe/RmiE5Jpw/v+GvxODt6l2tpBXwA7n+qZVlHBMA==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", + "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", "optional": true, "requires": { "commander": "~2.20.3" diff --git a/package.json b/package.json index ab68e58d..04bd4786 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/ml-api-adapter", - "version": "10.3.0", + "version": "10.3.1", "description": "Convert from ML API to/from internal Central Services messaging format", "license": "Apache-2.0", "private": true, @@ -85,7 +85,7 @@ "@mojaloop/central-services-stream": "9.5.0", "@mojaloop/event-sdk": "9.5.2", "@mojaloop/forensic-logging-client": "8.3.0", - "@mojaloop/sdk-standard-components": "10.2.4", + "@mojaloop/sdk-standard-components": "10.3.0", "@now-ims/hapi-now-auth": "2.0.2", "axios": "0.19.2", "blipp": "4.0.1", @@ -93,7 +93,7 @@ "docdash": "1.2.0", "glob": "7.1.6", "hapi-auth-bearer-token": "6.2.1", - "hapi-swagger": "13.0.1", + "hapi-swagger": "13.0.2", "joi-currency-code": "3.0.1", "mustache": "4.0.1", "parse-strings-in-object": "2.0.0", @@ -108,7 +108,7 @@ "npm-audit-resolver": "2.2.0", "npm-check-updates": "6.0.1", "npm-run-all": "4.1.5", - "nyc": "15.0.1", + "nyc": "15.1.0", "pre-commit": "1.2.2", "proxyquire": "2.1.3", "rewire": "5.0.0", diff --git a/src/handlers/notification/index.js b/src/handlers/notification/index.js index d3eac248..ca69505a 100644 --- a/src/handlers/notification/index.js +++ b/src/handlers/notification/index.js @@ -451,9 +451,9 @@ const processMessage = async (msg, span) => { if (actionLower === ENUM.Events.Event.Action.GET && statusLower === ENUM.Events.EventStatus.SUCCESS.status) { const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_PUT, id, span) - callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT }) + callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT }, fromSwitch) Logger.debug(`Notification::processMessage - Callback.sendRequest(${callbackURLTo}, ${ENUM.Http.RestMethods.PUT}, ${JSON.stringify(callbackHeaders)}, ${payloadForCallback}, ${id}, ${from}, ${to})`) - await Callback.sendRequest(callbackURLTo, callbackHeaders, from, to, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span) + await Callback.sendRequest(callbackURLTo, callbackHeaders, from, to, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span, jwsSigner) histTimerEnd({ success: true, action }) return true } From 6865838661bd08d9a92e64474ba0ac4c6a2e6942 Mon Sep 17 00:00:00 2001 From: shashi165 <33355509+shashi165@users.noreply.github.com> Date: Thu, 4 Jun 2020 09:45:38 -0500 Subject: [PATCH 2/3] Hotfix/get transfer jws (#434) * fixed JWS issue with GET transfers * fix python circleci issue * fix python circleci issue Co-authored-by: Shashi --- .circleci/config.yml | 7 +++---- package-lock.json | 7 ++++--- package.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74baf817..c50f6dd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,13 +28,12 @@ defaults_Dependencies: &defaults_Dependencies | defaults_awsCliDependencies: &defaults_awsCliDependencies | apk --no-cache add \ - python \ - py-pip \ + python3 \ + py3-pip \ groff \ less \ mailcap - pip install --upgrade awscli==1.14.5 s3cmd==2.0.1 python-magic - apk -v --purge del py-pip + pip3 install --upgrade awscli==1.14.5 s3cmd==2.0.1 python-magic defaults_license_scanner: &defaults_license_scanner name: Install and set up license-scanner diff --git a/package-lock.json b/package-lock.json index 06080c9e..3fe4b891 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1577,11 +1577,12 @@ } }, "@mojaloop/sdk-standard-components": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.3.0.tgz", - "integrity": "sha512-y+y/w4FA6mbo5AZldZ8O5XpM0bSdPjoyEcNW06Gx/czOHaHwBn2rjt3FhQlZztioyclO1pBnczwSix5f+U+ViQ==", + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.3.1.tgz", + "integrity": "sha512-oPmFrnhUPBFCqRJ61sgHHB0eTpDNhAcZ2tOWaKvUopbhjCt4aVT1Z0plJoLnvB7jeuH8iQb6Z8P1zw5CAHy8LA==", "requires": { "base64url": "3.0.1", + "fast-safe-stringify": "^2.0.7", "ilp-packet": "2.2.0", "jsonwebtoken": "8.5.1", "jws": "4.0.0" diff --git a/package.json b/package.json index 04bd4786..e30f6878 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@mojaloop/central-services-stream": "9.5.0", "@mojaloop/event-sdk": "9.5.2", "@mojaloop/forensic-logging-client": "8.3.0", - "@mojaloop/sdk-standard-components": "10.3.0", + "@mojaloop/sdk-standard-components": "10.3.1", "@now-ims/hapi-now-auth": "2.0.2", "axios": "0.19.2", "blipp": "4.0.1", From 6c2d42c2c20287a1c363f0b0658c643b4256e329 Mon Sep 17 00:00:00 2001 From: Adrian Enns Date: Thu, 4 Jun 2020 12:38:36 -0600 Subject: [PATCH 3/3] Changes for bug 1408 (#435) --- package-lock.json | 8 ++++---- package.json | 4 ++-- src/lib/headers.js | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3fe4b891..6330844a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/ml-api-adapter", - "version": "10.3.1", + "version": "10.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1577,9 +1577,9 @@ } }, "@mojaloop/sdk-standard-components": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.3.1.tgz", - "integrity": "sha512-oPmFrnhUPBFCqRJ61sgHHB0eTpDNhAcZ2tOWaKvUopbhjCt4aVT1Z0plJoLnvB7jeuH8iQb6Z8P1zw5CAHy8LA==", + "version": "10.3.2", + "resolved": "https://registry.npmjs.org/@mojaloop/sdk-standard-components/-/sdk-standard-components-10.3.2.tgz", + "integrity": "sha512-O5DqUL+ncS718nFDFUMx8QO0pmTmg+/CNYuaXPrFfHDgf8c05mgSjg6Z8wt69Auwph6WXWaNjKTQRqZG2/BDdQ==", "requires": { "base64url": "3.0.1", "fast-safe-stringify": "^2.0.7", diff --git a/package.json b/package.json index e30f6878..4907871a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/ml-api-adapter", - "version": "10.3.1", + "version": "10.3.2", "description": "Convert from ML API to/from internal Central Services messaging format", "license": "Apache-2.0", "private": true, @@ -85,7 +85,7 @@ "@mojaloop/central-services-stream": "9.5.0", "@mojaloop/event-sdk": "9.5.2", "@mojaloop/forensic-logging-client": "8.3.0", - "@mojaloop/sdk-standard-components": "10.3.1", + "@mojaloop/sdk-standard-components": "10.3.2", "@now-ims/hapi-now-auth": "2.0.2", "axios": "0.19.2", "blipp": "4.0.1", diff --git a/src/lib/headers.js b/src/lib/headers.js index e0ccb070..2b96cdea 100644 --- a/src/lib/headers.js +++ b/src/lib/headers.js @@ -43,10 +43,8 @@ exports.createCallbackHeaders = (params, fromSwitch = false) => { const callbackHeaders = { ...params.headers } callbackHeaders[Enums.Http.Headers.FSPIOP.HTTP_METHOD] = params.httpMethod - if (fromSwitch) { - const uri = Mustache.render(params.endpointTemplate, { ID: params.transferId || null, fsp: params.dfspId || null }) - callbackHeaders[Enums.Http.Headers.FSPIOP.URI] = uriRegex.exec(uri)[1] - } + const uri = Mustache.render(params.endpointTemplate, { ID: params.transferId || null, fsp: params.dfspId || null }) + callbackHeaders[Enums.Http.Headers.FSPIOP.URI] = uriRegex.exec(uri)[1] return callbackHeaders }