Skip to content

Commit fe2a69d

Browse files
compress json scheme
1 parent e7c166f commit fe2a69d

File tree

2 files changed

+27
-311
lines changed

2 files changed

+27
-311
lines changed

tests/acceptance/features/apiOcm/listPermissions.feature

Lines changed: 19 additions & 263 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ Feature: List a federated sharing permissions
4343
"oneOf":[
4444
{
4545
"type": "object",
46-
"required": [
47-
"grantedToV2",
48-
"id",
49-
"roles"
50-
],
46+
"required": ["grantedToV2","id","roles"],
5147
"properties": {
5248
"grantedToV2": {
5349
"type": "object",
@@ -57,24 +53,14 @@ Feature: List a federated sharing permissions
5753
"type": "object",
5854
"required": ["@libre.graph.userType","displayName","id"],
5955
"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-
}
56+
"@libre.graph.userType": {"const": "Federated"},
57+
"id": {"pattern": "^%federated_user_id_pattern%$"},
58+
"displayName": {"const": "Brian Murphy"}
7059
}
7160
}
7261
}
7362
},
74-
"id": {
75-
"type": "string",
76-
"pattern": "^%user_id_pattern%$"
77-
},
63+
"id": {"pattern": "^%user_id_pattern%$"},
7864
"invitation": {
7965
"type": "object",
8066
"required": ["invitedBy"],
@@ -87,16 +73,9 @@ Feature: List a federated sharing permissions
8773
"type": "object",
8874
"required": ["@libre.graph.userType", "displayName", "id"],
8975
"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-
}
76+
"@libre.graph.userType": {"const": "Member"},
77+
"id": {"pattern": "^%user_id_pattern%$"},
78+
"displayName": {"const": "Alice Hansen"}
10079
}
10180
}
10281
}
@@ -107,124 +86,7 @@ Feature: List a federated sharing permissions
10786
"type": "array",
10887
"minItems": 1,
10988
"maxItems": 1,
110-
"items": {
111-
"type": "string",
112-
"pattern": "^%role_id_pattern%$"
113-
}
114-
}
115-
}
116-
}
117-
]
118-
}
119-
}
120-
}
121-
}
122-
"""
123-
124-
125-
Scenario: user lists permissions of a resource shared to a federated user
126-
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"
133-
And user "Alice" has sent the following resource share invitation to federated user:
134-
| resource | uploadFolder |
135-
| space | Personal |
136-
| sharee | Brian |
137-
| shareType | user |
138-
| permissionsRole | Editor |
139-
When user "Alice" gets permissions list for folder "uploadFolder" of the space "Personal" using the Graph API
140-
Then the HTTP status code should be "200"
141-
And the JSON data of the response should match
142-
"""
143-
{
144-
"type": "object",
145-
"required": [
146-
"@libre.graph.permissions.actions.allowedValues",
147-
"@libre.graph.permissions.roles.allowedValues",
148-
"value"
149-
],
150-
"properties": {
151-
"value": {
152-
"type": "array",
153-
"minItems": 1,
154-
"maxItems": 1,
155-
"uniqueItems": true,
156-
"items": {
157-
"oneOf":[
158-
{
159-
"type": "object",
160-
"required": [
161-
"grantedToV2",
162-
"id",
163-
"roles"
164-
],
165-
"properties": {
166-
"grantedToV2": {
167-
"type": "object",
168-
"required": ["user"],
169-
"properties": {
170-
"user": {
171-
"type": "object",
172-
"required": ["@libre.graph.userType","displayName","id"],
173-
"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-
}
184-
}
185-
}
186-
}
187-
},
188-
"id": {
189-
"type": "string",
190-
"pattern": "^%user_id_pattern%$"
191-
},
192-
"invitation": {
193-
"type": "object",
194-
"required": ["invitedBy"],
195-
"properties": {
196-
"invitedBy": {
197-
"type": "object",
198-
"required": ["user"],
199-
"properties": {
200-
"user": {
201-
"type": "object",
202-
"required": ["@libre.graph.userType", "displayName", "id"],
203-
"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-
}
214-
}
215-
}
216-
}
217-
}
218-
}
219-
},
220-
"roles": {
221-
"type": "array",
222-
"minItems": 1,
223-
"maxItems": 1,
224-
"items": {
225-
"type": "string",
226-
"pattern": "^%role_id_pattern%$"
227-
}
89+
"items": {"pattern": "^%role_id_pattern%$"}
22890
}
22991
}
23092
}
@@ -274,11 +136,7 @@ Feature: List a federated sharing permissions
274136
"oneOf":[
275137
{
276138
"type": "object",
277-
"required": [
278-
"grantedToV2",
279-
"id",
280-
"roles"
281-
],
139+
"required": ["grantedToV2","id","roles"],
282140
"properties": {
283141
"grantedToV2": {
284142
"type": "object",
@@ -288,16 +146,9 @@ Feature: List a federated sharing permissions
288146
"type": "object",
289147
"required": ["@libre.graph.userType","displayName","id"],
290148
"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-
}
149+
"@libre.graph.userType": {"const": "Federated"},
150+
"id": {"pattern": "^%federated_user_id_pattern%$"},
151+
"displayName": {"const": "Brian Murphy"}
301152
}
302153
}
303154
}
@@ -318,14 +169,9 @@ Feature: List a federated sharing permissions
318169
"type": "object",
319170
"required": ["@libre.graph.userType", "displayName", "id"],
320171
"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" }
172+
"@libre.graph.userType": {"const": "Member"},
173+
"id": {"pattern": "^%user_id_pattern%$"},
174+
"displayName": {"const": "Alice Hansen"}
329175
}
330176
}
331177
}
@@ -336,100 +182,10 @@ Feature: List a federated sharing permissions
336182
"type": "array",
337183
"minItems": 1,
338184
"maxItems": 1,
339-
"items": { "pattern": "^%role_id_pattern%$" }
340-
}
341-
}
342-
}
343-
]
344-
}
345-
}
346-
}
347-
}
348-
"""
349-
350-
351-
Scenario: user lists permissions of a project resource shared to a federated user
352-
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"
358-
And using spaces DAV path
359-
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
360-
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
361-
And user "Alice" has uploaded a file inside space "projectSpace" with content "some content" to "textfile.txt"
362-
And user "Alice" has sent the following resource share invitation to federated user:
363-
| resource | textfile.txt |
364-
| space | projectSpace |
365-
| sharee | Brian |
366-
| shareType | user |
367-
| permissionsRole | Viewer |
368-
When user "Alice" gets permissions list for file "textfile.txt" of the space "projectSpace" using the Graph API
369-
Then the HTTP status code should be "200"
370-
And the JSON data of the response should match
371-
"""
372-
{
373-
"type": "object",
374-
"required": [
375-
"@libre.graph.permissions.actions.allowedValues",
376-
"@libre.graph.permissions.roles.allowedValues",
377-
"value"
378-
],
379-
"properties": {
380-
"value": {
381-
"type": "array",
382-
"minItems": 1,
383-
"maxItems": 1,
384-
"uniqueItems": true,
385-
"items": {
386-
"oneOf":[
387-
{
388-
"type": "object",
389-
"required": ["grantedToV2", "id", "roles"],
390-
"properties": {
391-
"grantedToV2": {
392-
"type": "object",
393-
"required": ["user"],
394-
"properties": {
395-
"user": {
396-
"type": "object",
397-
"required": ["@libre.graph.userType","displayName","id"],
398-
"properties": {
399-
"@libre.graph.userType": { "const": "Federated" },
400-
"id": { "pattern": "^%federated_user_id_pattern%$" },
401-
"displayName": { "const": "Brian Murphy" }
402-
}
403-
}
404-
}
405-
},
406-
"id": { "pattern": "^%user_id_pattern%$" },
407-
"invitation": {
408-
"type": "object",
409-
"required": ["invitedBy"],
410-
"properties": {
411-
"invitedBy": {
412-
"type": "object",
413-
"required": ["user"],
414-
"properties": {
415-
"user": {
416-
"type": "object",
417-
"required": ["@libre.graph.userType", "displayName", "id"],
418-
"properties": {
419-
"@libre.graph.userType": { "const": "Member" },
420-
"id": { "pattern": "^%user_id_pattern%$" },
421-
"displayName": { "const": "Alice Hansen" }
422-
}
423-
}
424-
}
425-
}
185+
"items": {
186+
"type": "string",
187+
"pattern": "^%role_id_pattern%$"
426188
}
427-
},
428-
"roles": {
429-
"type": "array",
430-
"minItems": 1,
431-
"maxItems": 1,
432-
"items": { "pattern": "^%role_id_pattern%$" }
433189
}
434190
}
435191
}

0 commit comments

Comments
 (0)