|
1 | 1 | package lib.rbac |
2 | 2 |
|
3 | | -test_rule_has_verb_with_use { |
| 3 | +import future.keywords.if |
| 4 | + |
| 5 | +test_rule_has_verb_with_use if { |
4 | 6 | rule_has_verb({"verbs": ["use"]}, "use") |
5 | 7 | } |
6 | 8 |
|
7 | | -test_rule_has_verb_with_asterisk { |
| 9 | +test_rule_has_verb_with_asterisk if { |
8 | 10 | rule_has_verb({"verbs": ["*"]}, "use") |
9 | 11 | } |
10 | 12 |
|
11 | | -test_rule_has_verb_with_list { |
| 13 | +test_rule_has_verb_with_list if { |
12 | 14 | not rule_has_verb({"verbs": ["list"]}, "use") |
13 | 15 | } |
14 | 16 |
|
15 | | -test_rule_has_resource_type_with_pod { |
| 17 | +test_rule_has_resource_type_with_pod if { |
16 | 18 | rule_has_resource_type({"resources": ["Pod"]}, "pod") |
17 | 19 | } |
18 | 20 |
|
19 | | -test_rule_has_resource_type_with_resourceall { |
| 21 | +test_rule_has_resource_type_with_resourceall if { |
20 | 22 | rule_has_resource_type({"resources": ["*"]}, "pod") |
21 | 23 | } |
22 | 24 |
|
23 | | -test_rule_has_resource_type_with_container { |
| 25 | +test_rule_has_resource_type_with_container if { |
24 | 26 | not rule_has_resource_type({"resources": ["Container"]}, "pod") |
25 | 27 | } |
26 | 28 |
|
27 | | -test_rule_has_resource_name_match { |
| 29 | +test_rule_has_resource_name_match if { |
28 | 30 | rule_has_resource_name({"resourceNames": ["test"]}, "test") |
29 | 31 | } |
30 | 32 |
|
31 | | -test_rule_has_resource_name_no_match { |
| 33 | +test_rule_has_resource_name_no_match if { |
32 | 34 | not rule_has_resource_name({"resourceNames": ["test"]}, "wrong") |
33 | 35 | } |
34 | 36 |
|
35 | | -test_rule_has_resource_name_null { |
| 37 | +test_rule_has_resource_name_null if { |
36 | 38 | rule_has_resource_name({}, "wrong") |
37 | 39 | } |
0 commit comments