Skip to content

Commit

Permalink
fix(mojaloop/3132): wso2 auth fix fspiop handler (#437)
Browse files Browse the repository at this point in the history
* fix: wso2Auth

* chore(snapshot): 22.0.0-snapshot.0

* chore(snapshot): 22.0.0-snapshot.1

* fix: wso2

* chore(snapshot): 22.0.0-snapshot.2

* fix: audit issues
  • Loading branch information
vijayg10 committed Feb 17, 2023
1 parent 49a06e5 commit 4260361
Show file tree
Hide file tree
Showing 17 changed files with 455 additions and 453 deletions.
5 changes: 4 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"GHSA-9c47-m6qq-7p4h",
"GHSA-h452-7996-h45h",
"GHSA-rc47-6667-2j5j",
"GHSA-8x6c-cv3v-vp6g"
"GHSA-8x6c-cv3v-vp6g",
// Some audit issues with api-snippets
"GHSA-r6ch-mqf9-qc9w",
"GHSA-5r9g-qh6m-jxff"
]
}
6 changes: 3 additions & 3 deletions modules/api-svc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-api-svc",
"version": "20.6.1",
"version": "20.6.2-snapshot.1",
"description": "An adapter for connecting to Mojaloop API enabled switches.",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down Expand Up @@ -97,12 +97,12 @@
"@babel/preset-env": "^7.20.2",
"@redocly/openapi-cli": "^1.0.0-beta.94",
"@types/jest": "^29.4.0",
"babel-jest": "^29.4.2",
"babel-jest": "^29.4.3",
"eslint": "^8.34.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"jest": "^29.4.2",
"jest": "^29.4.3",
"jest-junit": "^15.0.0",
"nock": "^13.3.0",
"npm-check-updates": "^16.7.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports.handleBulkQuotesRequestedDmEvt = async (
...options.config,
cache: options.cache,
logger: logger,
wso2: options.wso2Auth,
wso2: options.wso2,
});

await model.initialize(event.request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports.handleBulkTransfersRequestedDmEvt = async (
...options.config,
cache: options.cache,
logger: logger,
wso2: options.wso2Auth,
wso2: options.wso2,
});

await model.initialize(event.request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports.handlePartyInfoRequestedDmEvt = async (
...options.config,
cache: options.cache,
logger: logger,
wso2Auth: options.wso2Auth,
wso2: options.wso2,
};

const cacheKey = PartiesModel.generateKey(args);
Expand Down
6 changes: 3 additions & 3 deletions modules/api-svc/src/FSPIOPEventHandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const {
} = require('./handlers');

class FSPIOPEventHandler {
constructor({ config, logger, cache, wso2Auth }) {
constructor({ config, logger, cache, wso2 }) {
this._conf = config;
this._logger = logger;
this._cache = cache;
this._wso2Auth = wso2Auth;
this._wso2 = wso2;

this._loggerFromLoggingBC = new DefaultLogger(BC_CONFIG.bcName, 'fspiop-event-handler', '0.0.1', config.logLevel);

Expand All @@ -66,7 +66,7 @@ class FSPIOPEventHandler {
producer: this._producer,
consumer: this._consumer,
cache: this._cache,
wso2Auth: this._wso2Auth,
wso2: this._wso2,
config: this._conf,
};

Expand Down
6 changes: 3 additions & 3 deletions modules/api-svc/src/OutboundServer/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ const getPartiesByTypeAndId = async (ctx) => {
...ctx.state.conf,
cache: ctx.state.cache,
logger: ctx.state.logger,
wso2Auth: ctx.state.wso2Auth,
wso2: ctx.state.wso2,
};

const cacheKey = PartiesModel.generateKey(args);
Expand Down Expand Up @@ -554,7 +554,7 @@ const postQuotes = async (ctx) => {
...ctx.state.conf,
cache: ctx.state.cache,
logger: ctx.state.logger,
wso2Auth: ctx.state.wso2Auth,
wso2: ctx.state.wso2,
};

const cacheKey = QuotesModel.generateKey(args);
Expand Down Expand Up @@ -584,7 +584,7 @@ const postSimpleTransfers = async (ctx) => {
...ctx.state.conf,
cache: ctx.state.cache,
logger: ctx.state.logger,
wso2Auth: ctx.state.wso2Auth,
wso2: ctx.state.wso2,
};

const cacheKey = TransfersModel.generateKey(args);
Expand Down
2 changes: 1 addition & 1 deletion modules/api-svc/src/OutboundServer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OutboundApi extends EventEmitter {
peerEndpoint: conf.peerEndpoint.replace(endpointRegex, ''),
proxyConfig: conf.proxyConfig,
logger: this._logger,
wso2Auth: wso2.auth,
wso2: wso2,
tls: conf.outbound.tls,
}));
}
Expand Down
2 changes: 1 addition & 1 deletion modules/api-svc/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Server extends EventEmitter {
config: this.conf,
logger: this.logger.push(LOG_ID.FSPIOP_EVENT_HANDLER),
cache: this.cache,
wso2Auth: this.wso2,
wso2: this.wso2,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/api-svc/src/lib/model/Async2SyncModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function generate({
jwsSign: config.jwsSign,
jwsSignPutParties: config.jwsSignPutParties,
jwsSigningKey: config.jwsSigningKey,
wso2Auth: config.wso2Auth
wso2: config.wso2
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/api-svc/src/lib/model/ProxyModel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ProxyModel {
* @param config.peerEndpoint {string}
* @param config.dfspId {string}
* @param config.tls {Object}
* @param config.wso2Auth {Object}
* @param config.wso2 {Object}
*/
constructor(config) {
this._logger = config.logger;
Expand All @@ -41,7 +41,7 @@ class ProxyModel {
},
jwsSign: config.jwsSign,
jwsSigningKey: config.jwsSigningKey,
wso2Auth: config.wso2Auth
wso2: config.wso2
});

this._validateConfig(config.proxyConfig);
Expand Down
30 changes: 15 additions & 15 deletions modules/api-svc/test/unit/outboundApi/handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ describe('Outbound API handlers:', () => {
response: {},
state: {
conf: {},
wso2Auth: 'mocked wso2Auth',
wso2: 'mocked wso2',
logger: mockLogger({ app: 'outbound-api-handlers-test'}),
cache: { the: 'mocked cache' },
path: {
Expand Down Expand Up @@ -554,7 +554,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand All @@ -576,7 +576,7 @@ describe('Outbound API handlers:', () => {
response: {},
state: {
conf: {},
wso2Auth: 'mocked wso2Auth',
wso2: 'mocked wso2',
logger: mockLogger({ app: 'outbound-api-handlers-test'}),
cache: { the: 'mocked cache' },
path: {
Expand Down Expand Up @@ -610,7 +610,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand All @@ -632,7 +632,7 @@ describe('Outbound API handlers:', () => {
response: {},
state: {
conf: {},
wso2Auth: 'mocked wso2Auth',
wso2: 'mocked wso2',
logger: mockLogger({ app: 'outbound-api-handlers-test'}),
cache: {
subscribe: jest.fn(() => Promise.resolve())
Expand Down Expand Up @@ -668,7 +668,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -702,7 +702,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -740,7 +740,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -781,7 +781,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -815,7 +815,7 @@ describe('Outbound API handlers:', () => {
response: {},
state: {
conf: {},
wso2Auth: 'mocked wso2Auth',
wso2: 'mocked wso2',
logger: mockLogger({ app: 'outbound-api-handlers-test' }),
cache: {
subscribe: jest.fn(() => Promise.resolve())
Expand Down Expand Up @@ -844,7 +844,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -881,7 +881,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -914,7 +914,7 @@ describe('Outbound API handlers:', () => {
response: {},
state: {
conf: {},
wso2Auth: 'mocked wso2Auth',
wso2: 'mocked wso2',
logger: mockLogger({ app: 'outbound-api-handlers-test' }),
cache: {
subscribe: jest.fn(() => Promise.resolve())
Expand Down Expand Up @@ -943,7 +943,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down Expand Up @@ -980,7 +980,7 @@ describe('Outbound API handlers:', () => {
const expectedConfig = {
cache: state.cache,
logger: state.logger,
wso2Auth: state.wso2Auth
wso2: state.wso2
};
expect(createSpy).toBeCalledWith({}, cacheKey, expectedConfig);

Expand Down
4 changes: 2 additions & 2 deletions modules/outbound-command-event-handler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
"version": "0.2.16",
"version": "0.2.17-snapshot.1",
"description": "mojaloop sdk scheme adapter command event handler",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
Expand Down Expand Up @@ -67,7 +67,7 @@
"@typescript-eslint/parser": "^5.52.0",
"copyfiles": "^2.4.1",
"eslint": "^8.34.0",
"jest": "^29.4.2",
"jest": "^29.4.3",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.7.4",
"replace": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions modules/outbound-domain-event-handler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
"version": "0.2.16",
"version": "0.2.17-snapshot.1",
"description": "mojaloop sdk scheme adapter outbound domain event handler",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
Expand Down Expand Up @@ -65,7 +65,7 @@
"@typescript-eslint/parser": "^5.52.0",
"copyfiles": "^2.4.1",
"eslint": "^8.34.0",
"jest": "^29.4.2",
"jest": "^29.4.3",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.7.4",
"replace": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions modules/private-shared-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
"version": "0.3.16",
"version": "0.3.17-snapshot.1",
"description": "SDK Scheme Adapter private shared library.",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/accounts-and-balances-bc/tree/main/modules/private-types",
Expand Down Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@types/node": "^18.13.0",
"eslint": "^8.34.0",
"jest": "^29.4.2",
"jest": "^29.4.3",
"npm-check-updates": "^16.7.4",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter",
"version": "21.6.1",
"version": "22.0.0-snapshot.2",
"description": "mojaloop sdk-scheme-adapter",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter",
Expand Down Expand Up @@ -67,7 +67,7 @@
"wait-4-docker": "node ./scripts/_wait4_all.js"
},
"dependencies": {
"nx": "15.7.0",
"nx": "15.7.1",
"tslib": "^2.5.0"
},
"devDependencies": {
Expand All @@ -81,7 +81,7 @@
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "latest",
"husky": "^8.0.3",
"jest": "^29.4.2",
"jest": "^29.4.3",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.7.4",
"replace": "^1.2.2",
Expand Down

0 comments on commit 4260361

Please sign in to comment.