Wallet...:NetDB(3pm)

πŸ“¦ version 1.7, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Wallet::ACL::NetDB β€” the NetDB ACL verifier πŸ’–

okay bestie, gather round, because this one is the Wallet::ACL::NetDB page from the User Contributed Perl Documentation, and it's literally the thing that checks whether somebody's allowed in based on their NetDB roles. no cap. let's get into it 🫢


✨ NAME ✨

Wallet::ACL::NetDB β€” the Wallet ACL verifier for NetDB roles. that's the whole vibe. πŸ‘‘


✨ SYNOPSIS ✨

my $verifier = Wallet::ACL::NetDB->new;
my $status = $verifier->check ($principal, $node);
if (not defined $status) {
    die "Something failed: ", $verifier->error, "\n";
} elsif ($status) {
    print "Access granted\n";
} else {
    print "Access denied\n";
}

look at her go. three outcomes, three branches, no drama. πŸ’…


✨ DESCRIPTION ✨

so Wallet::ACL::NetDB takes a principal and checks it against the NetDB roles for a given host. that's it, that's the job.

it's used to verify ACL lines of type netdb. and here's the tea: the value of such an ACL is a node, and the ACL grants access to a given principal if and only if that principal has one of the roles user, admin, or team for that node. all three. those exact three. don't get creative. πŸŽ€

now, to use this object, several configuration parameters must be set. like, must. go read Wallet::Config for the details on those configuration parameters and for info on how to set wallet configuration. it's giving "required reading", because it is. πŸ“š


✨ METHODS ✨

  • new() β€” creates a new ACL verifier. it opens the remctl connection to the NetDB server and authenticates. that's the whole method. she connects, she says hi, she's in. πŸ¦‹
  • check(PRINCIPAL, ACL) β€” returns true if PRINCIPAL is granted access according to ACL, false if not, and undef on an error (peep "DIAGNOSTICS" below, bestie). ACL is a node, and PRINCIPAL will be granted access if it β€” with the realm stripped off if configured β€” has the user, admin, or team role for that node. ✨
  • error() β€” returns the error if check() returned undef. that's your "what went wrong" receipt. 🧾

✨ DIAGNOSTICS ✨

new() can fail with these exceptions

  • NetDB ACL support not available: %s β€” the Net::Remctl Perl module, which is required for NetDB ACL support, could not be loaded. no module, no service. 😭
  • NetDB ACL support not configured β€” the required configuration parameters were not set. go see Wallet::Config(3) for the required configuration parameters and how to set them. she can't work with nothing, bestie. πŸ™ˆ
  • cannot connect to NetDB remctl interface: %s β€” connecting to the NetDB remctl interface failed, with the given error message. the connection said no. πŸ’€

check() / error() errors

verifying a NetDB ACL may fail with the following errors, which come back from the error() method:

  • cannot check NetDB ACL: %s β€” issuing the remctl command to get the roles for the given principal failed or returned an error.
  • error checking NetDB ACL: %s β€” the NetDB remctl interface that returns the roles for a user returned an error message or otherwise returned failure.
  • malformed netdb ACL β€” the ACL parameter to check() was malformed. right now, this error is only given if ACL is undef or the empty string.
  • malformed NetDB remctl token: %s β€” the Net::Remctl Perl library returned a malformed token. this should never happen and indicates a bug in Net::Remctl. fr fr, that's a bug, not a you problem. πŸ›
  • no principal specified β€” the PRINCIPAL parameter to check() was undef or the empty string.

✨ CAVEATS ✨

the list of possible NetDB roles that should be considered sufficient to grant access is not currently configurable. so the three roles are the three roles. periodt. πŸ”’

✨ SEE ALSO ✨

Net::Remctl(3), Wallet::ACL(3), Wallet::ACL::Base(3), Wallet::Config(3), wallet-backend(8)

NetDB is a free software system for managing DNS, DHCP, and related machine information for large organizations. for more info on NetDB, see https://web.stanford.edu/group/networking/netdb/ 🌈

this module is part of the wallet system. the current version is available from https://www.eyrie.org/~eagle/software/wallet/ 🫢


✨ AUTHOR ✨

Russ Allbery <eagle@eyrie.org> β€” the icon, the legend, the author. πŸ‘‘


and that's the whole page, bestie!! this doc is from perl v5.40.0, dated 2024-11-12, and it's the Wallet...:NetDB(3pm) page β€” the User Contributed Perl Documentation version, to be exact. slay, go configure your wallet, and stay iconic πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from