Skip to content
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

fix(mojaloop/#2534): fspiop api version negotiation not handled by account lookup service #430

Conversation

mdebarros
Copy link
Member

@mdebarros mdebarros commented Oct 20, 2021

  • chore: updated dependencies

    • updated dependencies
    • fixes for audit-resolve
    • added eslint* to ncurc file due to compatibility-issues with standard
    • added get-port to ncurc file due to breaking-changes/compatibility-issues with Node ES version support
  • fix(mojaloop/#2534): fspiop api version negotiation not handled by account lookup service - FSPIOP API version negotiation not handled - Account-lookup-service project#2534

    • added getOptionsForFSPIOPHeaderValidation to the plugin configuration
    • added new config key for PROTOCOL_VERSIONS to default and integration configs
    • added DEFAULT_PROTOCOL_VERSION for backward compatibility
    • updated config and unit tests to FSPIOP v1.1 protocol version
    • ALS_PROTOCOL_VERSIONS__ACCEPT__VALIDATELIST can be set as follows "[ "1", "1.1"]" and it will be parsed correctly into a object
    • Note that ALS_PROTOCOL_VERSIONS__ACCEPT__VALIDATELIST is not currently used by the Account-lookup-service, I have not included this in the default.json, but it can be set (when implemented in future). I have also added a comment in the config.js to reflect this.
    • Added unit tests for config changes

BREAKING CHANGE: Forcing a major version change for awareness of the config changes. The LIB_RESOURCE_VERSIONS env var is now deprecated, and this is now also controlled by the PROTOCOL_VERSIONS config in the default.json. This has been done for consistency between all API services going forward and unifies the config for both inbound and outbound Protocol API validation/transformation features.

…ansfers service

- chore: updated dependencies
    - updated dependencies
    - fixes for audit-resolve
    - added eslint* to ncurc file due to compatibility-issues with standard
    - added get-port to ncurc file due to breaking-changes/compatibility-issues with Node ES version support

- fix(mojaloop/#2536): fspiop api version negotiation not handled by transfers service - mojaloop/project#2536
    - added getOptionsForFSPIOPHeaderValidation to the plugin configuration
    - added new config key for PROTOCOL_VERSIONS to default and integration configs
    - added DEFAULT_PROTOCOL_VERSION for backward compatibility
elnyry-sam-k
elnyry-sam-k previously approved these changes Oct 20, 2021
@mdebarros mdebarros changed the title fix(mojaloop/#2536): fspiop api version negotiation not handled by transfers service fix(mojaloop/#2534): fspiop api version negotiation not handled by account lookup service Oct 29, 2021
…DATELIST

- ALS_PROTOCOL_VERSIONS__ACCEPT__VALIDATELIST can be set as follows "[ \"1\", \"1.1\"]" and it will be parsed correctly into a object
- Note that MLAPI_PROTOCOL_VERSIONS__ACCEPT__DEFAULT is not currently used by the Account-lookup-service, I have not included this in the default.json, but it can be set (when implemented in future). I have also added a comment in the config.js to reflect this.
- updated dependencies & fixed audit-resolve issues

BREAKING CHANGE: Forcing a major version change for awareness of the config changes. The `LIB_RESOURCE_VERSIONS` env var is now deprecated, and this is now also controlled by the PROTOCOL_VERSIONS config in the default.json. This has been done for consistency between all API services going forward and unifies the config for both inbound and outbound Protocol API validation/transformation features.
Copy link
Contributor

@lewisdaly lewisdaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good to me - is there a new test case that needs to be added to make sure this issue doesn't come back again? How about a test case for if someone mis-configures the PROTOCOL_VERSION dict?

@mdebarros
Copy link
Member Author

mdebarros commented Nov 3, 2021

The implementation looks good to me - is there a new test case that needs to be added to make sure this issue doesn't come back again? How about a test case for if someone mis-configures the PROTOCOL_VERSION dict?

I think that should be addressed in future: create a new story to replace RC with something more modern (i.e. Convict) which would be best suited for this purpose, and ensure that the replacement library will allow us to define a schema so that we can validate the config against for validation purposes.

I think it would be a wiser and better time spent, as there is currently NO validation for any configurations on most of Mojaloop's service.

Let me know your thoughts.

@elnyry-sam-k
Copy link
Member

looks good.. @lewisdaly any further comments?

@mdebarros mdebarros merged commit f1cf4a3 into mojaloop:master Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants