From 4582b4ae9af6883cc17bc29f6ad1ddc8e977e3bc Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Tue, 25 Feb 2025 11:41:22 +0545 Subject: [PATCH 1/2] added test for federated user to list share shared with him --- ...ected-failures-localAPI-on-OCIS-storage.md | 8 + .../acceptance/features/apiOcm/share.feature | 370 ++++++++++++++++++ 2 files changed, 378 insertions(+) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index d01c8ac0d0f..00f0b256e68 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -339,5 +339,13 @@ The expected failures in this file are from features in the owncloud/ocis repo. #### [Delete user containing + in username returns 404 but user gets deleted](https://github.com/owncloud/ocis/issues/11027) - [apiGraphUserGroup/deleteUser.feature:28](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraphUserGroup/deleteUser.feature#L28) +#### [[OCM] roles id not available on sharedWithMe response when listing shares shared with editor role](https://github.com/owncloud/ocis/issues/11054) +- [apiOcm/share.feature:1368](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1368) +- [apiOcm/share.feature:1369](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1369) +- [apiOcm/share.feature:1370](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1370) +- [apiOcm/share.feature:1371](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1371) +- [apiOcm/share.feature:1560](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1560) +- [apiOcm/share.feature:1561](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1561) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiOcm/share.feature b/tests/acceptance/features/apiOcm/share.feature index 8095a87e6a2..48f961c984c 100755 --- a/tests/acceptance/features/apiOcm/share.feature +++ b/tests/acceptance/features/apiOcm/share.feature @@ -1283,3 +1283,373 @@ Feature: an user shares resources using ScienceMesh application And as user "Alice" the PROPFIND response should contain a resource "newFolder" with these key and value pairs: | key | value | | oc:name | newFolder | + + @issue-11054 + Scenario Outline: federated user lists folder shared with him + Given using server "LOCAL" + And user "Alice" has created folder "folderToShare1" + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace" with the default quota using the Graph API + And user "Alice" has created a folder "folderToShare2" in space "projectSpace" + When user "Alice" sends the following resource share invitation to federated user using the Graph API: + | resource | | + | space | | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + Then the HTTP status code should be "200" + When using server "REMOTE" + And user "Brian" lists the shares shared with him without retry using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "createdBy", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { "const": false }, + "@client.synchronize": { "const": false }, + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Alice Hansen" }, + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + }, + "eTag": { "pattern": "%etag_pattern%" }, + "folder": { "const": {} }, + "id": { "pattern": "^%file_id_pattern%$" }, + "name": { "const": "" }, + "parentReference": { + "type": "object", + "required": ["driveId", "driveType", "id"], + "properties": { + "driveId": { "pattern": "^%space_id_pattern%$" }, + "driveType": { "const": "virtual" }, + "id": { "pattern": "^%file_id_pattern%$" } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "createdBy", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "permissions" + ], + "properties": { + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["id", "displayName", "@libre.graph.userType"], + "properties": { + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "displayName": { "const": "Alice Hansen" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + }, + "eTag": { "pattern": "%etag_pattern%" }, + "folder": { "const": {} }, + "id": { "pattern": "^%federated_file_id_pattern%$" }, + "name": { "const": "" }, + "permissions": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "createdDateTime", + "grantedToV2", + "id", + "invitation", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Brian Murphy" }, + "id": { "pattern": "^%user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Member" } + } + } + } + }, + "id": { "pattern": "^%uuidv4_pattern%$" }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Alice Hansen" }, + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + } + } + }, + "roles": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "pattern": "^%role_id_pattern%$" + } + } + } + } + } + } + } + } + } + } + } + } + """ + Examples: + | resource | space | permissions-role | + | folderToShare1 | Personal | Editor | + | folderToShare1 | Personal | Uploader | + | folderToShare2 | projectSpace | Editor | + | folderToShare2 | projectSpace | Uploader | + + @issue-11054 + Scenario Outline: federated user lists file shared with him + Given using server "LOCAL" + And user "Alice" has uploaded file with content "ocm test" to "textfile1.txt" + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "projectSpace" with content "some content" to "textfile2.txt" + When user "Alice" sends the following resource share invitation to federated user using the Graph API: + | resource | | + | space | | + | sharee | Brian | + | shareType | user | + | permissionsRole | File Editor | + Then the HTTP status code should be "200" + When using server "REMOTE" + And user "Brian" lists the shares shared with him without retry using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "createdBy", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { "const": false }, + "@client.synchronize": { "const": false }, + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Alice Hansen" }, + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + }, + "eTag": { "pattern": "%etag_pattern%" }, + "file": { + "type": "object", + "required": ["mimeType"], + "properties": { + "mimeType": { "const": "text/plain" } + } + }, + "id": { "pattern": "^%file_id_pattern%$" }, + "name": { "const": "" }, + "parentReference": { + "type": "object", + "required": ["driveId", "driveType", "id"], + "properties": { + "driveId": { "pattern": "^%space_id_pattern%$" }, + "driveType": { "const": "virtual" }, + "id": { "pattern": "^%file_id_pattern%$" } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "createdBy", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "permissions" + ], + "properties": { + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["id", "displayName", "@libre.graph.userType"], + "properties": { + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "displayName": { "const": "Alice Hansen" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + }, + "eTag": { "pattern": "%etag_pattern%" }, + "file": { + "type": "object", + "required": ["mimeType"], + "properties": { + "mimeType": { "const": "text/plain" } + } + }, + "id": { "pattern": "^%federated_file_id_pattern%$" }, + "name": { "const": "" }, + "permissions": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "createdDateTime", + "grantedToV2", + "id", + "invitation", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Brian Murphy" }, + "id": { "pattern": "^%user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Member" } + } + } + } + }, + "id": { "pattern": "^%uuidv4_pattern%$" }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id", "@libre.graph.userType"], + "properties": { + "displayName": { "const": "Alice Hansen" }, + "id": { "pattern": "^%federated_user_id_pattern%$" }, + "@libre.graph.userType": { "const": "Federated" } + } + } + } + } + } + }, + "roles": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "pattern": "^%role_id_pattern%$" + } + } + } + } + } + } + } + } + } + } + } + } + """ + Examples: + | resource | space | + | textfile1.txt | Personal | + | textfile2.txt | projectSpace | From 582d003136470d9f32f58b75b032c48ad04f6cf0 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Thu, 27 Feb 2025 15:24:56 +0545 Subject: [PATCH 2/2] updated existing scenario to cover tests for Editor role --- ...ected-failures-localAPI-on-OCIS-storage.md | 11 +- .../acceptance/features/apiOcm/share.feature | 426 ++---------------- 2 files changed, 38 insertions(+), 399 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 00f0b256e68..5adf63d4ccc 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -329,8 +329,8 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiOcm/acceptInvitation.feature:148](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/acceptInvitation.feature#L148) #### [[OCM] Hide & Enable Sync fail with received federated shares](https://github.com/owncloud/ocis/issues/10719) -- [apiOcm/share.feature:1190](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1190) -- [apiOcm/share.feature:1214](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1214) +- [apiOcm/share.feature:1204](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1204) +- [apiOcm/share.feature:1228](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1228) #### [[OCM] federated user trying to download file shared with permissions role Secure Viewer returns 500 status code](https://github.com/owncloud/ocis/issues/10822) - [apiOcm/enableDisablePermissionsRole.feature:18](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/enableDisablePermissionsRole.feature#L18) @@ -340,12 +340,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiGraphUserGroup/deleteUser.feature:28](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraphUserGroup/deleteUser.feature#L28) #### [[OCM] roles id not available on sharedWithMe response when listing shares shared with editor role](https://github.com/owncloud/ocis/issues/11054) -- [apiOcm/share.feature:1368](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1368) -- [apiOcm/share.feature:1369](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1369) -- [apiOcm/share.feature:1370](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1370) -- [apiOcm/share.feature:1371](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1371) -- [apiOcm/share.feature:1560](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1560) -- [apiOcm/share.feature:1561](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1561) +- [apiOcm/share.feature:375](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L375) Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiOcm/share.feature b/tests/acceptance/features/apiOcm/share.feature index 48f961c984c..78cf208a506 100755 --- a/tests/acceptance/features/apiOcm/share.feature +++ b/tests/acceptance/features/apiOcm/share.feature @@ -11,16 +11,16 @@ Feature: an user shares resources using ScienceMesh application And user "Brian" has been created with default attributes And "Brian" has accepted invitation - @issue-9534 - Scenario: local user shares a folder to federation user + @issue-9534 @issue-11054 + Scenario Outline: local user shares a folder to federation user Given using server "LOCAL" And user "Alice" has created folder "folderToShare" When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | folderToShare | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | folderToShare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | Then the HTTP status code should be "200" When using server "REMOTE" And user "Brian" lists the shares shared with him without retry using the Graph API @@ -181,17 +181,22 @@ Feature: an user shares resources using ScienceMesh application } } """ + Examples: + | permissions-role | + | Viewer | + | Editor | + | Uploader | - @issue-9534 - Scenario: local user shares a file to federation user + @issue-9534 @issue-11054 + Scenario Outline: local user shares a file to federation user Given using server "LOCAL" And user "Alice" has uploaded file with content "ocm test" to "textfile.txt" When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | textfile.txt | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | Then the HTTP status code should be "200" When using server "REMOTE" And user "Brian" lists the shares shared with him without retry using the Graph API @@ -364,19 +369,23 @@ Feature: an user shares resources using ScienceMesh application } } """ + Examples: + | permissions-role | + | Viewer | + | File Editor | - - Scenario: local user shares a folder from project space to federation user + @issue-11054 + Scenario Outline: local user shares a folder from project space to federation user Given using server "LOCAL" And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "projectSpace" with the default quota using the Graph API And user "Alice" has created a folder "folderToShare" in space "projectSpace" When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | folderToShare | - | space | projectSpace | - | sharee | Brian | - | shareType | user | - | permissionsRole | Viewer | + | resource | folderToShare | + | space | projectSpace | + | sharee | Brian | + | shareType | user | + | permissionsRole | | Then the HTTP status code should be "200" When using server "REMOTE" And user "Brian" lists the shares shared with him without retry using the Graph API @@ -537,6 +546,11 @@ Feature: an user shares resources using ScienceMesh application } } """ + Examples: + | permissions-role | + | Viewer | + | Editor | + | Uploader | @issue-10051 Scenario Outline: try to add federated user as a member of a project space (permissions endpoint) @@ -1283,373 +1297,3 @@ Feature: an user shares resources using ScienceMesh application And as user "Alice" the PROPFIND response should contain a resource "newFolder" with these key and value pairs: | key | value | | oc:name | newFolder | - - @issue-11054 - Scenario Outline: federated user lists folder shared with him - Given using server "LOCAL" - And user "Alice" has created folder "folderToShare1" - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "projectSpace" with the default quota using the Graph API - And user "Alice" has created a folder "folderToShare2" in space "projectSpace" - When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | | - | space | | - | sharee | Brian | - | shareType | user | - | permissionsRole | | - Then the HTTP status code should be "200" - When using server "REMOTE" - And user "Brian" lists the shares shared with him without retry using the Graph API - Then the HTTP status code should be "200" - And the JSON data of the response should match - """ - { - "type": "object", - "required": ["value"], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "@UI.Hidden", - "@client.synchronize", - "createdBy", - "eTag", - "folder", - "id", - "lastModifiedDateTime", - "name", - "parentReference", - "remoteItem" - ], - "properties": { - "@UI.Hidden": { "const": false }, - "@client.synchronize": { "const": false }, - "createdBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Alice Hansen" }, - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - }, - "eTag": { "pattern": "%etag_pattern%" }, - "folder": { "const": {} }, - "id": { "pattern": "^%file_id_pattern%$" }, - "name": { "const": "" }, - "parentReference": { - "type": "object", - "required": ["driveId", "driveType", "id"], - "properties": { - "driveId": { "pattern": "^%space_id_pattern%$" }, - "driveType": { "const": "virtual" }, - "id": { "pattern": "^%file_id_pattern%$" } - } - }, - "remoteItem": { - "type": "object", - "required": [ - "createdBy", - "eTag", - "folder", - "id", - "lastModifiedDateTime", - "name", - "permissions" - ], - "properties": { - "createdBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["id", "displayName", "@libre.graph.userType"], - "properties": { - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "displayName": { "const": "Alice Hansen" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - }, - "eTag": { "pattern": "%etag_pattern%" }, - "folder": { "const": {} }, - "id": { "pattern": "^%federated_file_id_pattern%$" }, - "name": { "const": "" }, - "permissions": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "createdDateTime", - "grantedToV2", - "id", - "invitation", - "roles" - ], - "properties": { - "grantedToV2": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Brian Murphy" }, - "id": { "pattern": "^%user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Member" } - } - } - } - }, - "id": { "pattern": "^%uuidv4_pattern%$" }, - "invitation": { - "type": "object", - "required": ["invitedBy"], - "properties": { - "invitedBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Alice Hansen" }, - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - } - } - }, - "roles": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "pattern": "^%role_id_pattern%$" - } - } - } - } - } - } - } - } - } - } - } - } - """ - Examples: - | resource | space | permissions-role | - | folderToShare1 | Personal | Editor | - | folderToShare1 | Personal | Uploader | - | folderToShare2 | projectSpace | Editor | - | folderToShare2 | projectSpace | Uploader | - - @issue-11054 - Scenario Outline: federated user lists file shared with him - Given using server "LOCAL" - And user "Alice" has uploaded file with content "ocm test" to "textfile1.txt" - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "projectSpace" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "projectSpace" with content "some content" to "textfile2.txt" - When user "Alice" sends the following resource share invitation to federated user using the Graph API: - | resource | | - | space | | - | sharee | Brian | - | shareType | user | - | permissionsRole | File Editor | - Then the HTTP status code should be "200" - When using server "REMOTE" - And user "Brian" lists the shares shared with him without retry using the Graph API - Then the HTTP status code should be "200" - And the JSON data of the response should match - """ - { - "type": "object", - "required": ["value"], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "@UI.Hidden", - "@client.synchronize", - "createdBy", - "eTag", - "file", - "id", - "lastModifiedDateTime", - "name", - "parentReference", - "remoteItem" - ], - "properties": { - "@UI.Hidden": { "const": false }, - "@client.synchronize": { "const": false }, - "createdBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Alice Hansen" }, - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - }, - "eTag": { "pattern": "%etag_pattern%" }, - "file": { - "type": "object", - "required": ["mimeType"], - "properties": { - "mimeType": { "const": "text/plain" } - } - }, - "id": { "pattern": "^%file_id_pattern%$" }, - "name": { "const": "" }, - "parentReference": { - "type": "object", - "required": ["driveId", "driveType", "id"], - "properties": { - "driveId": { "pattern": "^%space_id_pattern%$" }, - "driveType": { "const": "virtual" }, - "id": { "pattern": "^%file_id_pattern%$" } - } - }, - "remoteItem": { - "type": "object", - "required": [ - "createdBy", - "eTag", - "file", - "id", - "lastModifiedDateTime", - "name", - "permissions" - ], - "properties": { - "createdBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["id", "displayName", "@libre.graph.userType"], - "properties": { - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "displayName": { "const": "Alice Hansen" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - }, - "eTag": { "pattern": "%etag_pattern%" }, - "file": { - "type": "object", - "required": ["mimeType"], - "properties": { - "mimeType": { "const": "text/plain" } - } - }, - "id": { "pattern": "^%federated_file_id_pattern%$" }, - "name": { "const": "" }, - "permissions": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "createdDateTime", - "grantedToV2", - "id", - "invitation", - "roles" - ], - "properties": { - "grantedToV2": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Brian Murphy" }, - "id": { "pattern": "^%user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Member" } - } - } - } - }, - "id": { "pattern": "^%uuidv4_pattern%$" }, - "invitation": { - "type": "object", - "required": ["invitedBy"], - "properties": { - "invitedBy": { - "type": "object", - "required": ["user"], - "properties": { - "user": { - "type": "object", - "required": ["displayName", "id", "@libre.graph.userType"], - "properties": { - "displayName": { "const": "Alice Hansen" }, - "id": { "pattern": "^%federated_user_id_pattern%$" }, - "@libre.graph.userType": { "const": "Federated" } - } - } - } - } - } - }, - "roles": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "pattern": "^%role_id_pattern%$" - } - } - } - } - } - } - } - } - } - } - } - } - """ - Examples: - | resource | space | - | textfile1.txt | Personal | - | textfile2.txt | projectSpace |