Skip to content

Commit 6c13d1b

Browse files
Merge pull request #2079 from NHSDigital/develop
APIM-R 1.41 Cut
2 parents 6d1f55e + e6f5c0d commit 6c13d1b

File tree

151 files changed

+5279
-1492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+5279
-1492
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ lint: copy-examples
1818
cd sandbox && make lint
1919
poetry run python scripts/xml_validator.py
2020
poetry run flake8 **/*.py
21+
poetry check
2122
@printf "\nLinting passed.\n\n"
2223

2324
clean:

package-lock.json

Lines changed: 1155 additions & 738 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"license": "MIT",
1313
"homepage": "https://github.com/NHSDigital/e-referrals-service-api",
1414
"dependencies": {
15-
"@redocly/cli": "^1.25.15"
15+
"@redocly/cli": "^1.27.2"
1616
},
1717
"devDependencies": {
1818
"apigeetool": "^0.16.5",

poetry.lock

Lines changed: 147 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessage.AddBaseUrlHeader">
2+
<Set>
3+
<Headers>
4+
<Header name="x-ers-sandbox-baseurl">https://{request.header.Host}/{proxy.basepath}</Header>
5+
</Headers>
6+
</Set>
7+
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
8+
<AssignTo createNew="false"/>
9+
</AssignMessage>

proxies/sandbox/apiproxy/targets/sandbox.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
<Response/>
88
</PostFlow>
99
<PreFlow name="PreFlow">
10-
<Request/>
11-
<Response></Response>
10+
<Request>
11+
<Step>
12+
<Name>AssignMessage.AddBaseUrlHeader</Name>
13+
</Step>
14+
</Request>
15+
<Response/>
1216
</PreFlow>
1317
<HTTPTargetConnection>{{ HOSTED_TARGET_CONNECTION }}</HTTPTargetConnection>
1418
</TargetEndpoint>

pyproject.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
[project]
22
python = "^3.8"
3-
4-
5-
[tool.poetry]
63
name = "e-referrals-service-api"
74
version = "0.0.1-alpha"
85
description = "TODO"
9-
package-mode = false
10-
116
license = "MIT"
127

138
authors = [
149
]
1510

1611
readme = 'README.md'
17-
1812
repository = "https://github.com/NHSDigital/e-referrals-service-api"
19-
2013
keywords = ["healthcare", "uk", "nhs"] #TODO add additional keywords
14+
dynamic = ["dependencies", "requires-python"]
15+
16+
[tool.poetry]
17+
package-mode = false
18+
19+
2120

2221

2322
[tool.poetry.dependencies]
@@ -26,21 +25,21 @@ pyyaml = "^6.0"
2625
docopt = "^0.6.2"
2726
jsonpath-rw = "^1.4.0"
2827
semver = "^3.0.2"
29-
gitpython = "^3.1.43"
28+
gitpython = "^3.1.44"
3029
lxml = "^4.9.4"
3130
xmlformatter = "^0.2.8"
3231
pytest-check = "^2.4.1"
3332
requests = "^2.32.3"
3433
openapi-core = "^0.19.4"
3534

3635

37-
[tool.poetry.dev-dependencies]
36+
[tool.poetry.group.dev.dependencies]
3837
flake8 = "^7.1.1"
3938
black = "^24.8"
4039
pip-licenses = "^5.0.0"
41-
jinja2 = "^3.1.4"
40+
jinja2 = "^3.1.5"
4241
pytest = "^8.3.4"
43-
pytest-asyncio = "^0.24.0"
42+
pytest-asyncio = "^0.25.2"
4443
pytest-nhsd-apim = "^3.4.3"
4544

4645
[tool.poetry.scripts]

sandbox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:18.3.0-alpine3.14
22

3-
ENV npm_config_cache /home/node/app/.npm
3+
ENV npm_config_cache=/home/node/app/.npm
44

55
WORKDIR /app
66

sandbox/package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sandbox/src/app.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@ const Inert = require('@hapi/inert')
44
const process = require('process')
55
const routes = require('./routes')
66

7+
/*
8+
The purpose of this logic is to mirror the transformations the API proxy currently applies to responses.
9+
This allows the sandbox to have the same behaviour locally.
10+
*/
711
const addCommonHeaders = function (request, response) {
812
// if a response doesn't include any headers provide an empty object to allow for the common headers to be appended.
913
if (!response.headers) {
1014
response.headers = {}
1115
}
1216

17+
// API proxy always adds x-correlation-id to responses.
1318
if (request.headers["x-correlation-id"]) {
1419
response.headers["X-Correlation-ID"] = request.headers["x-correlation-id"]
1520
}
16-
response.headers["X-Request-ID"] = '58621d65-d5ad-4c3a-959f-0438e355990e-1'
21+
22+
if (!request.path.includes("/ObjectStore")) {
23+
response.headers["X-Request-ID"] = '58621d65-d5ad-4c3a-959f-0438e355990e-1'
24+
}
1725
}
1826

1927
const preResponse = function (request, h) {

0 commit comments

Comments
 (0)