Repository navigation
Conversation
|
@kulmann @dragotin @JammingBen @michaelstingl @TheOneRing That legacy mode might be crucial in the transition process. BackgroundThe legacy OCS api was creating public links with more permissions than needed 🙈 Example - Folder With "Edit" Permission setcurl 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/RukBURtBXPmjBiM' \
-X 'PUT' \
-H 'authorization: Bearer <token>' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'ocs-apirequest: true' \
--data-raw 'permissions=15&name=Link&expireDate=' \
--compressed \
--insecureMagic number Read = 1
+ Write = 2
+ Create = 4
+ Delete = 8
------------
= Total 15Libregraph representation after wrong 🐛 conversion in the OCS handler (this does not happen on the new libregraph libregraphActions := []string{
"libre.graph/driveItem/standard/delete",
"libre.graph/driveItem/path/read",
"libre.graph/driveItem/quota/read",
"libre.graph/driveItem/content/read",
"libre.graph/driveItem/upload/create",
"libre.graph/driveItem/children/read",
"libre.graph/driveItem/deleted/read",
"libre.graph/driveItem/path/update",
"libre.graph/driveItem/deleted/update",
"libre.graph/driveItem/basic/read",
},We can see that
was accidentally For the new LibreGraph link types we removed 🗑️ these unneeded permissions. LibreGraph link types
SolutionWe now have a config ⚙️ which is enabled by default ( The basic idea is that legacy public links will disappear over time from all instances 😄 . |
b50d9ea to
d98d9ee
Compare
|
Kudos, SonarCloud Quality Gate passed! |
|
After thinking about it, my conclusion is that we need to do that cleanup later for ocis 6.0.0 when the OCS code is removed. |








Description
Enhancement: New public sharing via libregraph link types
We added libregraph link types to the graph service as a new set of api calls to replace the legacy OCS API. We added the endpoint to create links https://owncloud.dev/libre-graph-api/#/drives.permissions/CreateLink
and the linktype listing to the "SharedByMe" call. (Already done in another PR)
We also added a config to match legacy public links created by the OCS API to the new libregraph link types. This config switch is recommended for instances which were already existing before Infinite Scale 5.0.0 was released.
#7834
#7743
#6993
Related Issue
Motivation and Context
Make our APIs better 🎉
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: