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

NAME

Smolder::AuthInfo

DESCRIPTION

Utility class to manage authentication tickets.

METHODS

new

Returns a new object.

    my $ai = Smolder::AuthInfo->new();

ticket

Return a new auth ticket given an id and groups.

    $ai->ticket(
        id     => $dev->id,
        groups => [qw(developer admin)],
    );

parse

Parse an auth ticket. The user's id and groups are then available in the id() and groups() methods if the ticket was not tampered with.

    $ai->parse($string);
    my $id = $at->id;
    my $groups = $at->groups;

groups

Returns an array reference containing the groups of the most recently parsed auth ticket.

id

Returns the id of the most recently parsed auth ticket.