<commit_before>(*
  Copyright 2016, MARS-Curiosity library

  Home: https://github.com/andrea-magni/MARS
*)
unit MARS.Core.Token;

{$I MARS.inc}

interface

uses
  SysUtils, Classes, Generics.Collections, SyncObjs, Rtti
, HTTPApp, IdGlobal

, MARS.Core.URL
, MARS.Utils.Parameters

{$IFDEF MSWINDOWSXXX}
, MARS.Utils.JWT.mORMot
{$ELSE}
, MARS.Utils.JWT.JOSE
{$ENDIF}
;

type
  TMARSToken = class
  public
  private
    FToken: string;
    FIsVerified: Boolean;
    FClaims: TMARSParameters;
    FCookieEnabled: Boolean;
    FCookieName: string;
    FCookieDomain: string;
    FCookiePath: string;
    FCookieSecure: Boolean;
    FRequest: TWebRequest;
    FResponse: TWebResponse;
    function GetUserName: string;
    procedure SetUserName(const AValue: string);
    function GetExpiration: TDateTime;
    function GetIssuedAt: TDateTime;
    function GetRoles: TArray<string>;
    procedure SetRoles(const AValue: TArray<string>);
    function GetDuration: TDateTime;
    function GetIssuer: string;
    procedure SetIssuer(const AValue: string);<commit_msg>* fixed IFDEF<commit_after>(*
  Copyright 2016, MARS-Curiosity library

  Home: https://github.com/andrea-magni/MARS
*)
unit MARS.Core.Token;

{$I MARS.inc}

interface

uses
  SysUtils, Classes, Generics.Collections, SyncObjs, Rtti
, HTTPApp, IdGlobal

, MARS.Core.URL
, MARS.Utils.Parameters

{$IFDEF MSWINDOWS}
, MARS.Utils.JWT.mORMot
{$ELSE}
, MARS.Utils.JWT.JOSE
{$ENDIF}
;

type
  TMARSToken = class
  public
  private
    FToken: string;
    FIsVerified: Boolean;
    FClaims: TMARSParameters;
    FCookieEnabled: Boolean;
    FCookieName: string;
    FCookieDomain: string;
    FCookiePath: string;
    FCookieSecure: Boolean;
    FRequest: TWebRequest;
    FResponse: TWebResponse;
    function GetUserName: string;
    procedure SetUserName(const AValue: string);
    function GetExpiration: TDateTime;
    function GetIssuedAt: TDateTime;
    function GetRoles: TArray<string>;
    procedure SetRoles(const AValue: TArray<string>);
    function GetDuration: TDateTime;
    function GetIssuer: string;
    procedure SetIssuer(const AValue: string);
{'fraction_non_alphanumeric': 0.09872461029759093, 'fraction_numerical': 0.003778932451582428, 'mean_word_length': 4.103614457831325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7429596', 'n_tokens_mistral': 762, 'n_tokens_neox': 720, 'n_words': 167}