Repository navigation
enhancement: add graph beta sharedWithMe API - #7633
Conversation
|
CI will fail for the moment, its expected, .... somehow my locally generated swagger api uses UPPERCase letters for |
|
i could need a second pair of eyes (web :)) to see what else is needed, cc.: @kulmann |
@fschade Yeah, that's a changed default in the go-generator. since version 6 (IIRC) You need to call it with |
😮 THX |
rhafer
left a comment
There was a problem hiding this comment.
looks good to me in general. Commented on just a few minor things.
One question though. owncloud/libre-graph-api#112 talked about the permissions property on sharedWithMe. You code currently doesn't populate that. Is that no longer needed? If yes, how does a user figure out its own permissions (and expiry) on a share?
i want to wait for the Role <-> Permissions Conversion, once these are settled i planned to add them in a separate pr |
rhafer
left a comment
There was a problem hiding this comment.
👍 Looks good to me. Let's to the rest in followup PRs.
(btw, I'd prefer if stuff like the libregraph-api bump would be in separate commits, IMO that simplifies review a bit. Just as a side-note for the future)
|
Kudos, SonarCloud Quality Gate passed! |








Description
Add graph beta api implementation for the sharedWithMe endpoint.
The implementation is a logical replication of the existing OCS API.
Related Issue
Motivation and Context
part of the OCS api to graph api ADR
How Has This Been Tested?
Types of changes
Checklist:
MS Graph (oneDrive) share livecycle
Process
User Ahas 2 resourcesTest (folder)Card.pdf (file)User AsharesTest (folder),Card.pdf (file)TOUser BCard.pdf (file)TOUser CUser BsharesTest (folder)TOUser CResult
/v1.0/me/drive/root/childrenforUser A{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('f.schade%40foo.com')/drive/root/children", "@odata.count": 2, "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/root/children?$select=audio,bundle", "value": [ { "createdDateTime": "2023-11-05T07:33:16.767Z", "cTag": "adDo0MjQ4RDA4MkIxOEY1NkYzITEwNS42MzgzNDc3MDkxOTcxMDAwMDA", "eTag": "aNDI0OEQwODJCMThGNTZGMyExMDUuMg", "id": "4248D082B18F56F3!105", "lastModifiedDateTime": "2023-11-05T08:48:39.71Z", "name": "test", "size": 0, "webUrl": "https://1drv.ms/f/s!APNWj7GC0EhCaQ", "reactions": { "commentCount": 0 }, "createdBy": { "application": { "displayName": "OneDrive", "id": "481710a4" }, "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "lastModifiedBy": { "application": { "displayName": "OneDrive", "id": "481710a4" }, "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal", "id": "4248D082B18F56F3!101", "path": "/drive/root:" }, "fileSystemInfo": { "createdDateTime": "2023-11-05T07:33:16.766Z", "lastModifiedDateTime": "2023-11-05T07:33:16.766Z" }, "folder": { "childCount": 0, "view": { "viewType": "thumbnails", "sortBy": "name", "sortOrder": "ascending" } }, "shared": { "scope": "users", "sharedDateTime": "2023-11-05T08:48:08.0061935Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } }, { "@microsoft.graph.downloadUrl": "https://public.db.files.1drv.com/y4mdJmpXzVykKLjSml4Qdsu2vAJMPpW1qw-J730KpbNB0YMyjr9xa84rYmdsO8uAVOlARMIgf8DfqEYFZqUrn6wf3yLtPwuNW6qH3wpOMfKDaWn6JhYyLyl5cC0yAnX2kTjAdzSTXhYs9bPcTxSwdWD54TB2VIR43XPN-LpLXgvH1dDCYQX478P4DrT81Uw9anwOSWLwYLyzdhykPAgZUGD1T0bTmkBnvMZi7cDpv0jB4VJFEkpYpFEXbnao5q9Y-pE9_5y_TCte5b-l3889v7VCcR4_UwPBpdu0f7S_8eC_wg", "createdDateTime": "2023-11-05T12:12:00.44Z", "cTag": "aYzo0MjQ4RDA4MkIxOEY1NkYzITEwOC4yNTc", "eTag": "aNDI0OEQwODJCMThGNTZGMyExMDguNg", "id": "4248D082B18F56F3!108", "lastModifiedDateTime": "2023-11-05T12:16:37.733Z", "name": "card.pdf", "size": 5333805, "webUrl": "https://1drv.ms/b/s!APNWj7GC0EhCbA", "reactions": { "commentCount": 0 }, "createdBy": { "application": { "displayName": "OneDrive", "id": "481710a4" }, "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "lastModifiedBy": { "application": { "displayName": "OneDrive", "id": "481710a4" }, "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal", "id": "4248D082B18F56F3!101", "path": "/drive/root:" }, "file": { "mimeType": "application/pdf", "hashes": { "quickXorHash": "fLXOC13mFvBf2YZJBnBMNMwie+s=", "sha1Hash": "8FE5FAFF1515FC55AAC59F6483AC1FDC3EE0F799", "sha256Hash": "28F9182C9F1FA4BA1ADFEB5CDD9210FF85D3D3B6FA8C8D156BA09602E9F57190" } }, "fileSystemInfo": { "createdDateTime": "2023-11-05T12:12:00.44Z", "lastModifiedDateTime": "2023-11-05T12:12:00.44Z" }, "shared": { "scope": "users", "sharedDateTime": "2023-11-05T12:16:19.3612484Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } } ] }Result
/v1.0/me/drive/sharedWithMeforUser B{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/microsoft.graph.sharedWithMe?$select=audio,bundle", "value": [ { "@odata.type": "#microsoft.graph.driveItem", "@microsoft.graph.downloadUrl": "https://fnnw7q.db.files.1drv.com/y4metUELTbmKxTPBy6GO4d9ZolLegCvYtBKnGYZgMBiye0S2gKaxuUEIDP8MFK4KfB8fEbLmj1cUKYThy2mgAYeQKGOGfHX_TCxgLP2IXZasGO_iDkKJYpDjFZ99n2dkn442rULQEkf0_S6mi3XhPBgFjgSllJ5Z_c03jxgKfZ-Y6asWne2FRHzuOqT-L7IEBIOU_4Hu3gZm7L9hIyUr7JVGcxq_d_5erZQpHprFqTtVZ8", "createdDateTime": "2023-11-05T12:12:39.753Z", "cTag": "aYzozQUUxRDc2NEI3MEIyNUIzITEwOC4yNTc", "eTag": "aM0FFMUQ3NjRCNzBCMjVCMyExMDguMTA", "id": "3AE1D764B70B25B3!108", "lastModifiedDateTime": "2023-11-05T12:17:29.853Z", "name": "card.pdf", "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCbA", "parentReference": { "driveId": "3ae1d764b70b25b3", "driveType": "personal" }, "remoteItem": { "id": "4248D082B18F56F3!108", "lastModifiedDateTime": "2023-11-05T12:16:37.733Z", "name": "card.pdf", "size": 5333805, "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCbA", "createdBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "fileSystemInfo": { "createdDateTime": "2023-11-05T12:12:00.44Z", "lastModifiedDateTime": "2023-11-05T12:12:00.44Z" }, "file": { "mimeType": "application/pdf", "hashes": { "sha1Hash": "8FE5FAFF1515FC55AAC59F6483AC1FDC3EE0F799" } }, "lastModifiedBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal" }, "shared": { "sharedDateTime": "2023-11-05T12:12:39.753Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } } }, { "@odata.type": "#microsoft.graph.driveItem", "createdDateTime": "2023-11-05T07:36:51.77Z", "cTag": "adDozQUUxRDc2NEI3MEIyNUIzITEwNy42MzgzNDc3MTAwMDU1MzAwMDA", "eTag": "aM0FFMUQ3NjRCNzBCMjVCMyExMDcuMg", "id": "3AE1D764B70B25B3!107", "lastModifiedDateTime": "2023-11-05T08:50:00.553Z", "name": "test", "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCaQ", "parentReference": { "driveId": "3ae1d764b70b25b3", "driveType": "personal" }, "remoteItem": { "id": "4248D082B18F56F3!105", "lastModifiedDateTime": "2023-11-05T08:48:39.71Z", "name": "test", "size": 0, "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCaQ", "createdBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "fileSystemInfo": { "createdDateTime": "2023-11-05T07:33:16.7666667Z", "lastModifiedDateTime": "2023-11-05T07:33:16.7666667Z" }, "folder": { "childCount": 0, "view": { "viewType": "thumbnails", "sortBy": "name", "sortOrder": "ascending" } }, "lastModifiedBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal" }, "shared": { "sharedDateTime": "2023-11-05T07:36:51.77Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } } } ] }Result
/v1.0/me/drive/sharedWithMeforUser C{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/microsoft.graph.sharedWithMe?$select=audio,bundle", "value": [ { "@odata.type": "#microsoft.graph.driveItem", "@microsoft.graph.downloadUrl": "https://gljo7a.bn.files.1drv.com/y4mwBO3qDYmDJeYx4a6egHpFQHb00JvRF_T0k2Dy1sufJRAeFXgO0tZL20iyMIuf1-2cAg649PHaTlokMSXBvWVqr-xhE0REl36u3T5tjAdLSuSGrdVPiimCoXn_m6eu5FIWD42ktiWCv5QCe6ypUPJCZfMMV9Z4exFXJIePMJAgir0JdNqvaM5NR4eec5KEeIxFCJmKTXGSThP9Q7nQnzU_g", "createdDateTime": "2023-11-05T12:16:36.013Z", "cTag": "aYzo4MEJGNjY0QzNEREIxRUIhMTA3LjI1Nw", "eTag": "aODBCRjY2NEMzRERCMUVCITEwNy40", "id": "80BF664C3DDB1EB!107", "lastModifiedDateTime": "2023-11-05T12:16:59.743Z", "name": "card.pdf", "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCbA", "parentReference": { "driveId": "80bf664c3ddb1eb", "driveType": "personal" }, "remoteItem": { "id": "4248D082B18F56F3!108", "lastModifiedDateTime": "2023-11-05T12:16:37.733Z", "name": "card.pdf", "size": 5333805, "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCbA", "createdBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "fileSystemInfo": { "createdDateTime": "2023-11-05T12:12:00.44Z", "lastModifiedDateTime": "2023-11-05T12:12:00.44Z" }, "file": { "mimeType": "application/pdf", "hashes": { "sha1Hash": "8FE5FAFF1515FC55AAC59F6483AC1FDC3EE0F799" } }, "lastModifiedBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal" }, "shared": { "sharedDateTime": "2023-11-05T12:16:36.013Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } } }, { "@odata.type": "#microsoft.graph.driveItem", "createdDateTime": "2023-11-05T08:48:19Z", "cTag": "adDo4MEJGNjY0QzNEREIxRUIhMTA2LjYzODM0NzcwOTMwMDgwMDAwMA", "eTag": "aODBCRjY2NEMzRERCMUVCITEwNi4w", "id": "80BF664C3DDB1EB!106", "lastModifiedDateTime": "2023-11-05T08:48:50.08Z", "name": "test", "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCaQ", "parentReference": { "driveId": "80bf664c3ddb1eb", "driveType": "personal" }, "remoteItem": { "id": "4248D082B18F56F3!105", "lastModifiedDateTime": "2023-11-05T08:48:39.71Z", "name": "test", "size": 0, "webUrl": "https://1drv.ms/u/s!APNWj7GC0EhCaQ", "createdBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "fileSystemInfo": { "createdDateTime": "2023-11-05T07:33:16.7666667Z", "lastModifiedDateTime": "2023-11-05T07:33:16.7666667Z" }, "folder": { "childCount": 0, "view": { "viewType": "thumbnails", "sortBy": "name", "sortOrder": "ascending" } }, "lastModifiedBy": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } }, "parentReference": { "driveId": "4248d082b18f56f3", "driveType": "personal" }, "shared": { "sharedDateTime": "2023-11-05T08:48:19Z", "owner": { "user": { "displayName": "Florian Schade", "id": "4248d082b18f56f3" } } } } } ] }