-
Notifications
You must be signed in to change notification settings - Fork 44
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
Slideshow pane breaks on CSS #301
Comments
I mean |
You actually mean I suggest editing your original post (editing is available through the three-dots at the upper right of your comments) to reflect your correction, as this will help future readers more quickly understand the issue. |
The media type now seems to be correct, e.g. CSS is providing the container triples However, slideshow pane is still broken on CSS for private images because it gets a 401 Unauthorized for every image, i.e. the DPOP token is not being provided in the GET request. |
I suggest we move this to using an authenticated fetch of the image data and set it as a blob as recommended by Ruben in the linked issue above and discussed at https://forum.solidproject.org/t/how-to-add-inline-content-in-an-authenticated-solid-app/4929/5 const response = await fetch(src);
const blob = await response.blob();
imageData = URL.createObjectURL(blob);
img.setAttribute('src', imageData) If this sounds ok, I'll put a PR on my todo list. Note that the original issue is addressed in CSS by adding the MetadataExtender |
const img = figure.appendChild(dom.createElement('img'))
img.setAttribute( 'crossOrigin', 'use-credentials')
img.setAttribute('src', images[i].uri) |
The underlying problem is that we need to use the authenticated fetch function provided e.g. by solid-client-authn The problem therefore applies to any inline content that does not know that the authenticated fetch exists. As far as I understand, include-credentials does not provide any mechanism to specify that an arbitrary authenticated function should be used, so it would only become a solution with browser support. Btw, it needs to be a function, not fixed credentials because the new authentication generates a new dpop token for every request. |
To my knowledge the old authentication already produced an authenticated-fetch. @jeff-zucker have you any hints. And will the blob work for sized videos or music. |
Sorry, I may have misunderstood. Do you want to support videos and/or audio in the slideshow pane? With the old authentication the slideshow pane did not use the authenticated fetch. It relied on the cookie. |
Trying to understand the problem I checked recently my css pod in mashlib and my image loads both on Firefox and Chrome. |
Hi @theRealImy, is that a public or private image? |
@theRealImy - I suppose that it's possible the fetch fix fixed this, I don't have any evidence either way. |
@josephguillaume it is public. |
Thanks for confirming. It sounds like the state is still the same as in my earlier comment: #301 (comment) |
@josephguillaume ok, I understand. It is the same problem and your/Ruben's proposed solution is good! Could you plan a PR -> I will test it then. |
I do not understand why this issue was closed. As far as I can see the original problem still exists - CSS does not list the media-type of resources in the GET of a container so therefore it is not possible to e.g. generate a slideshow from a list of videos because we don't know from the container which are videos. Mashlib could get around this by checking file by file but that seems inordinately cumbersome. @bourgeoa - am I missing something? |
There where 2 issues. One related to authenticated fetch (I think it was resolved, and a second one related to being able to get media-types in Get container. This last point could be described in a new issue with some caveats. Using mashlib on a pod should imply the pod to run a mashlib compatible filesystem. In such situation the media-types should be available, this is what does CSS recipes for mashlib in v4.0. To my understanding the media-types will be included by default in CSS with a filesystem on version 5.0. |
@bourgeoa, @joachimvh - I can confirm that v4.0.1 of the community server DOES provide media-types in the container listing when used with the mashlib recipe configuration and that the databrowser slideshow works on CSS. Closing the issue. |
CSS does not advertise the media-type of contained resources so when slideshowPane looks for images, it finds none since it is looking in the container for triples listing the item as of type ...iana/image... and CSS does not provide such triples in the container. I suggest we use the mime-types library to examine the path extension rather than looking for triples.
The text was updated successfully, but these errors were encountered: