diff --git a/apps/policy-engine/src/app/__test__/unit/app.service.spec.ts b/apps/policy-engine/src/app/__test__/unit/app.service.spec.ts index 909e8f2f9..0e41fe75e 100644 --- a/apps/policy-engine/src/app/__test__/unit/app.service.spec.ts +++ b/apps/policy-engine/src/app/__test__/unit/app.service.spec.ts @@ -10,12 +10,14 @@ describe('finalizeDecision', () => { reasons: [ { policyId: 'forbid-rule-id', + policyName: 'Forbid Rule', type: 'forbid', approvalsMissing: [], approvalsSatisfied: [] }, { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [], approvalsSatisfied: [] @@ -34,12 +36,14 @@ describe('finalizeDecision', () => { reasons: [ { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [], approvalsSatisfied: [] }, { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [], approvalsSatisfied: [] @@ -58,6 +62,7 @@ describe('finalizeDecision', () => { reasons: [ { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [ { @@ -111,6 +116,7 @@ describe('finalizeDecision', () => { reasons: [ { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [missingApproval], approvalsSatisfied: [satisfiedApproval] @@ -122,6 +128,7 @@ describe('finalizeDecision', () => { reasons: [ { policyId: 'permit-rule-id', + policyName: 'Permit Rule', type: 'permit', approvalsMissing: [missingApproval2], approvalsSatisfied: [satisfiedApproval2] diff --git a/apps/policy-engine/src/main.ts b/apps/policy-engine/src/main.ts index 6ff41288b..9c69e1132 100644 --- a/apps/policy-engine/src/main.ts +++ b/apps/policy-engine/src/main.ts @@ -39,7 +39,7 @@ const withGlobalPipes = (app: INestApplication): INestApplication => { async function bootstrap() { const logger = new Logger('AuthorizationNodeBootstrap') - const application = await NestFactory.create(AppModule) + const application = await NestFactory.create(AppModule, { bodyParser: true }) const configService = application.get(ConfigService) const port = configService.get('PORT') diff --git a/apps/policy-engine/src/shared/types/domain.type.ts b/apps/policy-engine/src/shared/types/domain.type.ts index 8443465bb..e0129bf4d 100644 --- a/apps/policy-engine/src/shared/types/domain.type.ts +++ b/apps/policy-engine/src/shared/types/domain.type.ts @@ -25,6 +25,7 @@ export type RegoInput = { } export type MatchedRule = { + policyName: string policyId: string type: 'permit' | 'forbid' approvalsSatisfied: ApprovalRequirement[] diff --git a/apps/policy-engine/src/shared/types/rego.ts b/apps/policy-engine/src/shared/types/rego.ts index f19609ed1..ed327b084 100644 --- a/apps/policy-engine/src/shared/types/rego.ts +++ b/apps/policy-engine/src/shared/types/rego.ts @@ -18,6 +18,7 @@ export type RegoInput = { } type MatchedRule = { + policyName: string policyId: string type: 'permit' | 'forbid' approvalsSatisfied: ApprovalRequirement[]