A SoLiD server implemented in rust.
Work (barely) In Progress. Not usable at all.
See the issues and Milestones to get an idea of the on going work.
PUT
, POST
, PATCH
with 400 when no Content-Type
headerThere doesn't seem to be any already existing LDP servers in Rust, so this is from scratch.
[ ] MUST support LDP containers
[ ] MUST 403 when trying to POST with a slug indicating the auxiliary resource
[ ] MUST 409 when someone tries to PUT or PATCH container's containment directly
[ ] MUST 405 a request to delete the storage root or its acl
[ ] MUST remove the reference of a deleted resources from it's container too
[ ] MUST delete auxiliary resources when deleting a resource
[ ] MUST support DELETE of empty containers
[x] Read Resources (GET, HEAD, OPTIONS)
.ttl->application/ld+json
et al.) (Accept
header)[ ] Write Resources
[ ] Read Containers
[ ] Write Containers?
acl:Control
privilege to access acl docThis is set up as a Cargo Workspace. The workspace parent crate is here, and the server crate is a member.
This parent crate is the CLI binary which is a very minimal wrapper around everything in ther server crate. The server crate is the actual application.
The gist of the code structure is as follows: there is a module for each of the major specs that are involved in a Solid server
HTTP: The http module handles various things about the HTTP related specs. Handles 404 detection, Conditional Requests, Accept Header, etc
LDP: The ldp module handles the things which are particular to the LDP specs. Handles LDP-Resource and LDP-Container related logic
More TBD.
Currently there are no pre-build binaries. To run the server you must run it from source using cargo
.
# clone the repo
cd solid-rust
cargo run # [-- -p port-number]
Tests are run by running Postman's newman from within a cargo integration test. The tests will start the server on port 7171, then execute various requests against 127.0.0.1:7171.
Unfortunately, this means you have to have [newman
] installed. npm install -g newman
. Alternatively, you can install the man Postman client and import the test suite and run it there.
More on using Postman for tests here.
cd solid-rust/server
cargo test
When it makes sense, simply write unit tests directly in the rust source code like normal.
Intergation tests are written in nodejs, using postmam. The best way to write more integration tests is to use Postman. You can import the test suite, add your own requests/tests scripts, then export back into the repo.
Contributions are welcome!
One major contribution we need is json-ld support. I haven't found any existing rust crate for interacting with rdf through json-ld.