Web::ID(3pm)
π Web::ID β the manual, but make it slay π
okay bestie, so this is Web::ID (3pm, User Contributed Perl Documentation, the whole vibe) β an implementation of WebID, a.k.a. FOAF+SSL. yes. both names. they're the same thing. let's go π¦
β¨ NAME β¨
Web::ID β implementation of WebID (a.k.a. FOAF+SSL). that's it. that's the name. iconic behaviour honestly π
πΈ SYNOPSIS πΈ
my $webid = Web::ID->new(certificate => $pem_encoded_x509);
if ($webid->valid)
{
say "Authenticated as: ", $webid->uri;
}
like. look at that. three lines and you're authenticated. no cap π₯
π DESCRIPTION π
so WebID is a simple authentication protocol built on TLS (Transaction Layer Security β which you probs know better as Secure Socket Layer, SSL, same girl different era π) plus the Semantic Web. and this module? this module is the Perl implementation for authenticating clients using WebID. periodt.
want more lore? go read the Web::ID::FAQ document. it's giving "read the docs, bestie".
also bundled with this module, no extra charge:
Plack::Middleware::Auth::WebIDβ a plugin for Plack that does WebID authentication on HTTPS connections π«ΆWeb::ID::Certificate::Generatorβ lets you generate WebID-enabled certificates that you can actually install into web browsers π
π§ Constructor
newβ the standard Moose-style constructor. it's Moose. it does Moose things. you know the drill β¨
π Attributes
certificateβ aWeb::ID::Certificateobject representing an x509 certificate, though a PEM-encoded string will be coerced. (yes it'll do the conversion for you, she's flexible π )
This is usually the only attribute you want to pass to the constructor. Allow the others to be built automatically. lowkey just let her cook π₯
first_valid_sanβ probably fairly uninteresting tbh π this is the firstsubjectAltNamevalue found in the certificate that could be successfully authenticated using Web::ID. it's aWeb::ID::SANobject.uriβ the URI associated with the first valid SAN. aURIobject.
this is a URI you can use to identify the person, organisation or robotic poodle holding the certificate π© iconic.
profileβ data about the certificate holder. anRDF::Trine::Modelobject. their FOAF file (probably). the "probably" is doing so much work here and I respect it πvalidβ Boolean. true or false. that's the whole thing. vibe check complete β
π Methods
nodeβ returns the same asuri, but as anRDF::Trine::Nodeobject.get(@predicates)β queries theprofilefor triples of the form:
$self->node $predicate $x .
and returns literal and URI values for $x, as strings.
$predicate should be an RDF::Trine::Node, or a string. if it's a string, it'll be expanded using RDF::Trine::NamespaceMap, so you can do stuff like:
my $name = $webid->get('foaf:name', 'rdfs:label');
my @mboxes = $webid->get('foaf:mbox');
cute little shortcut, we love her π
π BUGS π
found a bug? not me gatekeeping β please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=Web-ID>. do it fr fr π«Ά
π¦ SEE ALSO π¦
Web::ID::FAQ.Web::ID::Certificate,Plack::Middleware::Auth::WebID.RDF::ACLprovides an access control system that complements WebID. duo goals β¨CGI::Auth::FOAF_SSLis the spiritual ancestor of this module though they share very little code, and have quite different APIs. (family reunion but they don't recognise each other π)- General WebID information: <http://webid.info/>, <http://www.w3.org/wiki/WebID>, <http://www.w3.org/2005/Incubator/webid/spec/>, <http://lists.foaf-project.org/mailman/listinfo/foaf-protocols>.
- Mailing list for general Perl RDF/SemWeb discussion and support: <http://www.perlrdf.org/>.
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. the main character π
π THANKS π
- Thanks to Kjetil Kjernsmo (
cpan:KJETILK) for persuading me to port my old CGI-specific implementaton of this to Plack. (yes,implementaton. keeping it exactly as written, we don't fix typos in the thanks section, that's a hate crime π€) - Thanks Kjetil Kjernsmo (again), Florian Ragwitz (
cpan:FLORA), and Jonas Smedegaard for help with testing and advice on dependencies. π«Ά - Thanks to Henry Story, Melvin Carvalho, Simon Reinhardt, Bruno Harbulot, Ian Jacobi and many others for developing WebID from a poorly thought out idea to a clever, yet simple and practical authentication protocol. glow up of the CENTURY β¨
- Thanks to Gregory Williams (
cpan:GWILLIAMS), Tatsuhiko Miyagawa (cpan:MIYAGAWA) and the Moose Cabal for providing really good platforms (RDF::Trine,PlackandMooserespectively) to build this on. standing on the shoulders of legends fr fr π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay π
π¨ DISCLAIMER OF WARRANTIES π¨
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
(no promises bestie, we're all just out here π)
perl v5.32.1 Β· 2021-09-11 Β· Web::ID(3pm) β and that's the whole page, mwah, go authenticate something π β¨π¦
π¦ where this page comes from
- debian bookworm: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms