solid-nextcloud
solid-nextcloud copied to clipboard
Secure WebSockets
The new Notifications protocol that is expected to become required in addition to the current pubsub protocol requires:
- a new discovery mechanism, same as for webhooks
- auth checks, same as for webhooks
- a new
pubformat, same as for webhooks
So far I created the rudimentary https://github.com/pdsinterop/solid-nextcloud/blob/main/solid/lib/Controller/SolidWebsocketController.php which points to the old pubsub server.
I thought of a way to improve this:
- add a second port to the pubsub server
- when a client subscribes, create a corresponding webhook subscription, but as the target, put the new port of the pubsub server + an auth token
- give the URL with auth token to the client
- the pubsub server second port forwards webhook messages into the open websocket (if any) that matches its token
Ah wait, the webhook sends a POST body, not a GET query, of course.
OCA\\Solid\\Controller\\SolidWebhookController::registerWs(): Argument #1 ($topic) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 225
Got the tests passing on my laptop, now let's see if they also pass in GitHub Actions.