Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Apr 3, 2024
1 parent 313f2f5 commit e393a0e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('Evaluation', () => {
{
id: 'test-permit-policy',
then: Then.PERMIT,
name: 'test permit policy',
description: 'test permit policy',
when: [
{
criterion: Criterion.CHECK_ACTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe(ClientRepository.name, () => {
{
id: 'test-permit-policy-uid',
then: Then.PERMIT,
name: 'test-policy',
description: 'test-policy',
when: [
{
criterion: Criterion.CHECK_ACTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('OpenPolicyAgentEngine', () => {
{
id: 'test-forbid-policy-uid',
then: Then.FORBID,
name: 'test-policy',
description: 'test-policy',
when: [
{
criterion: Criterion.CHECK_ACTION,
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('OpenPolicyAgentEngine', () => {
{
id: 'test-permit-policy-uid',
then: Then.PERMIT,
name: 'test-policy',
description: 'test-policy',
when: [
{
criterion: Criterion.CHECK_ACTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const transpileReason = (item: Policy & { id: string }) => {
const reason = [
`"type":"${item.then}"`,
`"policyId":"${item.id}"`,
`"policyName":"${item.name}"`,
`"policyName":"${item.description}"`,
approvalsSatisfied,
approvalsMissing
]
Expand All @@ -55,7 +55,7 @@ export const transpileReason = (item: Policy & { id: string }) => {
const reason = {
type: item.then,
policyId: item.id,
policyName: item.name,
policyName: item.description,
approvalsSatisfied: [],
approvalsMissing: []
}
Expand Down
4 changes: 2 additions & 2 deletions packages/policy-engine-shared/src/lib/dev.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export const POLICIES: Policy[] = [
{
id: 'test-permit-policy-uid',
then: Then.PERMIT,
name: 'Example of permit policy',
description: 'Example of permit policy',
when: [
{
criterion: Criterion.CHECK_RESOURCE_INTEGRITY,
Expand Down Expand Up @@ -332,7 +332,7 @@ export const POLICIES: Policy[] = [
{
id: 'test-forbid-policy-uid',
then: Then.FORBID,
name: 'Example of forbid policy',
description: 'Example of forbid policy',
when: [
{
criterion: Criterion.CHECK_RESOURCE_INTEGRITY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export const policyCriterionSchema = z.discriminatedUnion('criterion', [

export const policySchema = z.object({
id: z.string().min(1),
name: z.string().min(1),
description: z.string().min(1),
when: z.array(policyCriterionSchema).min(1),
then: thenSchema
})

0 comments on commit e393a0e

Please sign in to comment.