22Feature : The WAC-Allow header shows public access modes for a public agent when given indirect access via a container
33
44 Background : Create test resources giving a public agent different access modes
5- * table testModes
6- | test | modes | check |
7- | 'read ' | ['read '] | 'only ' |
8- | 'read /control ' | ['read ', 'control '] | 'only ' |
9- | 'read /write ' | ['read ', 'write '] | '' |
10- | 'read /append ' | ['read ', 'append '] | 'only ' |
11- | 'read /write /append ' | ['read ', 'write ', 'append '] | 'only ' |
12-
5+ * def modesList = [['read' ], ['read' , 'control' ], ['read' , 'write' ], ['read' , 'append' ], ['read' , 'write' , 'append' ]]
136 * def setup =
147 """
158 function() {
169 const resources = {}
17- for (const row of testModes ) {
10+ for (const modes of modesList ) {
1811 const testContainer = rootTestContainer.createContainer();
1912 const access = testContainer.accessDatasetBuilder
20- .setInheritablePublicAccess(testContainer.url, row. modes)
13+ .setInheritablePublicAccess(testContainer.url, modes)
2114 .build();
2215 testContainer.accessDataset = access;
2316 const resource = testContainer.createResource('.ttl', karate.readAsString('../fixtures/example.ttl'), 'text/turtle');
24- resources[row.test ] = resource;
17+ resources[modes.join('/') ] = resource;
2518 }
2619 return resources;
2720 }
2821 """
2922 * def resources = callonce setup
3023 * def resource = resources['read' ]
3124
25+ @setup
26+ Scenario : Define test cases
27+ * table testModes
28+ | test | modes | check |
29+ | 'read ' | ['read '] | 'only ' |
30+ | 'read /control ' | ['read ', 'control '] | 'only ' |
31+ | 'read /write ' | ['read ', 'write '] | '' |
32+ | 'read /append ' | ['read ', 'append '] | 'only ' |
33+ | 'read /write /append ' | ['read ', 'write ', 'append '] | 'only ' |
34+
3235 Scenario : There is no acl on the resource that references a public agent
3336 Given url resource.aclUrl
3437 And headers clients.alice.getAuthHeaders('GET' , resource.aclUrl)
@@ -74,7 +77,7 @@ Feature: The WAC-Allow header shows public access modes for a public agent when
7477 # user access is implied by public
7578 And match result.user contains <check> <modes>
7679 Examples :
77- | testModes |
80+ | karate . setup (). testModes |
7881
7982 Scenario Outline : A public user calls HEAD on a resource with <test> access and the header shows <test> access for public
8083 Given url resources['<test>' ].url
@@ -85,4 +88,4 @@ Feature: The WAC-Allow header shows public access modes for a public agent when
8588 And match result.public contains <check> <modes>
8689 And match result.user contains <check> <modes>
8790 Examples :
88- | testModes |
91+ | karate . setup (). testModes |
0 commit comments