Skip to content

Commit b95e3b7

Browse files
compress json scheme
1 parent 583f1dc commit b95e3b7

File tree

2 files changed

+70
-274
lines changed

2 files changed

+70
-274
lines changed

tests/acceptance/features/apiOcm/listPermissions.feature

+30-194
Original file line numberDiff line numberDiff line change
@@ -6,137 +6,22 @@ Feature: List a federated sharing permissions
66

77
Background:
88
Given user "Alice" has been created with default attributes
9-
10-
11-
Scenario: user lists permissions of a resource shared to a federated user
12-
Given using server "LOCAL"
139
And "Alice" has created the federation share invitation
1410
And using server "REMOTE"
1511
And user "Brian" has been created with default attributes
1612
And "Brian" has accepted invitation
17-
And using server "LOCAL"
18-
And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt"
19-
And user "Alice" has sent the following resource share invitation to federated user:
20-
| resource | textfile.txt |
21-
| space | Personal |
22-
| sharee | Brian |
23-
| shareType | user |
24-
| permissionsRole | Viewer |
25-
When user "Alice" gets permissions list for file "textfile.txt" of the space "Personal" using the Graph API
26-
Then the HTTP status code should be "200"
27-
And the JSON data of the response should match
28-
"""
29-
{
30-
"type": "object",
31-
"required": [
32-
"@libre.graph.permissions.actions.allowedValues",
33-
"@libre.graph.permissions.roles.allowedValues",
34-
"value"
35-
],
36-
"properties": {
37-
"value": {
38-
"type": "array",
39-
"minItems": 1,
40-
"maxItems": 1,
41-
"uniqueItems": true,
42-
"items": {
43-
"oneOf":[
44-
{
45-
"type": "object",
46-
"required": [
47-
"grantedToV2",
48-
"id",
49-
"roles"
50-
],
51-
"properties": {
52-
"grantedToV2": {
53-
"type": "object",
54-
"required": ["user"],
55-
"properties": {
56-
"user": {
57-
"type": "object",
58-
"required": ["@libre.graph.userType","displayName","id"],
59-
"properties": {
60-
"@libre.graph.userType": {
61-
"const": "Federated"
62-
},
63-
"id": {
64-
"type": "string",
65-
"pattern": "^%federated_user_id_pattern%$"
66-
},
67-
"displayName": {
68-
"const": "Brian Murphy"
69-
}
70-
}
71-
}
72-
}
73-
},
74-
"id": {
75-
"type": "string",
76-
"pattern": "^%user_id_pattern%$"
77-
},
78-
"invitation": {
79-
"type": "object",
80-
"required": ["invitedBy"],
81-
"properties": {
82-
"invitedBy": {
83-
"type": "object",
84-
"required": ["user"],
85-
"properties": {
86-
"user": {
87-
"type": "object",
88-
"required": ["@libre.graph.userType", "displayName", "id"],
89-
"properties": {
90-
"@libre.graph.userType": {
91-
"const": "Member"
92-
},
93-
"id": {
94-
"type": "string",
95-
"pattern": "^%user_id_pattern%$"
96-
},
97-
"displayName": {
98-
"const": "Alice Hansen"
99-
}
100-
}
101-
}
102-
}
103-
}
104-
}
105-
},
106-
"roles": {
107-
"type": "array",
108-
"minItems": 1,
109-
"maxItems": 1,
110-
"items": {
111-
"type": "string",
112-
"pattern": "^%role_id_pattern%$"
113-
}
114-
}
115-
}
116-
}
117-
]
118-
}
119-
}
120-
}
121-
}
122-
"""
12313

12414

12515
Scenario: user lists permissions of a resource shared to a federated user
12616
Given using server "LOCAL"
127-
And "Alice" has created the federation share invitation
128-
And using server "REMOTE"
129-
And user "Brian" has been created with default attributes
130-
And "Brian" has accepted invitation
131-
And using server "LOCAL"
132-
And user "Alice" has created folder "/uploadFolder"
17+
And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt"
13318
And user "Alice" has sent the following resource share invitation to federated user:
134-
| resource | uploadFolder |
19+
| resource | textfile.txt |
13520
| space | Personal |
13621
| sharee | Brian |
13722
| shareType | user |
138-
| permissionsRole | Editor |
139-
When user "Alice" gets permissions list for folder "uploadFolder" of the space "Personal" using the Graph API
23+
| permissionsRole | Viewer |
24+
When user "Alice" gets permissions list for file "textfile.txt" of the space "Personal" using the Graph API
14025
Then the HTTP status code should be "200"
14126
And the JSON data of the response should match
14227
"""
@@ -157,11 +42,7 @@ Feature: List a federated sharing permissions
15742
"oneOf":[
15843
{
15944
"type": "object",
160-
"required": [
161-
"grantedToV2",
162-
"id",
163-
"roles"
164-
],
45+
"required": ["grantedToV2","id","roles"],
16546
"properties": {
16647
"grantedToV2": {
16748
"type": "object",
@@ -171,24 +52,14 @@ Feature: List a federated sharing permissions
17152
"type": "object",
17253
"required": ["@libre.graph.userType","displayName","id"],
17354
"properties": {
174-
"@libre.graph.userType": {
175-
"const": "Federated"
176-
},
177-
"id": {
178-
"type": "string",
179-
"pattern": "^%federated_user_id_pattern%$"
180-
},
181-
"displayName": {
182-
"const": "Brian Murphy"
183-
}
55+
"@libre.graph.userType": {"const": "Federated"},
56+
"id": {"pattern": "^%federated_user_id_pattern%$"},
57+
"displayName": {"const": "Brian Murphy"}
18458
}
18559
}
18660
}
18761
},
188-
"id": {
189-
"type": "string",
190-
"pattern": "^%user_id_pattern%$"
191-
},
62+
"id": {"pattern": "^%user_id_pattern%$"},
19263
"invitation": {
19364
"type": "object",
19465
"required": ["invitedBy"],
@@ -201,16 +72,9 @@ Feature: List a federated sharing permissions
20172
"type": "object",
20273
"required": ["@libre.graph.userType", "displayName", "id"],
20374
"properties": {
204-
"@libre.graph.userType": {
205-
"const": "Member"
206-
},
207-
"id": {
208-
"type": "string",
209-
"pattern": "^%user_id_pattern%$"
210-
},
211-
"displayName": {
212-
"const": "Alice Hansen"
213-
}
75+
"@libre.graph.userType": {"const": "Member"},
76+
"id": {"pattern": "^%user_id_pattern%$"},
77+
"displayName": {"const": "Alice Hansen"}
21478
}
21579
}
21680
}
@@ -221,10 +85,7 @@ Feature: List a federated sharing permissions
22185
"type": "array",
22286
"minItems": 1,
22387
"maxItems": 1,
224-
"items": {
225-
"type": "string",
226-
"pattern": "^%role_id_pattern%$"
227-
}
88+
"items": {"pattern": "^%role_id_pattern%$"}
22889
}
22990
}
23091
}
@@ -238,11 +99,6 @@ Feature: List a federated sharing permissions
23899

239100
Scenario: user lists permissions of a project resource shared to a federated user
240101
Given using server "LOCAL"
241-
And "Alice" has created the federation share invitation
242-
And using server "REMOTE"
243-
And user "Brian" has been created with default attributes
244-
And "Brian" has accepted invitation
245-
And using server "LOCAL"
246102
And using spaces DAV path
247103
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
248104
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
@@ -288,24 +144,14 @@ Feature: List a federated sharing permissions
288144
"type": "object",
289145
"required": ["@libre.graph.userType","displayName","id"],
290146
"properties": {
291-
"@libre.graph.userType": {
292-
"const": "Federated"
293-
},
294-
"id": {
295-
"type": "string",
296-
"pattern": "^%federated_user_id_pattern%$"
297-
},
298-
"displayName": {
299-
"const": "Brian Murphy"
300-
}
147+
"@libre.graph.userType": {"const": "Federated"},
148+
"id": {"pattern": "^%federated_user_id_pattern%$"},
149+
"displayName": {"const": "Brian Murphy"}
301150
}
302151
}
303152
}
304153
},
305-
"id": {
306-
"type": "string",
307-
"pattern": "^%user_id_pattern%$"
308-
},
154+
"id": { "pattern": "^%user_id_pattern%$" },
309155
"invitation": {
310156
"type": "object",
311157
"required": ["invitedBy"],
@@ -318,14 +164,9 @@ Feature: List a federated sharing permissions
318164
"type": "object",
319165
"required": ["@libre.graph.userType", "displayName", "id"],
320166
"properties": {
321-
"@libre.graph.userType": {
322-
"const": "Member"
323-
},
324-
"id": {
325-
"type": "string",
326-
"pattern": "^%user_id_pattern%$"
327-
},
328-
"displayName": { "const": "Alice Hansen" }
167+
"@libre.graph.userType": {"const": "Member"},
168+
"id": {"pattern": "^%user_id_pattern%$"},
169+
"displayName": {"const": "Alice Hansen"}
329170
}
330171
}
331172
}
@@ -336,7 +177,7 @@ Feature: List a federated sharing permissions
336177
"type": "array",
337178
"minItems": 1,
338179
"maxItems": 1,
339-
"items": { "pattern": "^%role_id_pattern%$" }
180+
"items": {"pattern": "^%role_id_pattern%$"}
340181
}
341182
}
342183
}
@@ -350,11 +191,6 @@ Feature: List a federated sharing permissions
350191

351192
Scenario: user lists permissions of a project resource shared to a federated user
352193
Given using server "LOCAL"
353-
And "Alice" has created the federation share invitation
354-
And using server "REMOTE"
355-
And user "Brian" has been created with default attributes
356-
And "Brian" has accepted invitation
357-
And using server "LOCAL"
358194
And using spaces DAV path
359195
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
360196
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
@@ -386,7 +222,7 @@ Feature: List a federated sharing permissions
386222
"oneOf":[
387223
{
388224
"type": "object",
389-
"required": ["grantedToV2", "id", "roles"],
225+
"required": ["grantedToV2","id","roles"],
390226
"properties": {
391227
"grantedToV2": {
392228
"type": "object",
@@ -396,14 +232,14 @@ Feature: List a federated sharing permissions
396232
"type": "object",
397233
"required": ["@libre.graph.userType","displayName","id"],
398234
"properties": {
399-
"@libre.graph.userType": { "const": "Federated" },
400-
"id": { "pattern": "^%federated_user_id_pattern%$" },
401-
"displayName": { "const": "Brian Murphy" }
235+
"@libre.graph.userType": {"const": "Federated"},
236+
"id": {"pattern": "^%federated_user_id_pattern%$"},
237+
"displayName": {"const": "Brian Murphy"}
402238
}
403239
}
404240
}
405241
},
406-
"id": { "pattern": "^%user_id_pattern%$" },
242+
"id": {"pattern": "^%user_id_pattern%$"},
407243
"invitation": {
408244
"type": "object",
409245
"required": ["invitedBy"],
@@ -416,9 +252,9 @@ Feature: List a federated sharing permissions
416252
"type": "object",
417253
"required": ["@libre.graph.userType", "displayName", "id"],
418254
"properties": {
419-
"@libre.graph.userType": { "const": "Member" },
420-
"id": { "pattern": "^%user_id_pattern%$" },
421-
"displayName": { "const": "Alice Hansen" }
255+
"@libre.graph.userType": {"const": "Member"},
256+
"id": {"pattern": "^%user_id_pattern%$"},
257+
"displayName": {"const": "Alice Hansen"}
422258
}
423259
}
424260
}
@@ -429,7 +265,7 @@ Feature: List a federated sharing permissions
429265
"type": "array",
430266
"minItems": 1,
431267
"maxItems": 1,
432-
"items": { "pattern": "^%role_id_pattern%$" }
268+
"items": {"pattern": "^%role_id_pattern%$"}
433269
}
434270
}
435271
}

0 commit comments

Comments
 (0)