Core: Add oc:privatelink PROPFIND property for files on old and new dav endpoints

Created on 12 Sep 2017  Â·  17Comments  Â·  Source: owncloud/core

Define a new property "oc:privatelink" that returns the private link as generated in the share panel.

  • Use the IURLGenerator and the proper route and pass in the file id.
  • Most of the code should live in the FILES_PLUGIN.
  • The property must be protected (read-only).
enhancement junior job statuSTALE

All 17 comments

Also add a capabilitiy:

  • [ ] add oc:privatelink property in FilesPlugin + unit tests
  • [ ] add capability

Just to be sure: Link generated with new method will be used in web UI too?

The web UI could be rewired to use this property, yes. Not sure if needed though.

It would be cool, if private link from web UI also would respect settings from config.php, like 'overwritehost' etc…

@michaelstingl I think it should already as it should be using the URL generator from JS.

Let's double check this anyway:

  • [ ] make sure web UI uses the same / a similar mechanism to make sure overwritehost is taken into account

@michaelstingl did you observe any cases where said link did not ? That would be a bug...

did you observe any cases where said link did not

Never tested - I only found links generated in clients showed different behaviour.

I can only find a "Public-Link" in the Ui is it the same?

looks like you found it 😄

can you also extend the capabilities to say something like "privateLinks => true" ?

and add a unit test...

Request:
PROPFIND http://localhost:8000/remote.php/dav/files/admin/foo/zubulski.txt

<?xml version='1.0' encoding='utf-8'?>
<propfind xmlns="DAV:">
  <prop>
    <privatelink xmlns="http://owncloud.org/ns"/>
  </prop>
</propfind>

Response:

<?xml version='1.0' encoding='UTF-8'?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"
xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/"
xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/files/admin/foo/zubulski.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:privatelink>http://localhost:9090/index.php/f/22</oc:privatelink>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

@ckamm @SamuAlfageme @davivel @jesmrec Could you provide a quick feedback if @IljaN 's approach works for you?

works for me

works for me as well

@michaelstingl works for you and all three clients?
Otherwise reopen please.

@felixboehm If it works for @jesmrec and @ckamm , it works for me too 😄

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings