Skip to content

Commit

Permalink
Merge branch 'master' of github.com:NHSDigital/nrl-producer-api into …
Browse files Browse the repository at this point in the history
…APM-000-remove-newman
  • Loading branch information
Tomdango committed Jan 24, 2024
2 parents d6ee535 + 970707c commit de1fb68
Show file tree
Hide file tree
Showing 21 changed files with 824 additions and 941 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ install-python:
#Installs dependencies using npm.
install-node:
npm install --legacy-peer-deps
cd sandbox && npm install --legacy-peer-deps

#Configures Git Hooks, which are scipts that run given a specified event.
.git/hooks/pre-commit:
Expand Down Expand Up @@ -42,9 +41,6 @@ _dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/
release: clean publish build-proxy
mkdir -p dist
for f in $(_dist_include); do cp -r $$f dist; done
cp ecs-proxies-deploy.yml dist/ecs-deploy-sandbox.yml
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-qa-sandbox.yml
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-dev-sandbox.yml

#Command to run end-to-end smoktests post-deployment to verify the environment is working
smoketest:
Expand Down
4 changes: 0 additions & 4 deletions ecs-proxies-containers.yml

This file was deleted.

13 changes: 0 additions & 13 deletions ecs-proxies-deploy.yml

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"license": "MIT",
"homepage": "https://github.com/NHSDigital/nrl-producer-api",
"dependencies": {
"newman-reporter-htmlextra": "^1.22.11"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.5.1",
Expand Down
934 changes: 436 additions & 498 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions proxies/live/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
</Flow>
<Flow name="CorsHeaders">
<!-- This must be the last item in the flow -->
<Request/>
<Response>
<Step>
<Name>AssignMessage.AddCors</Name>
Expand Down Expand Up @@ -72,8 +71,13 @@
<TargetEndpoint>nrl-producer-api-target</TargetEndpoint>
</RouteRule>
<DefaultFaultRule>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
</Step>
</DefaultFaultRule>
<AlwaysEnforce>true</AlwaysEnforce>
<Step>
<Name>AssignMessage.AddCors</Name>
</Step>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
<Condition>(response.content NOT Like "*OperationOutcome*")</Condition>
</Step>
</DefaultFaultRule>
</ProxyEndpoint>
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,39 @@
return;
}

var enableAuthorizationLookup = context.getVariable("app.enable-authorization-lookup");

if(enableAuthorizationLookup == "true") {
enableAuthorizationLookup = true
} else if (enableAuthorizationLookup === null) {
enableAuthorizationLookup = false
} else {
//This will trigger RaiseFault.403NoPointers.xml - see targets/target.xml
return;
}


var pointerTypes = [];
// Read the associated `nrl-ods-<ods_code>` custom attribute from the APIGEE app
var nrlPointerTypes = context.getVariable("app.nrl-ods-" + odsCode);
if (!nrlPointerTypes) {

if ((enableAuthorizationLookup === true && nrlPointerTypes) || (enableAuthorizationLookup === false && !nrlPointerTypes)) {
//This will trigger RaiseFault.403NoPointers.xml - see targets/target.xml
return;
}

// Convert it into a complex object
var lines = nrlPointerTypes.split(/\s+/);
var pointerTypes = [];
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
if (line && line.trim().length !== 0) {
pointerTypes.push(line);
if (nrlPointerTypes){
// Convert it into a complex object
var lines = nrlPointerTypes.split(/\s+/);

for (var i = 0; i < lines.length; i++) {
var line = lines[i];
if (line && line.trim().length !== 0) {
pointerTypes.push(line);
}
}
}
}


var odsCodeExtension = context.getVariable(
"request.header.NHSD-End-User-Organisation"
Expand All @@ -56,6 +73,7 @@
"nrl.ods-code": odsCode,
"nrl.ods-code-extension": odsCodeExtension,
"nrl.pointer-types": pointerTypes,
"nrl.enable-authorization-lookup": enableAuthorizationLookup
};

var nrlPermissions = context.getVariable("app.nrl-permissions");
Expand Down
6 changes: 5 additions & 1 deletion proxies/sandbox/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
</Flow>
<Flow name="CorsHeaders">
<!-- This must be the last item in the flow -->
<Request/>
<Response>
<Step>
<Name>AssignMessage.AddCors</Name>
Expand Down Expand Up @@ -73,8 +72,13 @@
<TargetEndpoint>sandbox</TargetEndpoint>
</RouteRule>
<DefaultFaultRule>
<AlwaysEnforce>true</AlwaysEnforce>
<Step>
<Name>AssignMessage.AddCors</Name>
</Step>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
<Condition>(response.content NOT Like "*OperationOutcome*")</Condition>
</Step>
</DefaultFaultRule>
</ProxyEndpoint>
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = []
readme = 'README.md'
license = "MIT"
repository = "https://github.com/NHSDigital/nrl-producer-api"
homepage = ""
homepage = "https://digital.nhs.uk/developer/api-catalogue/national-record-locator-fhir/v3/producer"
keywords = ["healthcare", "uk", "nhs"]


Expand All @@ -26,7 +26,7 @@ pyyaml = "^5.2"
docopt = "^0.6.2"
jsonpath-rw = "^1.4.0"
semver = "^2.9.0"
gitpython = "^3.0.5"
gitpython = "^3.1.35"
pytest = "^6.1.2"
coverage = "^5.5"
aiohttp = "^3.7.3"
Expand Down
2 changes: 0 additions & 2 deletions sandbox/.dockerignore

This file was deleted.

17 changes: 0 additions & 17 deletions sandbox/.eslintrc.js

This file was deleted.

4 changes: 0 additions & 4 deletions sandbox/.mocharc.yml

This file was deleted.

11 changes: 0 additions & 11 deletions sandbox/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions sandbox/Makefile

This file was deleted.

133 changes: 0 additions & 133 deletions sandbox/app.js

This file was deleted.

Loading

0 comments on commit de1fb68

Please sign in to comment.