-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a default expiration date is set, public shares cannot be created via OCS without an expiration date #10178
Comments
All the linked issues are unrelated (or at least: this is not a duplicate of them). Technically I consider this a bug, not an enhancement, because you can achieve this behaviour when UPDATING a share, but not when CREATING it. To me this looks like an edge case (explicitly no expiration intended) was missed during the implementation of createShare. |
I'll look into this. |
@Dagefoerde I see what you want to do. |
Ok so... the issue here is that we set the expiration date in the sharemanager. So if you set it to null (which it is by default) it will actually be set in the sharemanager on share creation A possible solution would be if explicitly an empty string is passed we set the date to some invalid expiration. If that is the case we just ignore the default expiration date. Unless it is enforced of course. @Dagefoerde as a quick hack you could just try to remove the expiration date on the share you get back. |
@rullzer is the following sequence what you mean:
it works as described above, i.e. the invocation of createShare via the first command creates a share that expires after 7 days (my default expirationdate), even though And I agree; if the expiration date is enforced this does not work (I get a |
@Dagefoerde yes that is what I mean. Sure and I'll look into that. But since freeze is soon this probably won't be fixed in the upcomming releases |
Current status today at my Nextcloud Hub II 23.0.4: still not fixedCreating shares with OCS (https://my.server/cloud/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2fshare-group-test.txt&format=xml) either
This issue has been tested with following environments:
Expected result
|
This should be fixed in Nextcloud 28.0.7, Nextcloud 29.0.3 and the upcoming Nextcloud 30. |
The Moodle Nextcloud repository creates public shares via OCS in order to create links for use in Moodle. These links are expected to never expire, because you don't know for how long this link should be reachable from a Moodle course (usually for the duration of the term, but in some cases a course might last forever). However, we are unable to tell OCS that a share should last indefinitely: If we try, it always uses the default expiration date set by the administrator.
ShareAPIController treats empty dates like this:
server/apps/files_sharing/lib/Controller/ShareAPIController.php
Lines 451 to 458 in a22bc0e
Therefore we see no way to explicitly tell OCS to create a share with no expiration date if a default expiration date is set.
Steps to reproduce
expirationDate
(''
)Expected behaviour
If an empty string is passed no expiration date should be set for the given share.
We would expect something similar to
updateShare
where the expiration date is handled as follows:server/apps/files_sharing/lib/Controller/ShareAPIController.php
Lines 763 to 772 in a22bc0e
Actual behaviour
The default expiration date is used.
The text was updated successfully, but these errors were encountered: