solidos: Permissions pane causes 401 with PUT on CSS

When using the permissions pane to change an ACL file hosted on CSS, SolidOS will send a PUT request without an Authorization header, causing CSS to reply with 401.

In constrast, opening that same ACL file in the source pane, will generate the correct PUT request with the Authorization header, resulting in a 2xx.

This can be replicated with the Mashlib recipe.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (17 by maintainers)

Most upvoted comments

@aveltens found the problem https://github.com/solid/solid-ui/blob/48f3ebed3572bc099bfcd5b770fd5a3f4d738795/src/acl/access-groups.ts#L71

This is creating a node-fetch fetcher Just commenting out solves the issue.

@RubenVerborgh a test-version of mashlib@1.7.20-401 includes the PATCH resolving this issue.

@bourgeoa the code there creates a new store (newACLGraph) and an upadater for it without specifying a fetch, Which means you are correct that it uses the default cross-fetch. So we don’t need to do anything with the store, just with the fetcher for the updater. This can be done by this sequence :

  import {fetcher} from 'rdflib';
  const newACLGraph = graph() 
  const fetcher = fetcher(newACLGraph,{fetch:this.store.fetcher._fetch})
const updater ...

That will create a new store and an updater for it that uses the fetch from the existing store. I believe that is the desired effect.