Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix caip10 and add body parser middleware #131

Merged
merged 11 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/policy-engine/src/app/__test__/unit/app.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand All @@ -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: []
Expand All @@ -58,6 +62,7 @@ describe('finalizeDecision', () => {
reasons: [
{
policyId: 'permit-rule-id',
policyName: 'Permit Rule',
type: 'permit',
approvalsMissing: [
{
Expand Down Expand Up @@ -111,6 +116,7 @@ describe('finalizeDecision', () => {
reasons: [
{
policyId: 'permit-rule-id',
policyName: 'Permit Rule',
type: 'permit',
approvalsMissing: [missingApproval],
approvalsSatisfied: [satisfiedApproval]
Expand All @@ -122,6 +128,7 @@ describe('finalizeDecision', () => {
reasons: [
{
policyId: 'permit-rule-id',
policyName: 'Permit Rule',
type: 'permit',
approvalsMissing: [missingApproval2],
approvalsSatisfied: [satisfiedApproval2]
Expand Down
2 changes: 1 addition & 1 deletion apps/policy-engine/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
1 change: 1 addition & 0 deletions apps/policy-engine/src/shared/types/domain.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type RegoInput = {
}

export type MatchedRule = {
policyName: string
policyId: string
type: 'permit' | 'forbid'
approvalsSatisfied: ApprovalRequirement[]
Expand Down
1 change: 1 addition & 0 deletions apps/policy-engine/src/shared/types/rego.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type RegoInput = {
}

type MatchedRule = {
policyName: string
policyId: string
type: 'permit' | 'forbid'
approvalsSatisfied: ApprovalRequirement[]
Expand Down
Loading