NAME
Kernel::System::AccessToken::Token – Represents an access-token record.
PUBLIC INTERFACE
has UUID
Attribute that holds record UUID.
has Token
Attribute that holds record jwt
token.
has UserID
Attribute that holds record user id.
has UserType
Attribute that holds record user type ('agent' or 'customer').
has CreateTime
Attribute that holds create time of the record.
has ExpiresTime
Attribute that holds expires time of the record.
has LastAccessTime
Attribute that holds last access time when it was used.
has IsCountedForLimits
Attribute that indicates if the token should be included in the counting or not. Possible values are: – 0, for tokens that should not be included in the counting, e.g. generic-interface requests. – 1, for tokens that should be included, e.g. web-app requests.
has IsInteractive
Attribute that indicates if is from an interactive user or not.
has IsOneTimeOnly
Attribute that indicates if the token is for short-term usage only.
FromClient
Attribute that holds the information of the app that created/uses this token.
DecodedData()
Returns the jwt
token decoded.
Delete()
Returns the token from the storage
my $Result = $Token->Delete();
Returns
1 - in case of success.
C<undef> - in case any error occurs.
UpdateLastAccessTime()
Updates the token last access time (last time that the token was used to access to the API).
my $Result = $Token->UpdateLastAccessTime();
Returns
1 - in case of success.
C<undef> - in case any error occurs.
IsValid()
Checks if the token is valid. Is considered valid if it pass in the following checks: – we could decode the jwt
token. – did not reach the maximum idle time. – the client IP is the same that generated the token (if active).
my $Result = $Token->IsValid();
Returns
1 - in case is valid.
C<undef> - in case is considered invalid.
User()
Fast accessor for the jwt
token property 'sub'(subject) that corresponds to the user that the token was generated to.
DeviceUUID()
Fast accessor for the jwt
token data property 'device_uuid' that corresponds to the device that the token was generated to.
PRIVATE INTERFACE
has _Data
Attribute that holds the decoded jwt
token data.
has _AccessTokenModule
Attribute that holds a reference for the main access-token module/object.
_OverloadBool()
Operator overloading for 'boolean' expressions.