diff --git a/README.md b/README.md index a9e0ca7..725fe5c 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,10 @@ webfuse solves this problem by using the [WebSocket](https://en.wikipedia.org/wi With webfuse it is possible to implement remote filesystems based on websockets. A reference implementation of such a daemon is provided within the examples. The picture above describes the workflow: -- The websocket filesystem daemon (*webfuse daemon*) mounts a filesystem on startup. - It starts the websocket server and waits for incoming connections. +- The websocket filesystem daemon (*webfuse daemon*) waits for incoming connections. -- A remote filesystem provider connects to webfuse daemon via websocket protocol. - The example includes such a provider implemented in HTML and JavaScript. +- A remote filesystem provider connects to webfuse daemon via websocket protocol and adds one or more filesystems. + *Note: the examples include such a provider implemented in HTML and JavaScript.* - Whenever the user makes filesystem requests, such as *ls*, the request is redirected via webfuse daemon to the connected filesystem provider @@ -275,10 +274,21 @@ Read from an open file. ### Requests (Provider -> Adapter) +#### add_filesystem + +Adds a filesystem. + + fs provider: {"method": "add_filesytem", "params": [], "id": } + webfuse daemon: {"result": {"id": }, "id": } + +| Item | Data type | Description | +| ----------- | ----------| ------------------------------- | +| name | string | name and id of filesystem | + #### authtenticate Authenticate the provider. -If authentication is enabled, a provider must be authenticated by the adapter before the adapter will send any messages. +If authentication is enabled, a provider must be authenticated by the adapter before filesystems can be added. fs provider: {"method": "authenticate", "params": [, ], "id": } webfuse daemon: {"result": {}, "id": } diff --git a/doc/authenticate.png b/doc/authenticate.png index b0df17d..b994033 100644 Binary files a/doc/authenticate.png and b/doc/authenticate.png differ diff --git a/doc/authenticate.uml b/doc/authenticate.uml index 00a5f52..263ac5b 100644 --- a/doc/authenticate.uml +++ b/doc/authenticate.uml @@ -1,12 +1,10 @@ @startuml participant "Filesystem Provider\n(e.g. Webbrowser)" as provider participant "webfuse\ndaemon" as daemon -actor "user" as user -group directory listing fails without authentication -user -> daemon : ls -daemon -> daemon : is_authenticated -daemon -->x user : error: no entry +group add filesystem fails without authentication +provider -> daemon : add_filesystem +daemon -->x provider : error: access denied end @@ -17,12 +15,10 @@ daemon -> daemon: check(credentials) daemon --> provider: result end -group directory listing succeeds after authentication -user -> daemon : ls -daemon -> daemon : is_authenticated -daemon -> provider : readdir -provider --> daemon : readdir_resp -daemon --> user : [., ..] +group add filesystem succeeds after authentication + provider -> daemon: add_filesystem + daemon -> daemon : fuse_mount + daemon -> provider: okay end @enduml \ No newline at end of file diff --git a/doc/concept.png b/doc/concept.png index 9ab4e90..64e3475 100644 Binary files a/doc/concept.png and b/doc/concept.png differ diff --git a/doc/concept.uml b/doc/concept.uml index a7ec266..f5d4cb0 100644 --- a/doc/concept.uml +++ b/doc/concept.uml @@ -4,7 +4,6 @@ participant "webfuse\ndaemon" as daemon actor "user" as user group startup -daemon -> daemon : fuse_mount daemon -> daemon : start ws end ... @@ -16,9 +15,15 @@ provider -> daemon : connect daemon -> daemon: check credentials daemon --> provider: okay end + + provider -> daemon: add_filesystem + daemon -> daemon : fuse_mount + daemon -> provider: okay + end ... + group directory listing user -> daemon : ls daemon -> provider : readdir