JonathanTreffler / sharerenamer

A simple Nextcloud app that lets you customize file/folder share links
GNU Affero General Public License v3.0
97 stars 10 forks source link

Is it possible to use via CLI or API? #221

Open xeruf opened 1 year ago

xeruf commented 1 year ago

I use curl to batch create shares via the OCS Share API: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html#create-a-new-share

Is there anything similar possible when using this app to batch rename the shares?

JonathanTreffler commented 1 year ago

Currently not, as the rename api route performs a CSRF check (see https://github.com/JonathanTreffler/sharerenamer/pull/31#issuecomment-882139672), you can patch the sharerenamer app locally for yourself by adding the NoCSRFRequired annotation (see https://github.com/JonathanTreffler/sharerenamer/pull/31#issuecomment-881188860).

A solution would be to add a second api route, that does not perform the check, many other apps have this, I have just not come around to implementing it here, as only few people need it.