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 (#74)

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 d4d1bf5 commit 62afc4e
Show file tree
Hide file tree
Showing 9 changed files with 1,414 additions and 978 deletions.
105 changes: 86 additions & 19 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,47 @@
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637589670645,
"expiresAt": 1640181661032
"madeAt": 1646310492859,
"expiresAt": 1648902456937
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637589670645,
"expiresAt": 1640181661032
"madeAt": 1646310492860,
"expiresAt": 1648902456937
},
"1004876|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "ignore",
"madeAt": 1637589672008,
"expiresAt": 1640181661032
"madeAt": 1646310493943,
"expiresAt": 1648902456937
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637589673286,
"expiresAt": 1640181661032
"madeAt": 1646310494959,
"expiresAt": 1648902456937
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637589673286,
"expiresAt": 1640181661032
"madeAt": 1646310494959,
"expiresAt": 1648902456937
},
"1005383|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637589674485,
"expiresAt": 1640181661032
"madeAt": 1646310495981,
"expiresAt": 1648902456937
},
"1005384|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637589674485,
"expiresAt": 1640181661032
"madeAt": 1646310495981,
"expiresAt": 1648902456937
},
"1005534|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1637589675952,
"expiresAt": 1640181661032
"madeAt": 1646310497023,
"expiresAt": 1648902456937
},
"1006724|request>http-signature>jsprim>json-schema": {
"decision": "ignore",
"madeAt": 1637589677180,
"expiresAt": 1640181661032
"decision": "fix",
"madeAt": 1646310475744
},
"1004854|00unidentified>widdershins>openapi-sampler>json-pointer": {
"decision": "ignore",
Expand Down Expand Up @@ -94,6 +93,74 @@
"decision": "ignore",
"madeAt": 1639410963305,
"expiresAt": 1642002950610
},
"1006899|@mojaloop/central-services-shared>widdershins>node-fetch": {
"decision": "fix",
"madeAt": 1646310489889
},
"1006899|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>node-fetch": {
"decision": "fix",
"madeAt": 1646310489889
},
"1006886|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1646310498055,
"expiresAt": 1648902456937
},
"1007017|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1646310499107,
"expiresAt": 1648902456937
},
"1007144|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1646395146578,
"expiresAt": 1648987138007
},
"1007244|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1646395147848,
"expiresAt": 1648987138007
},
"1007244|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1646395147848,
"expiresAt": 1648987138007
},
"1007251|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "ignore",
"madeAt": 1646395148832,
"expiresAt": 1648987138007
},
"1007326|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1646395149794,
"expiresAt": 1648987138007
},
"1007326|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1646395149794,
"expiresAt": 1648987138007
},
"1007644|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1646395150747,
"expiresAt": 1648987138007
},
"1007852|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1646395151708,
"expiresAt": 1648987138007
},
"1007853|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1646395151708,
"expiresAt": 1648987138007
},
"1008008|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1646395152671,
"expiresAt": 1648987138007
}
},
"rules": {},
Expand Down
9 changes: 8 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
"PORT": 3003,
"HOSTNAME": "http://bulk-api-adapter",
"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 62afc4e

Please sign in to comment.