Linked Web Storage (LWS) support for the Community Solid Server (CSS), packaged as a Components.js plugin. The server can serve LWS on its own, or together with the Solid Protocol, using WAC or ACP for authorization.
The implementation follows the LWS editor's draft of 28 September 2026. As LWS is still a draft, this package is alpha software: releases may contain breaking changes that follow the specification. The goal is to merge these components into CSS once LWS reaches Candidate Recommendation.
This package targets the next major version of CSS (v8, the versions/next-major branch),
including a few fixes that are not released yet.
Until those are released, the development dependency points to a CSS branch that contains them.
See Core changes below.
Install the package next to CSS:
npm install @solid/community-server @solid/community-server-lwsStart a server with one of the configurations of this package, using the package folder as the module root so Components.js finds both modules:
npx community-solid-server -m . -c node_modules/@solid/community-server-lws/config/lws.json -f data/From a clone of this repository, npm start runs the lws.json configuration.
There are four configurations that enable LWS.
All of them store data on disk and allow the creation of accounts and pods, just like the CSS file.json.
| Configuration | Protocols | Authorization |
|---|---|---|
lws.json |
LWS | WAC |
lws-acp.json |
LWS | ACP |
solid-lws.json |
Solid + LWS | WAC |
solid-lws-acp.json |
Solid + LWS | ACP |
Every pod is an LWS storage. In the dual configurations, Solid and LWS clients can work with the same pods.
Custom configurations can combine the options described in config/README.md
with the CSS configuration options, which use the css: prefix, while the options of this package use lws:.
The LWS access grants are added to the WAC or ACP permission reader,
so the LWS options always need to be combined with WAC or ACP authorization.
The URI of a storage is the URI of the root container of the pod.
Every response contains a Link header with relation https://www.w3.org/ns/lws#storage pointing to the storage.
A GET request to the storage URI with an Accept header that prefers application/lws+cid,
or without an Accept header, returns the storage description.
Other requests return the root container.
In the LWS-only configurations, a request that only accepts */* also receives the storage description;
in the dual configurations it receives the root container, as Solid clients expect.
The storage description is public, so clients can discover the services of a storage without credentials.
Containers are represented as application/lws+json.
In the LWS-only configurations, application/ld+json and application/json return the same document.
In the dual configurations, application/ld+json keeps returning the LDP representation that Solid clients expect,
so LWS clients need to request application/lws+json or application/json.
Containers can be created with a POST or PUT request
that has a Link: <https://www.w3.org/ns/lws#Container>; rel="type" header,
next to the LDP container types.
Responses contain the up, type, and linkset links required by LWS,
and successful modifications return 204 No Content.
JSON resources can be modified with JSON Merge Patch requests.
The metadata of a resource is exposed as a linkset,
linked from the resource with rel="linkset".
This is the same resource as the description resource of the resource,
which can be requested as application/linkset+json,
and modified with a JSON Merge Patch request on that linkset.
Server-managed links, such as the containment triples, can not be modified.
The server contains an LWS authorization server.
Its metadata can be found at /.well-known/lws-configuration.
A 401 response contains a WWW-Authenticate header with an as_uri parameter pointing to it,
and a realm parameter with the storage URI.
Clients obtain an access token by exchanging an authentication credential at the token endpoint
using OAuth 2.0 Token Exchange,
with the storage URI as resource parameter.
The following authentication suites are supported:
- Self-signed
did:keycredentials (urn:ietf:params:oauth:token-type:jwt). - Self-issued credentials of agents with an HTTPS identifier,
whose controlled identifier document contains the verification key (
urn:ietf:params:oauth:token-type:jwt). - OpenID Connect ID tokens (
urn:ietf:params:oauth:token-type:id_token). The controlled identifier document of the subject needs to contain anhttps://www.w3.org/ns/lws#OpenIdProviderservice pointing to the issuer. WebIDs with asolid:oidcIssuertriple are also accepted, so the accounts of the identity provider of this server, and of other Solid identity providers, can be used.
The resulting access tokens are presented as Bearer tokens.
The agent in the access token is used as the WebID in WAC and ACP policies,
so access can be granted to a did:key identifier the same way as to a WebID.
In the dual configurations, Solid-OIDC DPoP and Bearer tokens are also accepted.
Bearer tokens that have a webid claim are treated as Solid-OIDC tokens.
Container listings with more than 1000 members are split into pages.
Every page has first and last links, and prev and next links where applicable.
The page URIs have a page query parameter, but clients should only follow the links.
The items of a page only contain the members on that page, while totalItems is the number of all members.
The page size can be changed with the options_pageSize parameter of the ContainerToLwsJsonConverter
in config/util/representation-conversion/converters/lws-container.json.
A DELETE request with a Depth: infinity header deletes a container together with all resources in it.
This requires the delete permission on all those resources.
The deletion is not atomic: if a resource can not be deleted, the resources deleted before it stay deleted.
Errors are described with problem details (application/problem+json),
unless the client prefers a media type the error can be converted to, such as HTML or Turtle.
Every storage has an access request container at .lws/requests/
and an access grant container at .lws/grants/, relative to the storage URI.
Both are advertised in the storage description with the https://www.w3.org/ns/lws#AccessProfile profile.
The containers are created when the first request for a resource in the storage arrives.
- Any authenticated agent can create an access request by posting it to the access request container.
- Access grants are created by posting them to the access grant container. They grant access next to the WAC or ACP policies, so a grant can only add permissions. Deleting a grant revokes it.
- The containers themselves are protected by the WAC or ACP policies of the storage,
so by default only the owner of the storage can read the requests and create grants.
Make sure the policies of the
.lws/container do not give other agents access to these containers.
The posted documents are validated against the Access Profile of LWS,
and can not be modified afterwards: only GET, HEAD, and DELETE are allowed on them.
The policies of a grant are interpreted as follows:
- The
assigneeis compared with the WebID or other identifier of the agent.http://xmlns.com/foaf/0.1/Agentgrants access to everyone, including unauthenticated agents. - A policy only applies to the resources listed in its
target, so targets are not recursive. The targettypelimits the resources to containers (Container), data resources (DataResource), or both (StorageResource). A policy without a target does not grant anything. Grants can not target the.lws/container or its contents. - The
read,modify, anddeleteactions correspond to reading, modifying, and deleting the target. Thecreateaction on a container allows creating resources directly in that container. - All constraints need to be satisfied:
clientis compared with the client identifier of the request,formatwith the media type of the resource,typewith its types, anddateTimewith the current time.purposeconstraints are always considered to be satisfied, as the server can not verify the purpose of a request.
When a grant with an inbox is created, a notification is sent to that inbox.
The grants are cached in memory, so this feature does not work on a server with multiple worker threads.
The server supports the LWS Webhook notification suite.
Its subscription endpoint is /.notifications/lws/, which is advertised in the storage description.
- A
POSTrequest with aWebhookSubscriptioncreates a subscription, if the subscriber can read all resources in itstopicarray. Subscriptions to a container also cover all resources contained in it, recursively. - A
GETrequest on the endpoint lists the subscriptions of the authenticated subscriber, and a subscription can be read and deleted by its subscriber. - Notifications about creating, updating, and deleting resources are sent to the
inboxof the subscription, but only if the subscriber can still read the resource when the change happens. The notifications do not contain the agent that made the change. - Notifications are signed with HTTP Message Signatures.
The key is in the
verificationMethodof the storage description. - Deliveries that fail with a
5xxresponse or a network error are tried again twice. Subscriptions are removed after 5 failed deliveries in a row, or when the inbox answers with410 Gone.
Like the access grants, the subscriptions are cached in memory, so this feature does not work on a server with multiple worker threads. The Solid notification channels remain available next to the LWS notifications.
The following parts of LWS are not supported yet:
- Notifications to the storage controller when an access request is created, as LWS does not define how the inbox of the storage controller is found.
- The SAML authentication suite.
The following changes to CSS are needed by this package and are not part of CSS yet:
-
Return
412instead of304whenIf-MatchorIf-Unmodified-Sincefails onGETandHEAD(CommunitySolidServer#2270). -
ETags and
Last-Modifiedfor description resources (CommunitySolidServer#2269). -
Evaluate conditions on description resources against the described resource (CommunitySolidServer#2267).
-
Identifiers for the handlers in the default configurations (CommunitySolidServer#2268).
-
The memory backend returns the metadata of the children of a container. This is already on the CSS
mainbranch (commitb7225aa), but not yet onversions/next-major. Without it, theformatof the items in a container listing is wrong when the memory backend is used, which makes 4 integration tests fail. The file backend used by the configurations of this package is not affected. -
UnprocessableEntityHttpErroris not exported from the main entry point of CSS, so this package imports it from@solid/community-server/dist/util/errors/UnprocessableEntityHttpError.
The first four are combined on top of versions/next-major in the
feat/next-major-upstream-fixes
branch, which is the CSS version used for development and testing.
npm install
npm run build
npm test
npm run lintThe integration tests run against the compiled code in dist/, so run npm run build before them.