Skip to content

Commit

Permalink
Merge pull request #3 from mojaloop/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
shashi165 authored Jun 3, 2020
2 parents d3b42d4 + f7574ca commit 28fa428
Show file tree
Hide file tree
Showing 14 changed files with 5,393 additions and 1,328 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN npm install

COPY src /opt/ml-api-adapter/src
COPY config /opt/ml-api-adapter/config
COPY secrets /opt/ml-api-adapter/secrets

FROM node:12.16.0-alpine

Expand Down
8 changes: 4 additions & 4 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
},
"1179|faucet>minimist": {
"decision": "ignore",
"madeAt": 1588343035169,
"expiresAt": 1588947816746
"madeAt": 1589294375966,
"expiresAt": 1591886352434
},
"1500|npm-audit-resolver>audit-resolve-core>yargs-parser": {
"decision": "ignore",
"madeAt": 1588343045019,
"expiresAt": 1588947816746
"madeAt": 1589294387969,
"expiresAt": 1591886352434
}
},
"rules": {},
Expand Down
5 changes: 5 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"ENDPOINT_SECURITY":{
"TLS": {
"rejectUnauthorized": true
},
"JWS": {
"JWS_SIGN": false,
"FSPIOP_SOURCE_TO_SIGN": "switch",
"JWS_SIGNING_KEY_PATH": "secrets/jwsSigningKey.key"
}
},
"MAX_CALLBACK_TIME_LAG_DILATION_MILLISECONDS": 200,
Expand Down
5 changes: 5 additions & 0 deletions docker/ml-api-adapter/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"ENDPOINT_SECURITY": {
"TLS": {
"rejectUnauthorized": true
},
"JWS": {
"JWS_SIGN": false,
"FSPIOP_SOURCE_TO_SIGN": "switch",
"JWS_SIGNING_KEY_PATH": "secrets/jwsSigningKey.key"
}
},
"MAX_CALLBACK_TIME_LAG_DILATION_MILLISECONDS": 200,
Expand Down
6,086 changes: 4,781 additions & 1,305 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/ml-api-adapter",
"version": "10.1.1",
"version": "10.3.0",
"description": "Convert from ML API to/from internal Central Services messaging format",
"license": "Apache-2.0",
"private": true,
Expand Down Expand Up @@ -77,22 +77,23 @@
"@hapi/joi": "17.1.1",
"@hapi/joi-date": "2.0.1",
"@hapi/vision": "6.0.0",
"@mojaloop/central-services-error-handling": "9.1.0",
"@mojaloop/central-services-error-handling": "10.3.0",
"@mojaloop/central-services-health": "10.1.0",
"@mojaloop/central-services-logger": "9.5.1",
"@mojaloop/central-services-metrics": "9.5.0",
"@mojaloop/central-services-shared": "9.5.5",
"@mojaloop/central-services-shared": "10.2.1",
"@mojaloop/central-services-stream": "9.5.0",
"@mojaloop/event-sdk": "9.5.2",
"@mojaloop/forensic-logging-client": "8.3.0",
"@now-ims/hapi-now-auth": "2.0.1",
"@mojaloop/sdk-standard-components": "10.2.4",
"@now-ims/hapi-now-auth": "2.0.2",
"axios": "0.19.2",
"blipp": "4.0.1",
"commander": "5.1.0",
"docdash": "1.2.0",
"glob": "7.1.6",
"hapi-auth-bearer-token": "6.2.1",
"hapi-swagger": "13.0.0",
"hapi-swagger": "13.0.1",
"joi-currency-code": "3.0.1",
"mustache": "4.0.1",
"parse-strings-in-object": "2.0.0",
Expand All @@ -103,19 +104,19 @@
"get-port": "5.1.1",
"jsdoc": "3.6.4",
"license-checker": "25.0.1",
"nodemon": "2.0.3",
"nodemon": "2.0.4",
"npm-audit-resolver": "2.2.0",
"npm-check-updates": "4.1.2",
"npm-check-updates": "6.0.1",
"npm-run-all": "4.1.5",
"nyc": "15.0.1",
"pre-commit": "1.2.2",
"proxyquire": "2.1.3",
"rewire": "5.0.0",
"sinon": "9.0.2",
"standard": "14.3.3",
"standard": "14.3.4",
"supertest": "4.0.2",
"tap-xunit": "2.4.1",
"tape": "5.0.0",
"tape": "5.0.1",
"tapes": "4.1.0",
"uuid4": "1.1.4"
}
Expand Down
27 changes: 27 additions & 0 deletions secrets/jwsSigningKey.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAvs6EjaQYxTPI2dS+L6zJQhszHCP79huvCDPhy/BmTWI4350r
jWiclBC/joy7BUGJszIVv6rrwbeN9OORHXwW0XSjcCEeksdkAee9kGvx/A2UcUOs
QQ3A3IvoxJAv+HJSmCGeKsc2pMrelBtma54i1JBF6H+SwrcM0a+UVsADQXOzKuyi
RYnkCEhZYHXAk7hM3cARvhYydqUnPehFccjS8v6sNTRZnqJ7z/XT3EKYkfizcCkH
iV9elB/PGGzkFWLjHZVTC/+hK6WhFYGEktNbQfDuMA4mnZT37QZEL1PlhnFfjfnr
npjFjcFzKJ+hHRrHqA9FZlo6J9efnUn/VHVCsQIDAQABAoIBAC5eFUwuUm6ptOdq
kYUYYhgUcAkonXQjKhe+M+LRWqr3cYa1tP26LEK3BzXm8RPH52SKiUp4iK4covyd
yIf3vbvMsmLvSXS1y5HC9QgBk16DFk2n+lYct39g6IHL4Dxp27Rohv0ySA8n1Yr8
VZlVZnVtUe+8ALgcr5rNJikmpCPlQ85QFExS8JpxYbbczbm/Q7qcQGdRkop5oFR6
0Zaze7L2F2M1C6IVzUUJKr+TVY58uWqCEqhRDadStkQgw9QPq+PVza5fnTtlIakK
sSk1orJqONWpMY90wNOk/DasMIrQK4RFlkkDgTPjvWSPDRG/p/iRxO2jde5/oyCU
b24TraECgYEA90yIBp3/0BgKE6KPBZzlN8SuwXXH6A3HBXvcVNaNucO5zgXSJcYy
UT8iIUUd1bndfFOv3W8c6bkkeX5fkLm35bqM442m7r56PeugxIpRFPaj6IoTqe3y
9TCaatnOztDjCBEaNcIrJZUzHj6/yffr5pakTcsyBPhpywHGfBNeu9UCgYEAxYUm
bDJOK4NrkUFRGdN6KuWQ1MYrFxFChO9bmmxntt3ncC79qPojmTVCrajjarIBbv97
v/D8PoSf4MKK9qDDdKqZ0dViYUyQm0rbWIxWfVT2fWdy5Xr34BLGkyiyuGam1XBy
XR76uNTjT+z8VIMkXv2mi/tW9XecGTWTx6BTpW0CgYEA6z8jOuA8RDFKDKmb0iQR
LL7t2tz3ALlydLYBv7al9WvKKcEByqtCnGUpS2rbWb/IgQd/CW80muVjXCuqLxts
Y53VfnX2sbACyzqFodFOFloVTBVlZUYU08ebbT+q6rRs8/SI8VC3CLZofUIF4dP0
1VLCE7rS50WEJfiXXtpySM0CgYAuJf3kKZy57eqj9W7NaeuROjGshOBsc0vnY0Uz
v0A8KXx5aYE6ibbnhNofWOZJd21+UZLINbW5paL1EH8HQGhqSbHGpORnd0wR/Ftj
ROawQbmVcyYVF7XyVHCw0UFwdAtmsu8FcseBh7vUYLpTxJAq4XiYHBElKNz/xtTQ
P1VLwQKBgBZuwI0/s/VORrmvok27Wbkup9dDA3XlMccyK2osf31IcH7JY4uMw+9i
RYVjMjIsPtO1Gf71mRcFsWkQYYtZ6V5yrxiLRVq8iSRkOPm2iJtolSg1edOrlVS6
xLPUjxxopeTkZbi4heszkkOn8MvzRznONCXjDt98FubgcAmEr+XA
-----END RSA PRIVATE KEY-----
46 changes: 37 additions & 9 deletions src/handlers/notification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Callback = require('@mojaloop/central-services-shared').Util.Request
const createCallbackHeaders = require('../../lib/headers').createCallbackHeaders
const ErrorHandler = require('@mojaloop/central-services-error-handling')
const KafkaUtil = require('@mojaloop/central-services-shared').Util.Kafka
const JwsSigner = require('@mojaloop/sdk-standard-components').Jws.signer

const Metrics = require('@mojaloop/central-services-metrics')
const ENUM = require('@mojaloop/central-services-shared').Enum
Expand Down Expand Up @@ -255,6 +256,8 @@ const processMessage = async (msg, span) => {
}
}

let jwsSigner = getJWSSigner(from)

if (actionLower === ENUM.Events.Event.Action.PREPARE && statusLower === ENUM.Events.EventStatus.SUCCESS.status) {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_POST, id, span)
callbackHeaders = createCallbackHeaders({ headers: content.headers, httpMethod: ENUM.Http.RestMethods.POST, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_POST })
Expand Down Expand Up @@ -283,7 +286,7 @@ const processMessage = async (msg, span) => {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_ERROR, id, span)
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
Logger.isDebugEnabled && 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
}
Expand All @@ -292,7 +295,7 @@ const processMessage = async (msg, span) => {
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 }, fromSwitch)
Logger.isDebugEnabled && 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)
return true
}

Expand Down Expand Up @@ -328,7 +331,8 @@ const processMessage = async (msg, span) => {
).startTimer()
let rv
try {
rv = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span)
jwsSigner = getJWSSigner(ENUM.Http.Headers.FSPIOP.SWITCH.value)
rv = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span, jwsSigner)
} catch (err) {
histTimerEndSendRequest2({ success: false, to, dest: from, action, status: response.status })
histTimerEnd({ success: false, action })
Expand All @@ -349,7 +353,7 @@ const processMessage = async (msg, span) => {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_ERROR, id, span)
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
Logger.isDebugEnabled && 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
}
Expand All @@ -364,9 +368,10 @@ const processMessage = async (msg, span) => {

// send an extra notification back to the original sender (if enabled in config)
if (Config.SEND_TRANSFER_CONFIRMATION_TO_PAYEE) {
jwsSigner = getJWSSigner(ENUM.Http.Headers.FSPIOP.SWITCH.value)
Logger.isDebugEnabled && Logger.debug(`Notification::processMessage - Callback.sendRequest(${callbackURLFrom}, ${ENUM.Http.RestMethods.PUT}, ${JSON.stringify(callbackHeaders)}, ${payloadForCallback}, ${id}, ${ENUM.Http.Headers.FSPIOP.SWITCH.value}, ${from})`)
callbackHeaders = createCallbackHeaders({ dfspId: from, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT }, fromSwitch)
const response = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span)
const response = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span, jwsSigner)
histTimerEnd({ success: true, action })
return response
} else {
Expand All @@ -386,9 +391,10 @@ const processMessage = async (msg, span) => {

// send an extra notification back to the original sender (if enabled in config)
if (Config.SEND_TRANSFER_CONFIRMATION_TO_PAYEE) {
jwsSigner = getJWSSigner(ENUM.Http.Headers.FSPIOP.SWITCH.value)
Logger.isDebugEnabled && Logger.debug(`Notification::processMessage - Callback.sendRequest(${callbackURLFrom}, ${ENUM.Http.RestMethods.PUT}, ${JSON.stringify(callbackHeaders)}, ${payloadForCallback}, ${id}, ${ENUM.Http.Headers.FSPIOP.SWITCH.value}, ${from})`)
callbackHeaders = createCallbackHeaders({ dfspId: from, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
const response = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span)
const response = await Callback.sendRequest(callbackURLFrom, callbackHeaders, ENUM.Http.Headers.FSPIOP.SWITCH.value, from, ENUM.Http.RestMethods.PUT, payloadForCallback, ENUM.Http.ResponseTypes.JSON, span, jwsSigner)
histTimerEnd({ success: true, action })
return response
} else {
Expand All @@ -411,7 +417,7 @@ const processMessage = async (msg, span) => {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_ERROR, id, span)
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
Logger.isDebugEnabled && 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
}
Expand All @@ -429,7 +435,7 @@ const processMessage = async (msg, span) => {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_ERROR, id, span)
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
Logger.isDebugEnabled && 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
}
Expand All @@ -456,7 +462,7 @@ const processMessage = async (msg, span) => {
const callbackURLTo = await Participant.getEndpoint(to, ENUM.EndPoints.FspEndpointTypes.FSPIOP_CALLBACK_URL_TRANSFER_ERROR, id, span)
callbackHeaders = createCallbackHeaders({ dfspId: to, transferId: id, headers: content.headers, httpMethod: ENUM.Http.RestMethods.PUT, endpointTemplate: ENUM.EndPoints.FspEndpointTemplates.TRANSFERS_PUT_ERROR }, fromSwitch)
Logger.isDebugEnabled && 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
}
Expand Down Expand Up @@ -530,6 +536,28 @@ const disconnect = async () => {
return notificationConsumer.disconnect()
}

/**
* @function getJWSSigner
*
*
* @description Get the JWS signer if enabled
*
* @returns {Object} - returns JWS signer if enabled else returns undefined
*/
const getJWSSigner = (from) => {
let jwsSigner
if (Config.JWS_SIGN && from === Config.FSPIOP_SOURCE_TO_SIGN) {
const logger = Logger
logger.log = logger.info
Logger.isInfoEnabled && Logger.info('Notification::getJWSSigner: get JWS signer')
jwsSigner = new JwsSigner({
logger,
signingKey: Config.JWS_SIGNING_KEY
})
}
return jwsSigner
}

module.exports = {
disconnect,
startConsumer,
Expand Down
17 changes: 16 additions & 1 deletion src/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
const RC = require('parse-strings-in-object')(require('rc')('MLAPI', require('../../config/default.json')))
const fs = require('fs')

function getFileContent (path) {
if (!fs.existsSync(path)) {
console.log(`File ${path} doesn't exist, can't enable JWS signing`)
throw new Error('File doesn\'t exist')
}
return fs.readFileSync(path)
}
// Set config object to be returned
const config = {
HOSTNAME: RC.HOSTNAME.replace(/\/$/, ''),
Expand All @@ -22,7 +30,14 @@ const config = {
ENDPOINT_SECURITY_TLS: RC.ENDPOINT_SECURITY.TLS,
MAX_FULFIL_TIMEOUT_DURATION_SECONDS: RC.MAX_FULFIL_TIMEOUT_DURATION_SECONDS,
MAX_CALLBACK_TIME_LAG_DILATION_MILLISECONDS: RC.MAX_CALLBACK_TIME_LAG_DILATION_MILLISECONDS,
STRIP_UNKNOWN_HEADERS: RC.STRIP_UNKNOWN_HEADERS
STRIP_UNKNOWN_HEADERS: RC.STRIP_UNKNOWN_HEADERS,
JWS_SIGN: RC.ENDPOINT_SECURITY.JWS.JWS_SIGN,
FSPIOP_SOURCE_TO_SIGN: RC.ENDPOINT_SECURITY.JWS.FSPIOP_SOURCE_TO_SIGN,
JWS_SIGNING_KEY_PATH: RC.ENDPOINT_SECURITY.JWS.JWS_SIGNING_KEY_PATH
}

if (config.JWS_SIGN) {
config.JWS_SIGNING_KEY = getFileContent(config.JWS_SIGNING_KEY_PATH)
}

module.exports = config
1 change: 1 addition & 0 deletions test-integration.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk del build-dependencies
COPY src /opt/ml-api-adapter/src
COPY test /opt/ml-api-adapter/test
COPY config /opt/ml-api-adapter/config
COPY secrets /opt/ml-api-adapter/secrets
# overwrite default.json with integration environment specific config
RUN cp -f /opt/ml-api-adapter/test/integration-config.json /opt/ml-api-adapter/config/default.json

Expand Down
1 change: 1 addition & 0 deletions test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk del build-dependencies
COPY src /opt/ml-api-adapter/src
COPY test /opt/ml-api-adapter/test
COPY config /opt/ml-api-adapter/config
COPY secrets /opt/ml-api-adapter/secrets

EXPOSE 3000
CMD ["node /opt/ml-api-adapter/src/api/index.js"]
5 changes: 5 additions & 0 deletions test/integration-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"ENDPOINT_SECURITY":{
"TLS": {
"rejectUnauthorized": false
},
"JWS": {
"JWS_SIGN": false,
"FSPIOP_SOURCE_TO_SIGN": "switch",
"JWS_SIGNING_KEY_PATH": "secrets/jwsSigningKey.key"
}
},
"MAX_CALLBACK_TIME_LAG_DILATION_MILLISECONDS": 200,
Expand Down
Loading

0 comments on commit 28fa428

Please sign in to comment.