Skip to content

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

Closed

Description

@PVince81

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).

Activity

  1. added this to the milestone on Sep 12, 2017
  2. PVince81 commented on Sep 14, 2017

    @PVince81
    ContributorAuthor

    Also add a capabilitiy:

    • add oc:privatelink property in FilesPlugin + unit tests
    • add capability
  3. self-assigned this
    on Sep 14, 2017
  4. michaelstingl commented on Sep 14, 2017

    @michaelstingl

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

  5. PVince81 commented on Sep 14, 2017

    @PVince81
    ContributorAuthor

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

  6. michaelstingl commented on Sep 14, 2017

    @michaelstingl

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

  7. PVince81 commented on Sep 14, 2017

    @PVince81
    ContributorAuthor

    @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...

  8. michaelstingl commented on Sep 14, 2017

    @michaelstingl

    did you observe any cases where said link did not

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

  9. IljaN commented on Sep 14, 2017

    @IljaN
    Contributor

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

  10. PVince81 commented on Sep 14, 2017

    @PVince81
    ContributorAuthor

    looks like you found it 😄

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

  11. PVince81 commented on Sep 14, 2017

    @PVince81
    ContributorAuthor

    and add a unit test...

  12. IljaN commented on Sep 14, 2017

    @IljaN
    Contributor

    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>
  13. michaelstingl commented on Sep 14, 2017

    @michaelstingl

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

  14. jesmrec commented on Sep 14, 2017

    @jesmrec
    Member

    works for me

  15. ckamm commented on Sep 15, 2017

    @ckamm

    works for me as well

  16. felixboehm commented on Sep 26, 2017

    @felixboehm
    Contributor

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

  17. michaelstingl commented on Oct 5, 2017

    @michaelstingl

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

  18. lock commented on Aug 1, 2019

    @lock

    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.

  19. locked as resolved and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions