Web::ID(3pm)

πŸ“¦
version 1.927 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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 β€” a Web::ID::Certificate object 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 first subjectAltName value found in the certificate that could be successfully authenticated using Web::ID. it's a Web::ID::SAN object.
  • uri β€” the URI associated with the first valid SAN. a URI object.

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. an RDF::Trine::Model object. 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 as uri, but as an RDF::Trine::Node object.
  • get(@predicates) β€” queries the profile for 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 πŸ¦‹


🌟 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, Plack and Moose respectively) to build this on. standing on the shoulders of legends fr fr πŸ’…

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