From d561979ee7304a9746fef8e2b4293ffc03fb6ef6 Mon Sep 17 00:00:00 2001 From: akumar Date: Wed, 11 Dec 2024 12:11:06 +0100 Subject: [PATCH] fix: remove data from ACS check --- cfg/config.json | 1 + src/schedulingService.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cfg/config.json b/cfg/config.json index d1314bc..96f8467 100644 --- a/cfg/config.json +++ b/cfg/config.json @@ -66,6 +66,7 @@ "items.[0].tokens", "messages.[0].tokens", "request.items.[0].tokens", + "request.items.[0].data", "response.payload.token", "response.payload.tokens", "request.subject.token", diff --git a/src/schedulingService.ts b/src/schedulingService.ts index 6f4819a..5fcce2e 100644 --- a/src/schedulingService.ts +++ b/src/schedulingService.ts @@ -441,7 +441,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation try { if (!ctx) { ctx = {}; }; ctx.subject = subject; - ctx.resources = request?.items; + ctx.resources = request?.items?.map((data, ...job) => job); acsResponse = await checkAccessRequest(ctx, [{ resource: 'job', id: request.items.map(item => item.id) @@ -1156,7 +1156,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation try { if (!ctx) { ctx = {}; }; ctx.subject = subject; - ctx.resources = request?.items; + ctx.resources = request?.items?.map((data, ...obj) => obj); acsResponse = await checkAccessRequest(ctx, [{ resource: 'job', id: request.items.map(item => item.id) }], AuthZAction.MODIFY, Operation.isAllowed); @@ -1240,7 +1240,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation try { if (!ctx) { ctx = {}; }; ctx.subject = subject; - ctx.resources = request.items; + ctx.resources = request?.items?.map((data, ...job) => job);; acsResponse = await checkAccessRequest(ctx, [{ resource: 'job', id: request.items.map(item => item.id) }], AuthZAction.MODIFY, Operation.isAllowed);