Skip to content

Commit

Permalink
remove auth lookup and ods pointer headers
Browse files Browse the repository at this point in the history
  • Loading branch information
eesa456 committed Jun 27, 2024
1 parent 56d4c86 commit 2be795f
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,8 @@
nrlPermissions = permissions;
}

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

if(enableAuthorizationLookup == "true") {
enableAuthorizationLookup = true
} else if (enableAuthorizationLookup === null || enableAuthorizationLookup == "false") {
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 (!hasAllPointerPermissions && (!enableAuthorizationLookup && !nrlPointerTypes)) {
//This will trigger RaiseFault.403NoPointers.xml - see targets/target.xml
return;
}

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 @@ -90,7 +59,6 @@
var connectionMetadata = {
"nrl.ods-code": odsCode,
"nrl.ods-code-extension": odsCodeExtension,
"nrl.pointer-types": pointerTypes,
"nrl.enable-authorization-lookup": enableAuthorizationLookup,
"nrl.app-id": nrlAppID
};
Expand Down

0 comments on commit 2be795f

Please sign in to comment.