5.7.76. Bugzilla::User::APIKey

5.7.76.1. NAME

Bugzilla::User::APIKey - Model for an api key belonging to a user.

5.7.76.2. SYNOPSIS

use Bugzilla::User::APIKey;

my $api_key = Bugzilla::User::APIKey->new($id);
my $api_key = Bugzilla::User::APIKey->new({ name => $api_key });

# Class Functions
$user_api_key = Bugzilla::User::APIKey->create({
    description => $description,
});

5.7.76.3. DESCRIPTION

This package handles Bugzilla User::APIKey.

Bugzilla::User::APIKey is an implementation of Bugzilla::Object, and thus provides all the methods of Bugzilla::Object in addition to the methods listed below.

5.7.76.4. METHODS

Accessor Methods

id

The internal id of the api key.

user

The Bugzilla::User object that this api key belongs to.

user_id

The user id that this api key belongs to.

api_key

The API key, which is a random string.

description

An optional string that lets the user describe what a key is used for. For example: "Dashboard key", "Application X key".

revoked

If true, this api key cannot be used.

last_used

The date that this key was last used. undef if never used.

update_last_used

Updates the last used value to the current timestamp. This is updated even if the RPC call resulted in an error. It is not updated when the description or the revoked flag is changed.

set_description

Sets the new description

set_revoked

Sets the revoked flag

This documentation undoubtedly has bugs; if you find some, please file them here.