@@ -38,14 +38,21 @@ func TestClientListTenantRules(t *testing.T) {
3838 "roleIds": ["maintainer"],
3939 "disallowedRuleSet": [
4040 {"jsonPath": "$.services.*.description"},
41- {"jsonPath": "$.services", "processingOptions": {"action ": "create"}}
41+ {"jsonPath": "$.services", "processingOptions": {"actions ": [ "create"] }}
4242 ]
4343 },
4444 {
4545 "roleIds": ["developer"],
4646 "disallowedRuleSet": [
4747 {"ruleId": "endpoint.security.edit"}
4848 ]
49+ },
50+ {
51+ "roleIds": ["some-role"],
52+ "allowedRuleSet": [
53+ { "jsonPath": "$.endpoints.*.public" },
54+ { "jsonPath": "$.secrets", "processingOptions": { "actions": ["create"], "primaryKey": "clientType" }}
55+ ]
4956 }
5057 ]
5158 }
@@ -101,7 +108,7 @@ func TestClientListTenantRules(t *testing.T) {
101108 RoleIDs : []string {"maintainer" },
102109 DisallowedRuleSet : []rulesentities.RuleSet {
103110 {JSONPath : "$.services.*.description" },
104- {JSONPath : "$.services" , Options : & rulesentities.RuleOptions {Action : "create" }},
111+ {JSONPath : "$.services" , Options : & rulesentities.RuleOptions {Actions : [] string { "create" } }},
105112 },
106113 },
107114 {
@@ -110,6 +117,13 @@ func TestClientListTenantRules(t *testing.T) {
110117 {RuleID : "endpoint.security.edit" },
111118 },
112119 },
120+ {
121+ RoleIDs : []string {"some-role" },
122+ AllowedRuleSet : []rulesentities.RuleSet {
123+ {JSONPath : "$.endpoints.*.public" },
124+ {JSONPath : "$.secrets" , Options : & rulesentities.RuleOptions {Actions : []string {"create" }, PrimaryKey : "clientType" }},
125+ },
126+ },
113127 }, data )
114128 }
115129 })
@@ -126,7 +140,7 @@ func TestClientListProjectRules(t *testing.T) {
126140 "roleIds": ["maintainer"],
127141 "disallowedRuleSet": [
128142 {"jsonPath": "$.services.*.description"},
129- {"jsonPath": "$.services", "processingOptions": {"action": "create"}}
143+ {"jsonPath": "$.services", "processingOptions": {"actions":[ "create"] }}
130144 ]
131145 },
132146 {
@@ -135,6 +149,13 @@ func TestClientListProjectRules(t *testing.T) {
135149 {"ruleId": "endpoint.security.edit"}
136150 ],
137151 "isInheritedFromTenant": true
152+ },
153+ {
154+ "roleIds": ["some-role"],
155+ "allowedRuleSet": [
156+ { "jsonPath": "$.endpoints.*.public" },
157+ { "jsonPath": "$.secrets", "processingOptions": { "actions": ["create"], "primaryKey": "clientType" }}
158+ ]
138159 }
139160 ]
140161 }
@@ -190,7 +211,7 @@ func TestClientListProjectRules(t *testing.T) {
190211 RoleIDs : []string {"maintainer" },
191212 DisallowedRuleSet : []rulesentities.RuleSet {
192213 {JSONPath : "$.services.*.description" },
193- {JSONPath : "$.services" , Options : & rulesentities.RuleOptions {Action : "create" }},
214+ {JSONPath : "$.services" , Options : & rulesentities.RuleOptions {Actions : [] string { "create" } }},
194215 },
195216 },
196217 {
@@ -200,6 +221,13 @@ func TestClientListProjectRules(t *testing.T) {
200221 },
201222 IsInheritedFromTenant : true ,
202223 },
224+ {
225+ RoleIDs : []string {"some-role" },
226+ AllowedRuleSet : []rulesentities.RuleSet {
227+ {JSONPath : "$.endpoints.*.public" },
228+ {JSONPath : "$.secrets" , Options : & rulesentities.RuleOptions {Actions : []string {"create" }, PrimaryKey : "clientType" }},
229+ },
230+ },
203231 }, data )
204232 }
205233 })
0 commit comments