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

mojaloop-simulator helm chart template is not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS value config #2083

Closed
Tracked by #2151
mdebarros opened this issue Feb 25, 2021 · 2 comments
Assignees
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service infra-bug An infrastructure issue or bug such as in helm charts or documentation oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it triaged This bug has been triaged by the triage team!
Milestone

Comments

@mdebarros
Copy link
Member

Summary:
When installing Mojaloop v12.0.0 and setting VALIDATE_INBOUND_JWS = "false" and pubKeyConfigMapName is not defined (or false) config values on the Mojaloop-simulator Helm chart <-- i.e. set simulators.${each.value}.config.schemeAdapter.env.VALIDATE_INBOUND_JWS to "false" as a string and not a boolean

The following error is displayed:

Error: template: mojaloop-simulator/templates/config-jws-public-keys.yaml:14:8: executing “mojaloop-simulator/templates/config-jws-public-keys.yaml” at <fail (printf “INBOUND_JWS enabled and jws public key not specified for ‘%s’. You need to specify %s.schemeAdapter.secrets.jws.publicKey or %s.schemeAdapter.secrets.jws.pubKeyConfigMapName.” $name $name $name)>: error calling fail: INBOUND_JWS enabled and jws public key not specified for ‘pm4mlsenderfsp’. You need to specify pm4mlsenderfsp.schemeAdapter.secrets.jws.publicKey or pm4mlsenderfsp.schemeAdapter.secrets.jws.pubKeyConfigMapName.

On line 12 of this template: https://github.com/mojaloop/helm/blob/master/mojaloop-simulator/templates/config-jws-public-keys.yaml#L12

You will notice that the if-statement is only comparing that the VALIDATE_INBOUND_JWS value is not "null" or false. So as long as the value is either a boolean true or is a string it will always be true.

Severity:
Low

Priority:
Low

Expected Behavior

The following if-statement should not be entered when https://github.com/mojaloop/helm/blob/master/mojaloop-simulator/templates/config-jws-public-keys.yaml#L12:

  1. When setting simulators.${each.value}.config.schemeAdapter.env.VALIDATE_INBOUND_JWS to a string such as "false" or "hello"
  2. When setting simulators.${each.value}.config.schemeAdapter.env.VALIDATE_INBOUND_JWS to a boolean false

Steps to Reproduce

  1. Install Mojaloop v12.0.0 release with simulators.${each.value}.config.schemeAdapter.env.VALIDATE_INBOUND_JWS to "false" as a string and not a boolean, and simulators.${each.value}.config.schemeAdapter.env.pubKeyConfigMapName not set/defined

Specifications

  • Component (if known): Mojaloop Helm
  • Version: v12.0.0
  • Platform: Helm
  • Subsystem:
  • Type of testing: Manual
  • Bug found/raised by: @mdebarros @dfry

Notes:

  • Severity when opened: Low
  • Priority when opened: Low
@mdebarros mdebarros added the bug Something isn't working or it has wrong behavior on a Mojaloop Core service label Feb 25, 2021
@mdebarros mdebarros changed the title mojaloop-simulator templates are not handling logical comparisons correctly against booleans mojaloop-simulator templates are not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS Feb 25, 2021
@mdebarros mdebarros changed the title mojaloop-simulator templates are not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS mojaloop-simulator helm chart template are not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS Feb 25, 2021
@mdebarros mdebarros changed the title mojaloop-simulator helm chart template are not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS mojaloop-simulator helm chart template is not handling booleans logical comparisons correctly against VALIDATE_INBOUND_JWS value config Feb 25, 2021
@elnyry-sam-k elnyry-sam-k added the triaged This bug has been triaged by the triage team! label Mar 29, 2021
@elnyry-sam-k elnyry-sam-k added infra-bug An infrastructure issue or bug such as in helm charts or documentation bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it and removed bug Something isn't working or it has wrong behavior on a Mojaloop Core service labels Jun 3, 2021
mdebarros added a commit to mojaloop/helm that referenced this issue Jun 9, 2021
@mdebarros
Copy link
Member Author

Fix applied in Helm 12.1.0 release -> mojaloop/helm@f423d4b

@elnyry-sam-k
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service infra-bug An infrastructure issue or bug such as in helm charts or documentation oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it triaged This bug has been triaged by the triage team!
Projects
None yet
Development

No branches or pull requests

2 participants