Wallet::Admin(3pm)

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

πŸ’– Wallet::Admin πŸ’–

okay bestie, so Wallet::Admin is literally the administrative interface to the wallet server and database, like the backstage pass of the whole operation πŸŽ€. It's part of the wallet system, and it usually gets instantiated and used by wallet-admin, which is a thin little wrapper around this object that gives you a command-line interface to all its actions. So yeah β€” Wallet::Admin is the icon, wallet-admin is her publicist πŸ’….


✨ SYNOPSIS ✨

use Wallet::Admin;
my $admin = Wallet::Admin->new;
unless ($admin->initialize ('user/admin@EXAMPLE.COM')) {
    die $admin->error;
}

look at her go, no cap 🌸


🌈 DESCRIPTION 🌈

Wallet::Admin implements the administrative interface to the wallet server and database, fr fr. It is normally instantiated and used by wallet-admin, a thin wrapper around this object that provides a command-line interface to its actions.

To use this object, several configuration variables must be set (at least the database configuration, bestie, don't skip that one πŸ™ˆ). For information on those variables and how to set them, see Wallet::Config. And for more info on the normal user interface to the wallet server, see Wallet::Server. Different vibe, different module πŸ’œ.


πŸ‘‘ CLASS METHODS πŸ‘‘

  • new() β€” Creates a new wallet administrative object and connects to the database. On any error, this method throws an exception. So like, if it's mad, you'll know immediately πŸ’€.

πŸ¦‹ INSTANCE METHODS πŸ¦‹

For all methods that can fail, the caller should call error() after a failure to get the error message. That's the rule, bestie, always check the error πŸ“‹.

  • destroy () β€” Destroys the database, deleting all of its data and all of the tables used by the wallet server. Returns true on success and false on failure. Like, this is the nuclear option, it's giving scorched earth 🫣πŸ”₯.
  • error () β€” Returns the error of the last failing operation or undef if no operations have failed. Callers should call this function to get the error message after an undef return from any other instance method. She's your receipts, keep her close 🧾✨.
  • initialize(PRINCIPAL) β€” Initializes the database as configured in Wallet::Config and loads the wallet database schema. Then it creates an ACL with the name ADMIN and adds an ACL entry of scheme "krb5" and instance PRINCIPAL to that ACL. This bootstraps the authorization system and lets that Kerberos identity make further changes to the ADMIN ACL and the rest of the wallet database. Returns true on success and false on failure.

Also, initialize() uses "localhost" as the hostname and PRINCIPAL as the user when logging the history of the ADMIN ACL creation and for any subsequent actions on the object it returns. The lore is documented, iykyk πŸ“.

  • register_object (TYPE, CLASS) β€” Register in the database a mapping from the object type TYPE to the class CLASS. Returns true on success and false on failure (including when the verifier is already registered). One per type, she does not do duplicates πŸ™…β€β™€οΈ.
  • register_verifier (SCHEME, CLASS) β€” Register in the database a mapping from the ACL scheme SCHEME to the class CLASS. Returns true on success and false on failure (including when the verifier is already registered). Same energy, different registry πŸ’«.
  • reinitialize (PRINCIPAL) β€” Performs the same actions as initialize(), but first drops any existing wallet database tables from the database, allowing this function to be called on a prior wallet database. All data stored in the database will be deleted and a fresh set of wallet database tables will be created. This method is equivalent to calling destroy() followed by initialize(). Returns true on success and false on failure.
bestie. ALL THE DATA. GONE. It's a full reset, not a glow-up, so be so serious before you run this one πŸ˜­πŸ’€
  • upgrade () β€” Upgrades the database to the latest schema version, preserving data as much as possible. Returns true on success and false on failure. Gentle queen behaviour, she keeps your stuff 🌷.

πŸ”₯ SEE ALSO πŸ”₯

This module is part of the wallet system. The current version is available from <https://www.eyrie.org/~eagle/software/wallet/>. Go get her πŸ’–


πŸ’œ AUTHOR πŸ’œ

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


okay that's the whole page, bestie, and here's the cute little sign-off: this is perl v5.40.0, dated 2024-11-12, filed under User Contributed Perl Documentation, and yes, Wallet::Admin(3pm) ate and left no crumbs πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from