add auth functionality
This commit is contained in:
41
policies/data_test.yaml
Normal file
41
policies/data_test.yaml
Normal 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
|
||||
Reference in New Issue
Block a user