Skip to content

Commit

Permalink
remove labeling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mojitoj committed Jan 16, 2025
1 parent 2ec4daa commit 99a622c
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 556 deletions.
4 changes: 0 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const { error } = require("./controllers/error");
const { discovery } = require("./controllers/discovery");
const ConsentDecisionHook = require("./controllers/patient-consent-consult");
const Xacml = require("./controllers/xacml");
const SLS = require("./controllers/sls");
const SLSHook = require("./controllers/bundle-security-label");

const app = express();

Expand All @@ -26,8 +24,6 @@ app.get("/cds-services", discovery);

app.post("/cds-services/patient-consent-consult", ConsentDecisionHook.post);
app.post("/xacml", Xacml.post);
app.post("/sls", SLS.post);
app.post("/cds-services/bundle-security-label", SLSHook.post);

app.use(error);

Expand Down
19 changes: 0 additions & 19 deletions controllers/bundle-security-label.js

This file was deleted.

15 changes: 0 additions & 15 deletions controllers/sls.js

This file was deleted.

6 changes: 1 addition & 5 deletions lib/decision-processor.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
const { CONSENT_PERMIT } = require("./consent-decisions");
const { maybeRedactBundle } = require("./redacter");
const { label } = require("./labeling/labeler");

const maybeApplyDecision = (decisionEntry, content) => {
return content && decisionEntry.decision === CONSENT_PERMIT
? {
...decisionEntry,
content: maybeRedactBundle(
decisionEntry.obligations,
label(content)
)
content: maybeRedactBundle(decisionEntry.obligations, content)
}
: decisionEntry;
};
Expand Down
1 change: 0 additions & 1 deletion lib/labeling/confidentiality-rules.json

This file was deleted.

130 changes: 0 additions & 130 deletions lib/labeling/labeler.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/labeling/sensitivity-rules.json

This file was deleted.

15 changes: 0 additions & 15 deletions lib/labeling/sls-decision-hooks-response.js

This file was deleted.

23 changes: 1 addition & 22 deletions lib/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ const consentDecisionHookRequestValidator = ajv.compile(
const xacmlRequestSchema = require("../schemas/xacml-request.schema.json");
const xacmlRequestValidator = ajv.compile(xacmlRequestSchema);

const slsRequestSchema = require("../schemas/sls-request.schema.json");
const slsRequestValidator = ajv.compile(slsRequestSchema);

const slsHookRequestSchema = require("../schemas/bundle-security-label-request.schema.json");
const slsHookRequestValidator = ajv.compile(slsHookRequestSchema);

const validationException = (errors) => ({
httpCode: 400,
error: "bad_request",
Expand All @@ -36,19 +30,6 @@ function validateXacmlRequest(req) {
}
}

function validateSlsRequest(req) {
const body = req.body;
if (!slsRequestValidator(body)) {
throw validationException(slsRequestValidator.errors);
}
}

function validateSlsHookRequest(req) {
const body = req.body;
if (!slsHookRequestValidator(body)) {
throw validationException(slsHookRequestValidator.errors);
}
}

function prettifySchemaValidationErrors(givenErrors) {
const errors = givenErrors || [];
Expand All @@ -59,7 +40,5 @@ function prettifySchemaValidationErrors(givenErrors) {

module.exports = {
validateConsentDecisionHookRequest,
validateXacmlRequest,
validateSlsRequest,
validateSlsHookRequest
validateXacmlRequest
};
51 changes: 0 additions & 51 deletions schemas/bundle-security-label-request.schema.json

This file was deleted.

45 changes: 0 additions & 45 deletions schemas/sls-request.schema.json

This file was deleted.

Loading

0 comments on commit 99a622c

Please sign in to comment.