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

Duplicate Transfer Response Header validation failing on QA Framework #869

Closed
1 task done
mdebarros opened this issue Jul 18, 2019 · 2 comments
Closed
1 task done
Assignees
Labels
test-bug This is a bug in tests or test automation framework, not a code or functionality issue

Comments

@mdebarros
Copy link
Member

mdebarros commented Jul 18, 2019

Summary:
Duplicate Transfer Response Header validation failing on QA Framework. Header FSPIOP-Source should match switch and not the responding FSP-Id.

Severity:
High

Priority:
Critical

Expected Behavior

Duplicate Transfer Response Header validation Header FSPIOP-Source should match switch.

Steps to Reproduce

  1. duplicate_handling.transfers.original_transfer_at_committed.Send Transfer:
curl -X POST \
  http://dev2-ml-api-adapter.mojaloop.live/transfers \
  -H 'Accept: application/vnd.interoperability.transfers+json;version=1' \
  -H 'Content-Type: application/vnd.interoperability.transfers+json;version=1.0' \
  -H 'Date: Thu, 18 Jul 2019 14:24:08 GMT' \
  -H 'FSPIOP-Destination: payeefsp' \
  -H 'FSPIOP-Source: payerfsp' \
  -H 'Postman-Token: fc8811e9-6ec6-418c-9d9d-e0d3c78983fd' \
  -H 'cache-control: no-cache' \
  -d '{
  "transferId": "d4498575-310a-4228-9f27-3b3b81318afa",
  "payerFsp": "payerfsp",
  "payeeFsp": "payeefsp",
  "amount": {
    "amount": "1",
    "currency": "USD"
  },
  "expiration": "2019-07-18T14:41:49.794Z",
  "ilpPacket": "AQAAAAAAAADIEHByaXZhdGUucGF5ZWVmc3CCAiB7InRyYW5zYWN0aW9uSWQiOiIyZGY3NzRlMi1mMWRiLTRmZjctYTQ5NS0yZGRkMzdhZjdjMmMiLCJxdW90ZUlkIjoiMDNhNjA1NTAtNmYyZi00NTU2LThlMDQtMDcwM2UzOWI4N2ZmIiwicGF5ZWUiOnsicGFydHlJZEluZm8iOnsicGFydHlJZFR5cGUiOiJNU0lTRE4iLCJwYXJ0eUlkZW50aWZpZXIiOiIyNzcxMzgwMzkxMyIsImZzcElkIjoicGF5ZWVmc3AifSwicGVyc29uYWxJbmZvIjp7ImNvbXBsZXhOYW1lIjp7fX19LCJwYXllciI6eyJwYXJ0eUlkSW5mbyI6eyJwYXJ0eUlkVHlwZSI6Ik1TSVNETiIsInBhcnR5SWRlbnRpZmllciI6IjI3NzEzODAzOTExIiwiZnNwSWQiOiJwYXllcmZzcCJ9LCJwZXJzb25hbEluZm8iOnsiY29tcGxleE5hbWUiOnt9fX0sImFtb3VudCI6eyJjdXJyZW5jeSI6IlVTRCIsImFtb3VudCI6IjIwMCJ9LCJ0cmFuc2FjdGlvblR5cGUiOnsic2NlbmFyaW8iOiJERVBPU0lUIiwic3ViU2NlbmFyaW8iOiJERVBPU0lUIiwiaW5pdGlhdG9yIjoiUEFZRVIiLCJpbml0aWF0b3JUeXBlIjoiQ09OU1VNRVIiLCJyZWZ1bmRJbmZvIjp7fX19",
  "condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"
}'
  1. duplicate_handling.transfers.original_transfer_at_committed.Duplicate Transfer:
REQUEST:
curl -X POST \
  http://dev2-ml-api-adapter.mojaloop.live/transfers \
  -H 'Accept: application/vnd.interoperability.transfers+json;version=1' \
  -H 'Content-Type: application/vnd.interoperability.transfers+json;version=1.0' \
  -H 'Date: Thu, 18 Jul 2019 14:24:08 GMT' \
  -H 'FSPIOP-Destination: payeefsp' \
  -H 'FSPIOP-Source: payerfsp' \
  -H 'Postman-Token: 743f9ecb-b28e-438b-8297-2dbce464a819' \
  -H 'cache-control: no-cache' \
  -d '{
  "transferId": "d4498575-310a-4228-9f27-3b3b81318afa",
  "payerFsp": "payerfsp",
  "payeeFsp": "payeefsp",
  "amount": {
    "amount": "1",
    "currency": "USD"
  },
  "expiration": "2019-07-18T14:41:49.794Z",
  "ilpPacket": "AQAAAAAAAADIEHByaXZhdGUucGF5ZWVmc3CCAiB7InRyYW5zYWN0aW9uSWQiOiIyZGY3NzRlMi1mMWRiLTRmZjctYTQ5NS0yZGRkMzdhZjdjMmMiLCJxdW90ZUlkIjoiMDNhNjA1NTAtNmYyZi00NTU2LThlMDQtMDcwM2UzOWI4N2ZmIiwicGF5ZWUiOnsicGFydHlJZEluZm8iOnsicGFydHlJZFR5cGUiOiJNU0lTRE4iLCJwYXJ0eUlkZW50aWZpZXIiOiIyNzcxMzgwMzkxMyIsImZzcElkIjoicGF5ZWVmc3AifSwicGVyc29uYWxJbmZvIjp7ImNvbXBsZXhOYW1lIjp7fX19LCJwYXllciI6eyJwYXJ0eUlkSW5mbyI6eyJwYXJ0eUlkVHlwZSI6Ik1TSVNETiIsInBhcnR5SWRlbnRpZmllciI6IjI3NzEzODAzOTExIiwiZnNwSWQiOiJwYXllcmZzcCJ9LCJwZXJzb25hbEluZm8iOnsiY29tcGxleE5hbWUiOnt9fX0sImFtb3VudCI6eyJjdXJyZW5jeSI6IlVTRCIsImFtb3VudCI6IjIwMCJ9LCJ0cmFuc2FjdGlvblR5cGUiOnsic2NlbmFyaW8iOiJERVBPU0lUIiwic3ViU2NlbmFyaW8iOiJERVBPU0lUIiwiaW5pdGlhdG9yIjoiUEFZRVIiLCJpbml0aWF0b3JUeXBlIjoiQ09OU1VNRVIiLCJyZWZ1bmRJbmZvIjp7fX19",
  "condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"
}'

RESPONSE:
    x-forwarded-for:"10.1.2.123"
    content-type:"application/vnd.interoperability.transfers+json;version=1.0"
    fspiop-source:"payeefsp" <-- This failed as it should be `switch`
    fspiop-destination:"payerfsp"
    date:"2019-07-18T14:40:49.000Z"
    fspiop-signature:"{"signature":"abcJjvNrkyK2KBieDUbGfhaBUn75aDUATNF4joqA8OLs4QgSD7i6EO8BIdy6Crph3LnXnTM20Ai1Z6nt0zliS_qPPLU9_vi6qLb15FOkl64DQs9hnfoGeo2tcjZJ88gm19uLY_s27AJqC1GH1B8E2emLrwQMDMikwQcYvXoyLrL7LL3CjaLMKdzR7KTcQi1tCK4sNg0noIQLpV3eA61kess","protectedHeader":"eyJhbGciOiJSUzI1NiIsIkZTUElPUC1Tb3VyY2UiOiJwYXllZWZzcCIsIkZTUElPUC1EZXN0aW5hdGlvbiI6I    nBheWVyZnNwIiwiRlNQSU9QLVVSSSI6Ii90cmFuc2ZlcnMvZDQ0OTg1NzUtMzEwYS00MjI4LTlmMjctM        2IzYjgxMzE4YWZhIiwiRlNQSU9QLUhUVFAtTWV0aG9kIjoiUFVUIiwiRGF0ZSI6IiJ9"}"
    fspiop-http-method:"PUT"
    fspiop-uri:"/transfers/d4498575-310a-4228-9f27-3b3b81318afa"
data:
    fulfilment:"XoSz1cL0tljJSCp_VtIYmPNw-zFUgGfbUqf69AagUzY"
    completedTimestamp:"2019-07-18T14:40:49.930Z"
    transferState:"COMMITTED"

Specifications

  • Component (if known): central-ledger
  • Version: v7.1.2
  • Platform: All
  • Subsystem: n/a
  • Type of testing: QA Framework Golden Path
  • Bug found/raised by: @mdebarros

Notes:

  • Severity when opened: High
  • Priority when opened: Critical

PR:

@mdebarros mdebarros added the bug label Jul 18, 2019
@mdebarros mdebarros added the test-bug This is a bug in tests or test automation framework, not a code or functionality issue label Jul 18, 2019
@elnyry-sam-k elnyry-sam-k added this to the Sprint 7.2 milestone Jul 22, 2019
@lewisdaly lewisdaly self-assigned this Jul 24, 2019
@lewisdaly lewisdaly changed the title Duplcate Transfer Response Header validation failing on QA Framework Duplicate Transfer Response Header validation failing on QA Framework Jul 24, 2019
@lewisdaly
Copy link
Contributor

Looks like this bug is related to #868

In the ml-api-adapter src/handlers/notification/index.js, we have the following line to get the transferId:

const id = JSON.parse(decodedPayload.body.toString()).transferId || (content.uriParams && content.uriParams.id)

It seems that the central-ledger isn't setting this uriParams field once again, and the id is undefined in the notification handler on ml-api-adapter, causing downstream requests to fail and the error we see above.

@elnyry-sam-k
Copy link
Member

PR - mojaloop/ml-api-adapter#132 is now approved and merged, so closing this. A related issue to track about message IDs is here: #886

@elnyry-sam-k elnyry-sam-k removed this from the Sprint 7.2 milestone Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-bug This is a bug in tests or test automation framework, not a code or functionality issue
Projects
None yet
Development

No branches or pull requests

3 participants