NAME

Mojolicious::Plugin::Fondation::Auth::Token::Schema::Result::ApiToken - DBIx::Class Result class for api_tokens table

VERSION

version 0.01

DESCRIPTION

Stores SHA-256 hashes of personal access tokens.

Each user can have multiple tokens, each identified by a unique name.

NAME

Mojolicious::Plugin::Fondation::Auth::Token::Schema::Result::ApiToken - DBIx::Class Result for api_tokens

COLUMNS

id

Primary key, auto-increment.

user_id

Foreign key to users.id. Auto-set from current_user on create.

token_hash

SHA-256 hex digest of the raw token. writeOnly — never returned to client. Unique constraint.

name

Human-readable name for the token (e.g. "Script backup").

scopes

JSON array of permitted scopes (nullable, for future use).

last_used_at

Timestamp of last token usage (manual update, no set_on_update).

created_at

Timestamp of token creation. Auto-set on create.

RELATIONSHIPS

user

Belongs to Mojolicious::Plugin::Fondation::User::Schema::Result::User.

SEE ALSO

Mojolicious::Plugin::Fondation::Auth::Token

AUTHOR

Daniel Brosseau <dab@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Daniel Brosseau.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.