solid_auth.pl - A Solid management tool
# Set your default webid export SOLID_WEBID=https://timbl.inrupt.net/profile/card#me # Authentication to a pod solid_auth.pl authenticate # Get the http headers for a authenticated request solid_auth.pl headers GET https://timbl.inrupt.net/inbox/ # Act like a curl command and fetch authenticated content solid_auth.pl curl -- -X GET https://timbl.inrupt.net/inbox/ # Add some data solid_auth.pl curl -- -X POST \ -H "Content-Type: text/plain" \ -d "abc" \ https://timbl.inrupt.net/public/ # Add a file solid_auth.pl curl -- -X PUT \ -H "Content-Type: application/ld+json" \ -d "@myfile.jsonld" \ https://timbl.inrupt.net/public/myfile.jsonld # Set a solid base url export SOLID_REMOTE_BASE=https://timbl.inrupt.net # List all resources on some Pod path solid_auth.pl list /public/ # Get some data solid_auth.pl get /inbox/ # Post some data solid_auth.pl post /inbox/ myfile.jsonld # Put some data solid_auth.pl -f put /public/myfile.txt myfile.txt # Patch data solid_auth.pl -f patch /public/myfile.txt.meta - <<EOF INSERT DATA { <> <http://example.org> 1234 } EOF # Create a folder solid_auth.pl -f put /public/mytestfolder/ # Delete some data solid_auth.pl delete /public/myfile.txt # Mirror a resource, container or tree mkdir /data/my_copy solid_auth.pl -r mirror /public/ /data/my_copy # Upload a directory to the pod # Add the -x option to do it for real (only a test without this option) solid_auth.pl -r upload /data/my_copy /public/ # Clean all files in a container # Add the -x option to do it for real (only a test without this option) solid_auth.pl --keep clean /demo/ # Clean a complete container # Add the -x option to do it for real (only a test without this option) solid_auth.pl -r clean /demo/
Your WebId.
The Base URL that is used for all delete, get, head, options post, put, patch requests.
The URL to a static client configuration. See etc/web-solid-auth.jsonld for an example. This file, edited for your own environment, needs to be published on some public accessible webserver.
etc/web-solid-auth.jsonld
Skip resources that already exist (mirror).
Delete local files that are not in the remote container (mirror).
Keep containers when cleaning data (clean).
Only update the data when the 'Etag' header matches the given string (put,patch). E.g. use the head command to find the ETag of a resource :
head
$ solid_auth.pl head /demo/LICENSE ... ETag: "189aa19989dc47eab46c9f2e8c47d0836bb08cb09f7863cbf3cd3bb9a751be27" ...
Now update the resource with ETag protection
$ solid_auth.pl \ --etag=189aa19989dc47eab46c9f2e8c47d0836bb08cb09f7863cbf3cd3bb9a751be27 \ put /demo/LICENSE LICENSE
Force overwriting existing resources (put, patch).
Recursive (clean, mirror, upload).
Do it for real. The commands clean and upload will run by default in safe mode.
clean
upload
Add a header to a request (repeatable) for get, post, head, options and delete.
get
post
options
delete
Start an authentication process for your WebId. You will be presented with a URL that you need to open in a webbrowser. After a successfull login the command can be closed.
The webbrowser needs to be opened on the same host as the where you where you run the solid_auth.pl command.
Return the Authentication and DPoP headers for a HTTP METHOD request to URL.
METHOD
URL
Execute a curl command with Authentication and DPoP headers added. Add a -- option to the CURL-OPTS to stop solid_auth.pl from interpreting Curl options.
--
CURL-OPTS
List the resources in a LDP container at URL.
Mirror the contents of a container to a local directory. Optional provide -r option for recursive mirror.
-r
Upload a directorty to a container. Optional provide -r option for recursive upload. With the -x option, the command will run in demo mode.
-x
Clean all resources in a directory. Optional provide -r option for recursive clean. With the -x option, the command will run in demo mode. With the --keep options all container will be kept.
--keep
Return the response of a HTTP GET request to URL.
Return the HTTP Message of a HTTP POST request of the FILE with MIMETYPE. Uses libmagic to guess the mimetype.
Return the HTTP Message of a HTTP PUT request of the FILE with MIMETYPE. Uses libmagic to guess the mimetype.
When the URL ends with a slash (/), then a new container will be created.
Send the contents of a SPARQL patch file or string to a URL. Return the HTTP Message of the HTTP PATCH request to the URL.
Return the HTTP Header of a HTTP HEAD request to URL.
Return the HTTP Header of a HTTP OPTIONS request to URL.
Return the HTTP Message of a HTTP DELETE request to URL.
Show the contents of the JWT id token.
Show the contents of the JWT access token.
This was very much inspired by the Python solid-flask code by Rai http://agentydragon.com at https://gitlab.com/agentydragon/solid-flask, and Jeff Zucker's <https://github.com/jeff-zucker> Solid-Shell at https://www.npmjs.com/package/solid-shell.
This software is copyright (c) 2021 by Patrick Hochstenbach.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Web::Solid::Auth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::Solid::Auth
CPAN shell
perl -MCPAN -e shell install Web::Solid::Auth
For more information on module installation, please visit the detailed CPAN module installation guide.