ImagingTools Core SDK
Public Member Functions | List of all members
imtauth::IPersonalAccessTokenabstract

#include <IPersonalAccessToken.h>

Inherits iser::ISerializable.

Inherited by imtauth::CPersonalAccessToken [virtual].

Public Member Functions

virtual QByteArray GetId () const =0
 
virtual void SetId (const QByteArray &id)=0
 
virtual QByteArray GetUserId () const =0
 
virtual void SetUserId (const QByteArray &userId)=0
 
virtual QString GetName () const =0
 
virtual void SetName (const QString &name)=0
 
virtual QString GetDescription () const =0
 
virtual void SetDescription (const QString &description)=0
 
virtual QByteArray GetTokenHash () const =0
 
virtual void SetTokenHash (const QByteArray &tokenHash)=0
 
virtual QByteArrayList GetScopes () const =0
 
virtual void SetScopes (const QByteArrayList &scopes)=0
 
virtual QDateTime GetCreatedAt () const =0
 
virtual void SetCreatedAt (const QDateTime &createdAt)=0
 
virtual QDateTime GetLastUsedAt () const =0
 
virtual void SetLastUsedAt (const QDateTime &lastUsedAt)=0
 
virtual QDateTime GetExpiresAt () const =0
 
virtual void SetExpiresAt (const QDateTime &expiresAt)=0
 
virtual bool IsRevoked () const =0
 
virtual void SetRevoked (bool revoked)=0
 
virtual bool IsExpired () const =0
 
virtual bool IsValid () const =0
 

Detailed Description

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.

Member Function Documentation

◆ 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
createdAtCreation timestamp in UTC to set

◆ SetDescription()

virtual void imtauth::IPersonalAccessToken::SetDescription ( const QString &  description)
pure virtual

Set token description explaining its purpose.

Parameters
descriptionToken description to set

◆ SetExpiresAt()

virtual void imtauth::IPersonalAccessToken::SetExpiresAt ( const QDateTime &  expiresAt)
pure virtual

Set timestamp when the token expires.

Parameters
expiresAtExpiration 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
idToken ID to set

◆ SetLastUsedAt()

virtual void imtauth::IPersonalAccessToken::SetLastUsedAt ( const QDateTime &  lastUsedAt)
pure virtual

Set timestamp when the token was last used.

Parameters
lastUsedAtLast used timestamp in UTC to set

◆ SetName()

virtual void imtauth::IPersonalAccessToken::SetName ( const QString &  name)
pure virtual

Set human-readable token name.

Parameters
nameToken name to set

◆ SetRevoked()

virtual void imtauth::IPersonalAccessToken::SetRevoked ( bool  revoked)
pure virtual

Set revocation status of the token.

Parameters
revokedTrue 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
scopesList of scope identifiers to set

◆ SetTokenHash()

virtual void imtauth::IPersonalAccessToken::SetTokenHash ( const QByteArray &  tokenHash)
pure virtual

Set SHA-256 hash of the token.

Parameters
tokenHashToken hash to set

◆ SetUserId()

virtual void imtauth::IPersonalAccessToken::SetUserId ( const QByteArray &  userId)
pure virtual

Set user identifier who owns this token.

Parameters
userIdUser ID to set