And wac-ldp exposes BlobTree and makeHandler, but I'm thinking of changing this to:
constructor (port: number, aud: string, skipWac: boolean) {
this.port = port
this.storage = new BlobTreeInMem() // singleton in-memory storage
const wacLdp = new WacLdp(this.storage, aud, new URL('wss://localhost:8443'), skipWac)
this.server = http.createServer(wacLdp.handler.bind(wacLdp))
}
The advantage would be:
websockets-pubsub would subscribe to events from WacLdp rather than from BlobTree, so they would contain URLs instead of storage paths.
websockets-pubsub can then call WacLdp.checkAccess(webId: URL, origin: string, resource: URL, mode: URL) instead of having to pass a BlobTree and checking access on a storage path of that BlobTree.
in general, cleaner separation between the storage layer which thinks in terms of storage paths, and the WacLdp module as a whole, which exposes interfaces (its http request handler but also its change event and accessCheck function) that think in terms of URLs
The pod-server requires both websockets-pubsub's Hub object and wac-ldp's App object.
Currently wac-ldp's Server constructor does this:
And wac-ldp exposes BlobTree and makeHandler, but I'm thinking of changing this to:
The advantage would be:
WacLdp.checkAccess(webId: URL, origin: string, resource: URL, mode: URL)
instead of having to pass a BlobTree and checking access on a storage path of that BlobTree.