-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore usage of v1.1 and v1.0 with same mojaloop release #2660
Comments
Delta changesBackgroundCurrently, the Content-type is validated against a single value injected by a config (e.g. ml-api-adapter) that matches as follows: "PROTOCOL_VERSIONS": {
"CONTENT": "1.1", <-- used to validate incoming CONTENT-TYPE header, and value used for content-type headers when requests are generated by the "switch"
"ACCEPT": {
"DEFAULT": "1", <-- value used for ACCEPT headers when requests are generated by the "switch"
"VALIDATELIST": [ <-- used to validate incoming accept headers
"1",
"1.1"
]
}
} These changes have been introduced as fixes for the mojaloop/project//issues/2536 bug which has been included in the WIP v13.1.0 release. Code changesTo simplify and improve backward compatibility, I propose the following changes:
Split the CONTENT section to match the ACCEPT structure as follows: "PROTOCOL_VERSIONS": {
"CONTENT": {
"DEFAULT": "1.1", <-- value used for CONTENT-TYPE headers when requests are generated by the "switch"
"VALIDATELIST": [ <-- used to validate incoming CONTENT-TYPE headers
"1.0",
"1.1"
]
}
"ACCEPT": {
"DEFAULT": "1", <-- value used for ACCEPT headers when requests are generated by the "switch"
"VALIDATELIST": [ <-- used to validate incoming ACCEPT headers
"1",
"1.0",
"1.1"
]
}
}
Update the headerValidation HAPIjs Plugin to support the above-proposed changes.
The following components will need to be updated with the above changes:
The following components will need to be updated with the above changes:
Helm chart changesThe following Helm charts will need to be update to support the config changes proposed above:
Quality AssuranceThe following functional tests are required to fully test and validate FSPIOP backward compatibility support, but before that we must first ensure the following Actors have been defined and configured on the test environment:
The test scenarios make the assumption that all actors support the latest FSPIOP v1.1, but some have been configured to operate at v1.0 for testing purposes. This is why Scenario 4 is possible. In the situation where the sender FSP All tests must validate CONTENT-TYPE & ACCEPT headers for involved actors.
Request flow : Callback flow: Test-cases:
Request flow : Callback flow: Test-cases:
Request flow : Callback flow: Test-cases:
Request flow : Callback flow: Test-cases:
Note: This scenario is only possible because FSP3 does support FSPIOP v1.1, but has been configured to generate requests with FSPIOP v1.0. If FSP3 only supported FSPIOP v1.0, then the callback is expected to fail since FSP3 would not support FSPIOP v1.1 protocols. See point 2 in considerations. Considerations
|
Further thinking about this, and taking into consideration that the swagger already validates the incoming CONTENT-TYPE to make sure it matches a This will result in the following sync error: {
"status": 400,
"statusText": "Bad Request",
"body": {
"errorInformation": {
"errorCode": "3101",
"errorDescription": "Malformed syntax - Invalid content-type header"
}
},
"headers": {
"content-type": "application/json; charset=utf-8",
"cache-control": "no-cache",
"content-length": "109",
"date": "Thu, 10 Feb 2022 08:54:36 GMT",
"connection": "keep-alive"
}
} Taking this into consideration, we could further simplify the config to the following: "PROTOCOL_VERSIONS": {
"CONTENT": {
"DEFAULT": "1.1", <-- same as initial proposal
}
"ACCEPT": {
"DEFAULT": "1", <-- same as initial proposal
},
"VALIDATELIST": [ <-- used to validate incoming ACCEPT & CONTENT-TYPE headers
"1", <-- this would be filtered out by the swagger validation for CONTENT-TYPE, but it does make the assumption that the swagger will always filter out this kind of request which is a concern.
"1.0",
"1.1"
]
} However, I am still leaning toward my initial proposal based on my in-line comment above. Just including this here as part of the thought process. |
… api compatibility - updated FSPIOPHeaderValidation options based on mojaloop/project#2660 to accept a validationList for the content-type - updated dependencies - fixed audit issues
… api compatibility - updated default.json based on mojaloop/project#2660 - re-factored config to load the changes correctly - updated plugins to correctly configure the FSPIOPHeaderValidation options - fixed unit tests TODO: update latest central-services-shared release after merging mojaloop/central-services-shared#325
… api compatibility - 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
… api compatibility - 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
… api compatibility - 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
… api compatibility (#325) feat(mojaloop/#2704): core-services support for non-breaking backward api compatibility - mojaloop/project#2704 - updated FSPIOPHeaderValidation options based on mojaloop/project#2660 to accept a validationList for the content-type - updated dependencies - fixed audit issues BREAKING CHANGE: - headerValidation.FSPIOPHeaderValidation now expects the`supportedProtocolContentVersions` options argument to be a list, the same as `supportedProtocolAcceptVersions`
… api compatibility - 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
… 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" > ] > } > }, > ```
… 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" > ] > } > }, > ```
… api compatibility (#436) 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" > ] > } > }, > ```
… api compatibility (#85) 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" > ] > } > }, > ```
… 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" > ] > } > }, > ```
The following stories/issues have been created as a result of this investigation:
Notes:
|
@elnyry-sam-k am I missing anything from this list? |
… api compatibility (#66) feat(mojaloop/[#2704](https://github.com/mdebarros/ml-api-adapter/issues/2704)): core-services support for non-breaking backward api compatibility - mojaloop/project#2704 - added new feature_test: collections/hub/golden_path/feature_tests/backward_compatibility/fspiop_protocol_validation.json which asserts validations against correct current, old and not-supported versions for parties, quotes, transfers, and transactionRequests - added new feature_test: collections/hub/other_tests/bulk_transfers/fspiop_protocol_validation.json which asserts validations against correct current, old and not-supported versions for bulkTransfers These are a sub-set of tests as a result of the following investigatory issue: mojaloop/project#2660
Goal:
As an
adopter of MojaloopI want to
understand if a Mojaloop release (v13.1.0 RC) can support FSPIOP API v1.1 and v1.0 (in headers)so that
I can plan adoption and deployment accordinglyAcceptance Criteria:
Complexity: Medium
Uncertainty: Medium
Tasks:
Done
Pull Requests:
Follow-up:
Dependencies:
Accountability:
The text was updated successfully, but these errors were encountered: