Skip to content
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

[stable10] Enable PreviewPlugin on public webdav #34472

Closed
wants to merge 1 commit into from

Conversation

PVince81
Copy link
Contributor

Description

Also provide Webdav-style URLs with extra args for requesting previews on the public webdav endpoint. We already have this on non-public webdav endpoint.

Related Issue

None raised but follow up of #31050 which brought Webdav previews.

Motivation and Context

While working on the media viewer app came the question about how to retrieve the previews on the public endpont after realizing that the magic Webdav URLs did not work there.

How Has This Been Tested?

⚠️ doesn't work ⚠️

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Port to master

@PVince81 PVince81 added this to the development milestone Feb 12, 2019
@PVince81 PVince81 self-assigned this Feb 12, 2019
@PVince81
Copy link
Contributor Author

note: I did this quickly to research why we didn't do this in the first place.

I suspect that @DeepDiver1975 already attempted this and failed for the same reason.

For the PROPFIND and all Webdav operations we already included the header "X-Requested-With: XMLHttpRequest" which bypasses the auth here: https://github.com/owncloud/core/blob/stable10-publicpreview-webdav/apps/dav/lib/Connector/PublicAuth.php#L104

However for public previews, it is not an XHR call as it's done by image tags, so when calling public webdav it receives a 401 and the browser asks for credentials...

Maybe for this case we'd need another kind of bypass.

This PR is only a base for discussion. I'm fine abandoning this if not doable.
Note that we'll need some public API for Phoenix for public previews at some point...

Maybe we need to rework the public webdav endpoint anyway... see #29369

@codecov
Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #34472 into stable10 will increase coverage by <.01%.
The diff coverage is 20%.

Impacted file tree graph

@@              Coverage Diff               @@
##             stable10   #34472      +/-   ##
==============================================
+ Coverage       63.57%   63.58%   +<.01%     
  Complexity      19146    19146              
==============================================
  Files            1265     1265              
  Lines           75314    75312       -2     
  Branches         1291     1288       -3     
==============================================
+ Hits            47884    47889       +5     
+ Misses          27050    27043       -7     
  Partials          380      380
Flag Coverage Δ Complexity Δ
#javascript 53.38% <0%> (+0.05%) 0 <0> (ø) ⬇️
#phpunit 64.68% <33.33%> (ø) 19146 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
apps/dav/appinfo/v1/publicwebdav.php 0% <0%> (ø) 0 <0> (ø) ⬇️
apps/dav/appinfo/v1/webdav.php 0% <0%> (ø) 0 <0> (ø) ⬇️
apps/files_sharing/js/public.js 43.93% <0%> (+1.7%) 0 <0> (ø) ⬇️
apps/dav/lib/Connector/Sabre/ServerFactory.php 95.89% <100%> (+0.11%) 10 <0> (ø) ⬇️
...eratedfilesharing/lib/Controller/OcmController.php 66.26% <0%> (+0.2%) 30% <0%> (ø) ⬇️
apps/files_trashbin/lib/Expiration.php 98.27% <0%> (+1.72%) 29% <0%> (ø) ⬇️
apps/encryption/lib/Session.php 100% <0%> (+1.96%) 22% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f1c2c3...7a6b516. Read the comment docs.

@PVince81
Copy link
Contributor Author

closing in favor of #29369 in the future

@PVince81 PVince81 closed this Feb 18, 2019
@PVince81 PVince81 deleted the stable10-publicpreview-webdav branch February 18, 2019 06:55
@lock lock bot locked as resolved and limited conversation to collaborators Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant