.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SOLID_AUTH 1p" .TH SOLID_AUTH 1p "2021-11-04" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" solid_auth \- A Solid management tool .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # Set your default webid \& export SOLID_WEBID=https://timbl.inrupt.net/profile/card#me \& \& # Authentication to a pod \& solid_auth authenticate \& \& # Get the http headers for a authenticated request \& solid_auth headers GET https://timbl.inrupt.net/inbox/ \& \& # Act like a curl command and fetch authenticated content \& solid_auth curl \-\- \-X GET https://timbl.inrupt.net/inbox/ \& \& # Add some data \& solid_auth curl \-\- \-X POST \e \& \-H "Content\-Type: text/plain" \e \& \-d "abc" \e \& https://timbl.inrupt.net/public/ \& \& # Add a file \& solid_auth curl \-\- \-X PUT \e \& \-H "Content\-Type: application/ld+json" \e \& \-d "@myfile.jsonld" \e \& 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 list /public/ \& \& # Get some data \& solid_auth get /inbox/ \& \& # Post some data \& solid_auth post /inbox/ myfile.jsonld \& \& # Put some data \& solid_auth \-f put /public/myfile.txt myfile.txt \& \& # Patch data \& solid_auth \-f patch /public/myfile.txt.meta \- < 1234 } \& EOF \& \& # Create a folder \& solid_auth \-f put /public/mytestfolder/ \& \& # Delete some data \& solid_auth delete /public/myfile.txt \& \& # Mirror a resource, container or tree \& mkdir /data/my_copy \& solid_auth \-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 \-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 \-\-keep clean /demo/ \& \& # Clean a complete container \& # Add the \-x option to do it for real (only a test without this option) \& solid_auth \-r clean /demo/ .Ve .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" .IP "\s-1SOLID_WEBID\s0" 4 .IX Item "SOLID_WEBID" Your WebId. .IP "\s-1SOLID_REMOTE_BASE\s0" 4 .IX Item "SOLID_REMOTE_BASE" The Base \s-1URL\s0 that is used for all delete, get, head, options post, put, patch requests. .IP "\s-1SOLID_CLIENT_ID\s0" 4 .IX Item "SOLID_CLIENT_ID" The \s-1URL\s0 to a static client configuration. See \f(CW\*(C`etc/web\-solid\-auth.jsonld\*(C'\fR for an example. This file, edited for your own environment, needs to be published on some public accessible webserver. .SH "CONFIGURATION" .IX Header "CONFIGURATION" .IP "\-\-webid" 4 .IX Item "--webid" Your WebId. .IP "\-\-base" 4 .IX Item "--base" The Base \s-1URL\s0 that is used for all delete, get, head, options post, put, patch requests. .IP "\-\-clientid" 4 .IX Item "--clientid" The \s-1URL\s0 to a static client configuration. See \f(CW\*(C`etc/web\-solid\-auth.jsonld\*(C'\fR for an example. This file, edited for your own environment, needs to be published on some public accessible webserver. .IP "\-\-skip" 4 .IX Item "--skip" Skip resources that already exist (mirror). .IP "\-\-delete" 4 .IX Item "--delete" Delete local files that are not in the remote container (mirror). .IP "\-\-keep" 4 .IX Item "--keep" Keep containers when cleaning data (clean). .IP "\-\-etag=STRING" 4 .IX Item "--etag=STRING" Only update the data when the 'Etag' header matches the given string (put,patch). E.g. use the \f(CW\*(C`head\*(C'\fR command to find the ETag of a resource : .Sp .Vb 4 \& $ solid_auth head /demo/LICENSE \& ... \& ETag: "189aa19989dc47eab46c9f2e8c47d0836bb08cb09f7863cbf3cd3bb9a751be27" \& ... .Ve .Sp Now update the resource with ETag protection .Sp .Vb 3 \& $ solid_auth \e \& \-\-etag=189aa19989dc47eab46c9f2e8c47d0836bb08cb09f7863cbf3cd3bb9a751be27 \e \& put /demo/LICENSE LICENSE .Ve .IP "\-\-force | \-f" 4 .IX Item "--force | -f" Force overwriting existing resources (put, patch). .IP "\-r" 4 .IX Item "-r" Recursive (clean, mirror, upload). .IP "\-x" 4 .IX Item "-x" Do it for real. The commands \f(CW\*(C`clean\*(C'\fR and \f(CW\*(C`upload\*(C'\fR will run by default in safe mode. .IP "\-H name=value" 4 .IX Item "-H name=value" Add a header to a request (repeatable) for \f(CW\*(C`get\*(C'\fR, \f(CW\*(C`post\*(C'\fR, \f(CW\*(C`head\*(C'\fR, \f(CW\*(C`options\*(C'\fR and \f(CW\*(C`delete\*(C'\fR. .SH "COMMAND" .IX Header "COMMAND" .IP "authenticate" 4 .IX Item "authenticate" Start an authentication process for your WebId. You will be presented with a \&\s-1URL\s0 that you need to open in a webbrowser. After a successfull login the command can be closed. .Sp The webbrowser needs to be opened on the same host as the where you where you run the solid_auth command. .IP "headers \s-1METHOD URL\s0" 4 .IX Item "headers METHOD URL" Return the Authentication and DPoP headers for a \s-1HTTP\s0 \f(CW\*(C`METHOD\*(C'\fR request to \f(CW\*(C`URL\*(C'\fR. .IP "curl CURL-OPTS" 4 .IX Item "curl CURL-OPTS" Execute a curl command with Authentication and DPoP headers added. Add a \f(CW\*(C`\-\-\*(C'\fR option to the \f(CW\*(C`CURL\-OPTS\*(C'\fR to stop solid_auth from interpreting Curl options. .IP "list \s-1URL\s0" 4 .IX Item "list URL" List the resources in a \s-1LDP\s0 container at \s-1URL.\s0 .IP "mirror [\-rx] [\-\-skip] [\-\-delete] \s-1URL DIRECTORY\s0" 4 .IX Item "mirror [-rx] [--skip] [--delete] URL DIRECTORY" Mirror the contents of a container to a local directory. Optional provide \f(CW\*(C`\-r\*(C'\fR option for recursive mirror. .IP "upload [\-rx] \s-1DIRECTORY URL\s0" 4 .IX Item "upload [-rx] DIRECTORY URL" Upload a directorty to a container. Optional provide \f(CW\*(C`\-r\*(C'\fR option for recursive upload. With the \f(CW\*(C`\-x\*(C'\fR option, the command will run in demo mode. .IP "clean [\-rx] [\-\-keep] \s-1URL\s0" 4 .IX Item "clean [-rx] [--keep] URL" Clean all resources in a directory. Optional provide \f(CW\*(C`\-r\*(C'\fR option for recursive clean. With the \f(CW\*(C`\-x\*(C'\fR option, the command will run in demo mode. With the \&\f(CW\*(C`\-\-keep\*(C'\fR options all container will be kept. .IP "get \s-1URL\s0" 4 .IX Item "get URL" Return the response of a \s-1HTTP GET\s0 request to \s-1URL.\s0 .IP "post \s-1URL FILE\s0 [\s-1MIMETYPE\s0]" 4 .IX Item "post URL FILE [MIMETYPE]" Return the \s-1HTTP\s0 Message of a \s-1HTTP POST\s0 request of the \s-1FILE\s0 with \s-1MIMETYPE.\s0 Uses libmagic to guess the mimetype. .IP "put \s-1URL\s0 [\s-1FILE\s0] [\s-1MIMETYPE\s0]" 4 .IX Item "put URL [FILE] [MIMETYPE]" Return the \s-1HTTP\s0 Message of a \s-1HTTP PUT\s0 request of the \s-1FILE\s0 with \s-1MIMETYPE.\s0 Uses libmagic to guess the mimetype. .Sp When the \s-1URL\s0 ends with a slash (/), then a new container will be created. .IP "patch \s-1URL\s0 FILE|SPARQL" 4 .IX Item "patch URL FILE|SPARQL" Send the contents of a \s-1SPARQL\s0 patch file or string to a \s-1URL.\s0 Return the \&\s-1HTTP\s0 Message of the \s-1HTTP PATCH\s0 request to the \s-1URL.\s0 .IP "head \s-1URL\s0" 4 .IX Item "head URL" Return the \s-1HTTP\s0 Header of a \s-1HTTP HEAD\s0 request to \s-1URL.\s0 .IP "head \s-1OPTIONS\s0" 4 .IX Item "head OPTIONS" Return the \s-1HTTP\s0 Header of a \s-1HTTP OPTIONS\s0 request to \s-1URL.\s0 .IP "delete \s-1URL\s0" 4 .IX Item "delete URL" Return the \s-1HTTP\s0 Message of a \s-1HTTP DELETE\s0 request to \s-1URL.\s0 .IP "id_token" 4 .IX Item "id_token" Show the contents of the \s-1JWT\s0 id token. .IP "access_token" 4 .IX Item "access_token" Show the contents of the \s-1JWT\s0 access token. .SH "INSPIRATION" .IX Header "INSPIRATION" This was very much inspired by the Python solid-flask code by Rai at , and Jeff Zucker's Solid-Shell at . .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2021 by Patrick Hochstenbach. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.