#include <IPersonalAccessToken.h>
Inherits iser::ISerializable.
Inherited by imtauth::CPersonalAccessToken [virtual].
Interface for describing a personal access token.
Personal access tokens (PATs) provide a way to authenticate API requests without using passwords. Each token has a unique identifier, is associated with a user, and can have scoped permissions and an expiration date.
Definition at line 23 of file IPersonalAccessToken.h.
◆ GetCreatedAt()
| virtual QDateTime imtauth::IPersonalAccessToken::GetCreatedAt |
( |
| ) |
const |
|
pure virtual |
Get timestamp when the token was created.
- Returns
- Creation timestamp in UTC
◆ GetDescription()
| virtual QString imtauth::IPersonalAccessToken::GetDescription |
( |
| ) |
const |
|
pure virtual |
Get token description explaining its purpose.
- Returns
- Token description
◆ GetExpiresAt()
| virtual QDateTime imtauth::IPersonalAccessToken::GetExpiresAt |
( |
| ) |
const |
|
pure virtual |
Get timestamp when the token expires.
- Returns
- Expiration timestamp in UTC, or invalid QDateTime if no expiration
◆ GetId()
| virtual QByteArray imtauth::IPersonalAccessToken::GetId |
( |
| ) |
const |
|
pure virtual |
Get token identifier.
- Returns
- Unique token ID
◆ GetLastUsedAt()
| virtual QDateTime imtauth::IPersonalAccessToken::GetLastUsedAt |
( |
| ) |
const |
|
pure virtual |
Get timestamp when the token was last used.
- Returns
- Last used timestamp in UTC, or invalid QDateTime if never used
◆ GetName()
| virtual QString imtauth::IPersonalAccessToken::GetName |
( |
| ) |
const |
|
pure virtual |
Get human-readable token name.
- Returns
- Token name
◆ GetScopes()
| virtual QByteArrayList imtauth::IPersonalAccessToken::GetScopes |
( |
| ) |
const |
|
pure virtual |
Get list of permission scopes granted to this token.
- Returns
- List of scope identifiers
◆ GetTokenHash()
| virtual QByteArray imtauth::IPersonalAccessToken::GetTokenHash |
( |
| ) |
const |
|
pure virtual |
Get SHA-256 hash of the token. The actual token value is never stored, only its hash for security.
- Returns
- Token hash in hexadecimal format
◆ GetUserId()
| virtual QByteArray imtauth::IPersonalAccessToken::GetUserId |
( |
| ) |
const |
|
pure virtual |
Get user identifier who owns this token.
- Returns
- User ID
◆ IsExpired()
| virtual bool imtauth::IPersonalAccessToken::IsExpired |
( |
| ) |
const |
|
pure virtual |
Check if the token has expired.
- Returns
- True if token has passed its expiration date, false otherwise
◆ IsRevoked()
| virtual bool imtauth::IPersonalAccessToken::IsRevoked |
( |
| ) |
const |
|
pure virtual |
Check if the token has been revoked.
- Returns
- True if token is revoked, false otherwise
◆ IsValid()
| virtual bool imtauth::IPersonalAccessToken::IsValid |
( |
| ) |
const |
|
pure virtual |
Check if the token is valid (not revoked and not expired).
- Returns
- True if token can be used for authentication, false otherwise
◆ SetCreatedAt()
| virtual void imtauth::IPersonalAccessToken::SetCreatedAt |
( |
const QDateTime & |
createdAt | ) |
|
|
pure virtual |
Set timestamp when the token was created.
- Parameters
-
| createdAt | Creation timestamp in UTC to set |
◆ SetDescription()
| virtual void imtauth::IPersonalAccessToken::SetDescription |
( |
const QString & |
description | ) |
|
|
pure virtual |
Set token description explaining its purpose.
- Parameters
-
| description | Token description to set |
◆ SetExpiresAt()
| virtual void imtauth::IPersonalAccessToken::SetExpiresAt |
( |
const QDateTime & |
expiresAt | ) |
|
|
pure virtual |
Set timestamp when the token expires.
- Parameters
-
| expiresAt | Expiration timestamp in UTC to set, or invalid QDateTime for no expiration |
◆ SetId()
| virtual void imtauth::IPersonalAccessToken::SetId |
( |
const QByteArray & |
id | ) |
|
|
pure virtual |
Set token identifier.
- Parameters
-
◆ SetLastUsedAt()
| virtual void imtauth::IPersonalAccessToken::SetLastUsedAt |
( |
const QDateTime & |
lastUsedAt | ) |
|
|
pure virtual |
Set timestamp when the token was last used.
- Parameters
-
| lastUsedAt | Last used timestamp in UTC to set |
◆ SetName()
| virtual void imtauth::IPersonalAccessToken::SetName |
( |
const QString & |
name | ) |
|
|
pure virtual |
Set human-readable token name.
- Parameters
-
◆ SetRevoked()
| virtual void imtauth::IPersonalAccessToken::SetRevoked |
( |
bool |
revoked | ) |
|
|
pure virtual |
Set revocation status of the token.
- Parameters
-
| revoked | True to revoke the token, false otherwise |
◆ SetScopes()
| virtual void imtauth::IPersonalAccessToken::SetScopes |
( |
const QByteArrayList & |
scopes | ) |
|
|
pure virtual |
Set list of permission scopes granted to this token.
- Parameters
-
| scopes | List of scope identifiers to set |
◆ SetTokenHash()
| virtual void imtauth::IPersonalAccessToken::SetTokenHash |
( |
const QByteArray & |
tokenHash | ) |
|
|
pure virtual |
Set SHA-256 hash of the token.
- Parameters
-
| tokenHash | Token hash to set |
◆ SetUserId()
| virtual void imtauth::IPersonalAccessToken::SetUserId |
( |
const QByteArray & |
userId | ) |
|
|
pure virtual |
Set user identifier who owns this token.
- Parameters
-