The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Angerwhale::Model::UserStore - Manages Blog users.

SYNOPSIS

Keeps track of the blog's users.

    my $pgp_id = "cafebabe";
    my $user   = $c->model('UserStore')->get_user_by_nice_id($pgp_id);
    print "$pgp_id is ". $user->fullname;

See also Angerwhale::User. Note that users are cached; they are refreshed from the keyserver according to the config's update_interval in seconds. Defaults to one hour.

If a user exists, but a keyserver can't be contacted, the old data will still be used.

CONFIGURATION

keyserver

The keyserver to fetch PGP keys from. Defaults to subkeys.pgp.net, since other keyservers can't manage to properly store and retieve the author's key.

update_interval

Try to update user info from keyserver after this many seconds. Defaults to 3600, one hour.

METHODS

new

Called by Catalyst to create and initialize userstore.

create_user_by_real_id

create_user_by_nice_id

Creates a new user in the user store (by the OpenPGP keyid "cafebabe" [nice] or the Crypt::OpenPGP representation of that number [real]). Returns the Angerwhale::User on success, exception on failure.

get_user_by_real_id

get_user_by_nice_id

Retrieves the user, creating it if necessary.

refresh_user

Refresh the user's details from the keyserver

store_user

Write the user's data to disk, so that attributes can be changed and so that the blog will work if the keyserver goes offline.

last_updated

Returns the time of the most recent refresh of all users.

users

Returns a list of all the users (Angerwhale::Userss) the system knows about. The users are refreshed if they've expired.

NAME

Angerwhale::Model::UserStore - Catalyst Model

SYNOPSIS

See Angerwhale

DESCRIPTION

Catalyst Model.

AUTHOR

Jonathan Rockway

LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.