Kernel::System::AccessToken::Storage

NAME

Kernel::System::AccessToken::Storage

DESCRIPTION

Authorization tokens base storage class.

Create()

Should save the entity in the storage.

    my $Result = $Storage->Create(
        Entity => '...',
        ...,
    );

Returns

    # access-token
    {
        ID             => '...',
        Token          => '...',
        UserID         => '...',
        UserType       => '...',
        ExpiresTime    => '...',
        CreateTime     => '...',
        LastAccessTime => '...',
    };

    # key
    {
        Value      => '...',
        CreateTime => '...',
    };

    or C<undef> in case any error occurs.

List()

Should return a list for the entity available in the storage.

    my $List = $Storage->List(
        Entity  => '...',
        Filters => {...}
    );

Returns

    C<undef> - in case any error occurs
    []       - in case no data was found for the entity
    [
        {...},
    ]

Delete()

Should delete entity records from the storage.

    my $Result = $Storage->Delete(
        Entity  => '...',
        Filters => {...}
    );

Returns

    1 - in case of success.
    C<undef> - in case any error occurs.

Update()

Should update entity records in the storage.

    my $Result = $Storage->Update(
        Entity  => '...',
        Filters => {...},
        Data    => {...}
    );

Returns

    1 - in case of success.
    C<undef> - in case any error occurs.

Count()

Should the number of records for the entity available in the storage.

    my $List = $Storage->Count(
        Entity  => '...',
        Filters => {...}
    );

Returns

    number   - in case of success
    C<undef> - in case any error occurs

_IsValidEntity()

Checks if the passed entity is valid.

    my $Valid = $Storage->_IsValidEntity( Entity => '...' );

Returns

    C<undef> - in case is invalid.
    1        - in case is valid.
Scroll to Top