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

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 3, 2022
1 parent c0a36cf commit 5928511
Show file tree
Hide file tree
Showing 9 changed files with 385 additions and 179 deletions.
10 changes: 10 additions & 0 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@
"decision": "ignore",
"madeAt": 1645104323030,
"expiresAt": 1647696313138
},
"1007050|@mojaloop/central-services-shared>widdershins>urijs": {
"decision": "ignore",
"madeAt": 1646235001499,
"expiresAt": 1648826992822
},
"1007017|00unidentified>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1646300189108,
"expiresAt": 1648892183526
}
},
"rules": {},
Expand Down
9 changes: 8 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@
"generateTimeout": 30000
},
"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 5928511

Please sign in to comment.