Skip to content

feat: Allow filtering in ConstantConverter based on type - #925

Merged
joachimvh merged 1 commit into
mainfrom
feat/constant-types
Sep 2, 2021
Merged

feat: Allow filtering in ConstantConverter based on type#925
joachimvh merged 1 commit into
mainfrom
feat/constant-types

Conversation

@joachimvh

Copy link
Copy Markdown
Member

Closes #896.

@joachimvh joachimvh added the semver.minor Requires a minor version bump label Aug 20, 2021
@joachimvh joachimvh added this to the v1.1.0 milestone Aug 20, 2021

@RubenVerborgh RubenVerborgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!!

Comment thread src/storage/conversion/ConstantConverter.ts
@joachimvh
joachimvh merged commit ab06dd3 into main Sep 2, 2021
@joachimvh
joachimvh deleted the feat/constant-types branch September 2, 2021 05:56
@angelo-v

Copy link
Copy Markdown

Thanks! Can you document how it is used?

I tried "options_disabledMediaRanges": ["application/pdf"] but yet instead of the raw PDF the data browser is served. My config is:

{
      "comment": "Serve the Mashlib Data Browser as default container representation",
      "@id": "urn:solid-server:default:DefaultUiConverter",
      "@type": "ConstantConverter",
      "filePath": "./node_modules/mashlib/dist/databrowser.html",
      "contentType": "text/html",
      "options_minQuality": 1,
      "options_container": true,
      "options_document": true,
      "options_disabledMediaRanges": ["application/pdf"]
}

@RubenVerborgh

Copy link
Copy Markdown
Member

That looks good! You're running v1.1.0?
Perhaps post a debug log, then we can check.

@angelo-v

Copy link
Copy Markdown

Yes I am running v1.1.0.

Turns out the option works fine, but the problem lies in ACL / authentication. If I grant public access to the PDF I can load it in the browser, but if the access is restricted it serves the data browser.

@RubenVerborgh

Copy link
Copy Markdown
Member

Super, that was the intended behavior, because Databrowser has a UI that helps you sign in.

@angelo-v

Copy link
Copy Markdown

Not sure if the behaviour is really intended like that, because even after signing in via UI I am getting served the HTML, not the raw PDF. I guess this is because the browser's get request ist getting a 401 still, since it does not include an Authorization header and plain cookies are not supported? (I tried with a data browser that is using @inrupt/solid-client-authn-browser, so this is not an issue with old-style auth)

@RubenVerborgh

RubenVerborgh commented Sep 21, 2021

Copy link
Copy Markdown
Member

I guess this is because the browser's get request ist getting a 401 still, since it does not include an Authorization header and plain cookies are not supported?

Yes, Databrowser is currently not compatible with the Solid specification; there is an active branch that is adding support, expected in the next couple of weeks.

@joachimvh joachimvh removed this from the v2.0.0 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver.minor Requires a minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selectively enable/disable ConstantConverter for certain MIME types

3 participants