Skip to content

Commit

Permalink
feat(mojaloop/#2704): core-services support for non-breaking backward…
Browse files Browse the repository at this point in the history
… api compatibility (#295)

feat(mojaloop/#2704): core-services support for non-breaking backward api compatibility - mojaloop/project#2704
- updated default.json config for PROTOCOL_VERSIONS, and updated related usage based on mojaloop/project#2660 to accept a validationList for the content-type
- updated dependencies
- fixed audit issues
- fixed unit tests

BREAKING CHANGE:
- Config PROTOCOL_VERSIONS.CONTENT has now been modified to support backward compatibility for minor versions (i.e. v1.0 & 1.1) as follows:

> ```
>   "PROTOCOL_VERSIONS": {
>     "CONTENT": "1.1", <-- used when generating messages from the "SWITCH", and validate incoming FSPIOP API requests/callbacks CONTENT-TYPE headers
>     "ACCEPT": {
>       "DEFAULT": "1", <-- used when generating messages from the "SWITCH"
>       "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks ACCEPT headers
>         "1",
>         "1.0",
>         "1.1"
>       ]
>     }
>   },
> ```
> 
> to be consistent with the ACCEPT structure as follows:
> 
> ```
>   "PROTOCOL_VERSIONS": {
>     "CONTENT": {
>       "DEFAULT": "1.1", <-- used when generating messages from the "SWITCH"
>       "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks CONTENT-TYPE headers
>         "1.1",
>         "1.0"
>       ]
>     },
>     "ACCEPT": {
>       "DEFAULT": "1", <-- used when generating messages from the "SWITCH"
>       "VALIDATELIST": [ <-- used to validate incoming FSPIOP API requests/callbacks ACCEPT headers
>         "1",
>         "1.0",
>         "1.1"
>       ]
>     }
>   },
> ```
  • Loading branch information
mdebarros authored Mar 4, 2022
1 parent f92299b commit 812b75d
Show file tree
Hide file tree
Showing 8 changed files with 542 additions and 267 deletions.
55 changes: 55 additions & 0 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,61 @@
"decision": "ignore",
"madeAt": 1644325774956,
"expiresAt": 1646917672191
},
"1007026|axios>follow-redirects": {
"decision": "ignore",
"madeAt": 1646300328166,
"expiresAt": 1648892323604
},
"1004869|00unidentified>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1646300331180,
"expiresAt": 1648892323604
},
"1004869|00unidentified>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1646300331180,
"expiresAt": 1648892323604
},
"1004946|00unidentified>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1646300332372,
"expiresAt": 1648892323604
},
"1004946|00unidentified>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1646300332372,
"expiresAt": 1648892323604
},
"1005383|00unidentified>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1646300333388,
"expiresAt": 1648892323604
},
"1005384|00unidentified>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1646300333388,
"expiresAt": 1648892323604
},
"1005534|00unidentified>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1646300334661,
"expiresAt": 1648892323604
},
"1006886|00unidentified>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1646300336001,
"expiresAt": 1648892323604
},
"1007017|00unidentified>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1646300337227,
"expiresAt": 1648892323604
},
"1007017|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1646313638323,
"expiresAt": 1648905630501
}
},
"rules": {},
Expand Down
9 changes: 8 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
"SCALE": 4
},
"PROTOCOL_VERSIONS": {
"CONTENT": "1.1",
"CONTENT": {
"DEFAULT": "1.1",
"VALIDATELIST": [
"1.1",
"1.0"
]
},
"ACCEPT": {
"DEFAULT": "1",
"VALIDATELIST": [
"1",
"1.0",
"1.1"
]
}
Expand Down
Loading

0 comments on commit 812b75d

Please sign in to comment.