add auth functionality

This commit is contained in:
2025-12-08 14:28:07 +00:00
parent 2c0af8e237
commit 44cd64a1db
34 changed files with 3463 additions and 7056 deletions

41
policies/data_test.yaml Normal file
View File

@@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/TestSuite.schema.json
# docs: https://docs.cerbos.dev/cerbos/latest/policies/compile#testing
name: dataTestSuite
description: Tests for verifying the data resource policy
tests:
- name: data actions
input:
principals:
- user#1
- admin#2
- thirdParty#3
resources:
- data#1
actions:
- create
- read
- update
- delete
expected:
- resource: data#1
principal: user#1
actions:
create: EFFECT_DENY
read: EFFECT_ALLOW
update: EFFECT_DENY
delete: EFFECT_DENY
- resource: data#1
principal: admin#2
actions:
create: EFFECT_ALLOW
read: EFFECT_ALLOW
update: EFFECT_ALLOW
delete: EFFECT_ALLOW
- resource: data#1
principal: thirdParty#3
actions:
create: EFFECT_DENY
read: EFFECT_ALLOW
update: EFFECT_DENY
delete: EFFECT_DENY