account-lookup-service 17.10.2 → 17.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [17.10.3](https://github.com/mojaloop/account-lookup-service/compare/v17.10.2...v17.10.3) (2025-06-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * ensure timeout callbacks have content-type headers ([#555](https://github.com/mojaloop/account-lookup-service/issues/555)) ([3850241](https://github.com/mojaloop/account-lookup-service/commit/38502419d1900e5ccef869ddde07274974efb62d))
11
+
5
12
  ### [17.10.2](https://github.com/mojaloop/account-lookup-service/compare/v17.10.1...v17.10.2) (2025-06-23)
6
13
 
7
14
 
@@ -24,15 +24,18 @@
24
24
  },
25
25
  "PROTOCOL_VERSIONS": {
26
26
  "CONTENT": {
27
- "DEFAULT": "1.1",
27
+ "DEFAULT": "2.0",
28
28
  "VALIDATELIST": [
29
+ "2.0",
29
30
  "1.1",
30
31
  "1.0"
31
32
  ]
32
33
  },
33
34
  "ACCEPT": {
34
- "DEFAULT": "1",
35
+ "DEFAULT": "2",
35
36
  "VALIDATELIST": [
37
+ "2",
38
+ "2.0",
36
39
  "1",
37
40
  "1.0",
38
41
  "1.1"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "account-lookup-service",
3
3
  "description": "Account Lookup Service is used to validate Party and Participant lookups.",
4
- "version": "17.10.2",
4
+ "version": "17.10.3",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
@@ -94,7 +94,7 @@
94
94
  "@mojaloop/central-services-health": "15.1.0",
95
95
  "@mojaloop/central-services-logger": "11.9.0",
96
96
  "@mojaloop/central-services-metrics": "12.6.0",
97
- "@mojaloop/central-services-shared": "18.28.2",
97
+ "@mojaloop/central-services-shared": "18.28.3",
98
98
  "@mojaloop/central-services-stream": "11.7.0",
99
99
  "@mojaloop/database-lib": "11.2.0",
100
100
  "@mojaloop/event-sdk": "14.6.1",
@@ -31,9 +31,10 @@ const { decodePayload } = require('@mojaloop/central-services-shared').Util.Stre
31
31
  const { initStepState } = require('../../../lib/util')
32
32
  const { createCallbackHeaders } = require('../../../lib/headers')
33
33
  const { ERROR_MESSAGES } = require('../../../constants')
34
+ const { makeAcceptContentTypeHeader } = require('@mojaloop/central-services-shared').Util.Headers
34
35
 
35
36
  const { FspEndpointTypes, FspEndpointTemplates } = Enum.EndPoints
36
- const { Headers, RestMethods } = Enum.Http
37
+ const { Headers, RestMethods, HeaderResources } = Enum.Http
37
38
 
38
39
  /**
39
40
  * @typedef {Object} PartiesDeps
@@ -246,10 +247,15 @@ class BasePartiesService {
246
247
  return cbHeaders
247
248
  }
248
249
 
249
- static createHubErrorCallbackHeaders (hubName, destination) {
250
+ static createHubErrorCallbackHeaders (hubName, destination, config) {
250
251
  return {
251
252
  [Headers.FSPIOP.SOURCE]: hubName,
252
- [Headers.FSPIOP.DESTINATION]: destination
253
+ [Headers.FSPIOP.DESTINATION]: destination,
254
+ [Headers.GENERAL.CONTENT_TYPE.value]: makeAcceptContentTypeHeader(
255
+ HeaderResources.PARTIES,
256
+ config.PROTOCOL_VERSIONS.CONTENT.DEFAULT.toString(),
257
+ config.API_TYPE
258
+ )
253
259
  }
254
260
  }
255
261
 
@@ -41,7 +41,7 @@ class TimeoutPartiesService extends PutPartiesErrorService {
41
41
  */
42
42
  static createInstance (deps, cacheKey, spanName) {
43
43
  const { destination, partyType, partyId } = TimeoutPartiesService.parseExpiredKey(cacheKey)
44
- const headers = TimeoutPartiesService.createHubErrorCallbackHeaders(deps.config.HUB_NAME, destination)
44
+ const headers = TimeoutPartiesService.createHubErrorCallbackHeaders(deps.config.HUB_NAME, destination, deps.config)
45
45
  const params = { Type: partyType, ID: partyId } // todo: think, if we need to handle party SubId
46
46
  const childSpan = createSpan(spanName, headers, params)
47
47
 
@@ -91,10 +91,12 @@ describe('Timeout Handler', () => {
91
91
  expect(await checkKeysExistence(keys)).toEqual([0, 0])
92
92
 
93
93
  expect(history.length).toBe(2)
94
- const path0 = history.find(h => h.path.includes(partyIds[0])).path
95
- const path1 = history.find(h => h.path.includes(partyIds[1])).path
96
- expect(path0).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[0]}/error`)
97
- expect(path1).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[1]}/error`)
94
+ const entry0 = history.find(h => h.path.includes(partyIds[0]))
95
+ const entry1 = history.find(h => h.path.includes(partyIds[1]))
96
+ expect(entry0.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[0]}/error`)
97
+ expect(entry1.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyIds[1]}/error`)
98
+ expect(entry0.headers['content-type']).toContain('parties')
99
+ expect(entry1.headers['content-type']).toContain('parties')
98
100
  })
99
101
 
100
102
  it('should pass timeoutProxyGetPartiesLookups flow', async () => {
@@ -122,9 +124,11 @@ describe('Timeout Handler', () => {
122
124
  expect(await checkKeysExistence(keys)).toEqual([0, 0])
123
125
 
124
126
  expect(history.length).toBe(2)
125
- const path1 = history.find(h => h.path.includes(partyId1)).path
126
- const path2 = history.find(h => h.path.includes(partyId2)).path
127
- expect(path1).toBe(`/parties/${PARTY_ID_TYPE}/${partyId1}/error`)
128
- expect(path2).toBe(`/parties/${PARTY_ID_TYPE}/${partyId2}/error`)
127
+ const entry1 = history.find(h => h.path.includes(partyId1))
128
+ const entry2 = history.find(h => h.path.includes(partyId2))
129
+ expect(entry1.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyId1}/error`)
130
+ expect(entry2.path).toBe(`/parties/${PARTY_ID_TYPE}/${partyId2}/error`)
131
+ expect(entry1.headers['content-type']).toContain('parties')
132
+ expect(entry2.headers['content-type']).toContain('parties')
129
133
  })
130
134
  })